obutils is a Python library to process/parse object files (ELF, IEEE695, S19, iHex, Tektronix...)
you really like readelf, objdump, and objcopy, don't you?
to help you handle this daunting task. especially embedded systems developers are often in need to do strange things with object files...
- Write programs faster than you sreen-scrape readelf/objdump.
- Create and process ..., like Intel hex, Motorola srec, Texas Instruments Text (MSP430), and some historical (text) formats.
- Decent AAABI (Arm Architecture Application Binary Interface) support.
First of all, you need to import the library (of cause...)
>>> import objutils
Ok, let's start with the obligatory hello world:
>>> builder.addSection("Hello, world")
>>> builder.image
Section(address = 0X00000000, length = 12, data = 'Hello, world')
Let's have a look what we've just created:
>>> image = builder.image # Create a shortcut.
>>> image.hexdump()
Section #0000
-------------
00000000 48 65 6c 6c 6f 2c 20 77 6f 72 6c 64 21 |Hello, world! |
---------------
13 bytes
---------------
You may ask, what about addresses?
For a list of supported codecs run the following command: