A quick little script for dumping a binary file into a view similar to a hex editor.Why not just *use* a hex editor, you say? Well, this allows me to carve up and document a binary file in word (or notepad+) as i try to parse its format from some limited documentation. Anyway, here it is: bytes = File.read("some-binary-file") while bytes line = bytes[0,16] bytes = bytes[16,bytes.length] d='' line.each_byte{|i| d+="%02X "%i} d+=" "*(16-line.length) d+=' ' line.each_byte{|i| d+=(0x20

Thanks for reading! And if you want to get in touch, I'd love to hear from you: chris.hulbert at gmail.

Chris Hulbert

(Comp Sci, Hons - UTS)

iOS Developer (Freelancer / Contractor) in Australia.

I have worked at places such as Google, Cochlear, Assembly Payments, News Corp, Fox Sports, NineMSN, FetchTV, Coles, Woolworths, Trust Bank, and Westpac, among others. If you're looking for help developing an iOS app, drop me a line!

Get in touch:
[email protected]

 Subscribe via RSS