News for hackers. Stuff that matters.
Re:Python for Reverse Engineering 1: ELF Binaries by civility on Friday March 22, 2019 @02:24PM (#19465403)
I disagree. The struct and array (not Numpy) modules are pretty great at cutting up binary data. You provide a format string and it just works.
Re:Python for Reverse Engineering 1: ELF Binaries by vram22 on Friday March 22, 2019 @04:45PM (#19466750)
Might be useful for beginners to binary file I/O in Python and reverse engineering of data formats:

DBFReader.py [1], which is part of my xtopdf toolkit [2] is a program that uses struct.unpack() multiple times to decode the fields in a DBF (XBASE) file.

[1] https://bitbucket.org/vasudevram/xtopdf/src/default/DBFReade...

[2] http://slides.com/vasudevram/xtopdf

I had first written a Pascal program to read and dump DBF file data after reverse-engineering the DBF format, based on some sketchy info I had access to, years ago. Later wrote the same program in C, and later still in Python, i.e. DBFReader.py .

Re:Python for Reverse Engineering 1: ELF Binaries by jgalt212 on Friday March 22, 2019 @03:43PM (#19466161)
your statement and his statement are both True (Python spelling variant). Of course, I don't think there are many books or tutorials geared towards beginners that deal with manipulating binary data.

> Also many python tutorials and books fails to mentioned how to manipulate binary data

Re:Python for Reverse Engineering 1: ELF Binaries by billfruit on Friday March 22, 2019 @07:18PM (#19467852)
I thought, the format string is unintutive if there are nested binary structures or if there are arrays of nested binary structures.
Re:Python for Reverse Engineering 1: ELF Binaries by civility on Friday March 22, 2019 @07:45PM (#19468006)
I do wish they were combined. It would be nice to handle arrays of structs and structs of arrays more gracefully, and it's unfortunate how the format strings almost (but not really) agree with each other.

And so long as I'm asking for ponies, it would also be nice if they handled complex numbers gracefully.