Catégories
Open-source Systeme

Le Hachoir des fichiers

HachoirSous ce titre à 20 centimes d’Euro, se cache un petit bijoux que seul le monde open-source peut offrir. Hachoir est en effet capable de reconnaître plus de 70 formats de fichiers et d’en extraire des données importantes.

Description

Hachoir est en fait une boîte à outils comprenant:

hachoir-core: les librairies de base permettant de traiter les fichiers

hachoir-metadata: avec cet outil on peut extraire en ligne de commande des informaions sur le contenu des fichiers. Un exemple:

# hachoir-metadata –type logo-Kubuntu.png sheep_on_drugs.mp3 wormux_32x32_16c.ico
logo-Kubuntu.png: PNG picture: 331x90x8 (alpha layer)
sheep_on_drugs.mp3: MPEG v1 layer III, 128.0 Kbit/sec, 44.1 KHz, Joint stereo
wormux_32x32_16c.ico: Microsoft Windows icon: 16x16x32

ou bien:

$ hachoir-metadata logo-Kubuntu.png
Image:
– Image width: 331
– Image height: 90
– Bits/pixel: 8
– Image format: Color index
– Creation date: 2006-05-26 09:41:46
– Compression: deflate
– MIME type: image/png
– Endian: Big endian

hachoir-parser: une extension de hachoir-metadata pour avoir en une seule commande toutes les informations sur un fichier

hachoir-subfile: Permet de rechercher des fichiers dans un flux binaire (fichier archive, flux réseau…).

Exemple:

# hachoir-subfile chiens.PPS
[+] Start search (828.5 KB)
[+] Found file at 0: Microsoft Office document
[+] Found file at 537 size=28449 (27.8 KB): JPEG picture: 433×300 pixels
[+] Found file at 29011 size=34761 (33.9 KB): JPEG picture: 433×300 pixels
[+] Found file at 63797 size=40326 (39.4 KB): JPEG picture: 433×300 pixels
[+] Found file at 104148 size=30641 (29.9 KB): JPEG picture: 433×300 pixels
[+] Found file at 134814 size=22782 (22.2 KB): JPEG picture: 384×325 pixels
[+] Found file at 157621 size=24744 (24.2 KB): JPEG picture: 443×313 pixels
[+] Found file at 182390 size=27241 (26.6 KB): JPEG picture: 443×290 pixels
[+] Found file at 209656 size=27407 (26.8 KB): JPEG picture: 443×336 pixels
[+] Found file at 237088 size=30088 (29.4 KB): JPEG picture: 388×336 pixels
[+] Found file at 267201 size=30239 (29.5 KB): JPEG picture: 366×336 pixels
[+] Found file at 297465 size=81634 (79.7 KB): JPEG picture: 630×472 pixels
[+] Found file at 379124 size=36142 (35.3 KB): JPEG picture: 599×432 pixels
[+] Found file at 415291 size=28801 (28.1 KB): JPEG picture: 443×303 pixels
[+] Found file at 444117 size=28283 (27.6 KB): JPEG picture: 433×300 pixels
[+] Found file at 472425 size=95913 (93.7 KB): PNG picture: 433x431x8
[+] Found file at 568363 size=219252 (214.1 KB): PNG picture: 532x390x8
[+] Found file at 811308 size=20644 (20.2 KB): Microsoft Windows Metafile (WMF) picture
[+] Search done — offset=848384 (828.5 KB)
Total time: 1.30 sec — 635.1 KB/sec

hachoir-urwid: une interface utilisateur en mode texte

hachoir-wx: une interface utilisateur en mode graphique (WX)

hachoir-html: une interface utilisateur en HTML/Ajax (écrite en Python)

Installation

Hachoir est disponible sous Linux / FreeBSD et tout autres systèmes compatibles (Python version 2.4 ou sup.).

Par nicolargo

Créateur de blog de Nicolargo, je suis un partisan des logiciels libres et un passionné des nouvelles technologies.