Hexfile manipulation

Module to work with intel hex files.

This module can be used to work with intel hexfiles.

class ppci.utils.hexfile.HexFile

Represents an intel hexfile

add_region(address, data)

Add a chunk of data at the given address

static load(open_file)

Load a hexfile from file

save(f)

Save hexfile to file-like object

write_hex_line(address, typ, data=b'')

Write a single hexfile line

>>> from ppci.utils.hexfile import HexFile
>>> h = HexFile()
>>> h.dump()
Hexfile containing 0 bytes
>>> h.add_region(0, bytes([1,2,3]))
>>> h
Hexfile containing 3 bytes