Hi there folks.
Here’s a little tool I coded quite some time ago, and probably we all have done the same at one time or another, maybe over and over again. It’s yet another binary-to-python-code converter. The catch is, this one has a few extra options that may come in handy…
- Encodes using repr(), hexadecimal or base64
- Compress with zlib or gzip
- Also generates the code to uncompress and/or decode the data
- Can work with a batch of files
- Can generate multiple output files, or merge all output into one file
- Cross-platform, of course, since it’s made in Python 🙂
The code kinda sucks (no classes, all functions, lots of copy paste) but it works. Anyway, a friend told me It’d be a good idea to post it here, so here it is. Enjoy.
Aug 3, 2011: Added some speed optimizations.