Marco Pontello's Home Page
HdRen
Questa pagina in italiano

(Last updated: 29/01/20)
 

 


HdRen

HdRen is a very simple tool I built for my own use some months ago, but since it may be useful to others, I decided to put it online.
Its only purpose is to rename files using the hexdump of their first bytes, thus providing a quick way to group files by their types, or spot suspicious files with a quick look, just by sorting them alphabetically.

It's coded in plain Python 2.x using only standard modules, so it should work right away on just about any platform.

For example, here's a small list of files, supposedly Office's documents and some photos:

 30/12/2002  18:00            47.616 document.doc
 09/04/2002  16:56           321.024 letter.doc
 08/05/1997  07:52            47.616 manual.doc
 16/12/2013  17:28            66.634 photo001.jpg
 19/11/2012  17:30            66.669 photo002.jpg
 27/04/2013  22:33             1.734 photo003.jpg
 17/09/2012  12:23            66.995 photo004.jpg
 25/05/2001  16:42            47.616 to-do-list.doc          

And here's the same group of files after being renamed by HdRen:

 27/04/2013  22:33             1.734 4C000000=photo003.jpg
 09/04/2002  16:56           321.024 4D5A5000=letter.doc
 30/12/2002  18:00            47.616 D0CF11E0=document.doc
 08/05/1997  07:52            47.616 D0CF11E0=manual.doc
 25/05/2001  16:42            47.616 D0CF11E0=to-do-list.doc 
 16/12/2013  17:28            66.634 FFD8FFE0=photo001.jpg
 19/11/2012  17:30            66.669 FFD8FFE0=photo002.jpg
 17/09/2012  12:23            66.995 FFD8FFE0=photo004.jpg

This way, either at the command prompt or in any files manager, it's easy to spot the two indruders.

It's possible to recurse subdirs and specify the lenght of the header to be added:

 HdRen - hexdump file renamer v1.02 - (C) 2015 By M.Pontello

 usage: hdren.py [-h] [-v] [-l n] [-r] filenames [filenames ...] 

 Rename a number of files adding their n bytes header hexdump.

 positional arguments:
   filenames      Files to scan (can include path & wildcards)

 optional arguments:
   -h, --help     show this help message and exit
   -v, --version  show program's version number and exit
   -l n, --len n  header's lenght
   -r, --recurse  recurse subdirs 

Download

HdRen v1.02, 1KB ZIP

Change Log

HdRen v1.02 - 23/02/15:
+ Fixed a minor bug parsing the filespecs

HdRen v1.01 - 23/02/15:
+ Recurse subdirs + Specify header lenght

HdRen v1.00 - 03/11/14:
- First public version