Breaking Code

December 23, 2008

bin2py.py

Filed under: Tools — Tags: , — Mario Vilas @ 6:14 pm

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.

Updated

Aug 3, 2011: Added some speed optimizations.

Download the code: bin2py.py

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: