def makeEhBase(self): eh = [] eh += [0x7F, 0x45, 0x4C, 0x46, 0x02, 0x01, 0x01] # magic eh += [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] eh += convLE(2, 2) # e_type (EXEC) eh += convLE(0x3E, 2) # e_machine (amd64) eh += convLE(1, 4) # e_version (1) eh += convLE(0, 8) # e_entry (set later) eh += convLE(0, 8) # e_phoff (set later) eh += convLE(0, 8) # e_shoff (set later) eh += convLE(0, 4) # e_flags eh += convLE(64, 2) # e_ehsize (64) eh += convLE(56, 2) # e_phentsize (56) eh += convLE(0, 2) # e_phnum (set later) eh += convLE(64, 2) # e_shentsize (64) eh += convLE(0, 2) # e_shnum (set later) eh += convLE(0, 2) # e_shstrndx (set later) e = ElfHeader() e.retrieve(eh) return e
def makeEhBase(self): eh = [] eh += [0x7f, 0x45, 0x4c, 0x46, 0x02, 0x01, 0x01] # magic eh += [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] eh += convLE(2, 2) # e_type (EXEC) eh += convLE(0x3e, 2) # e_machine (amd64) eh += convLE(1, 4) # e_version (1) eh += convLE(0, 8) # e_entry (set later) eh += convLE(0, 8) # e_phoff (set later) eh += convLE(0, 8) # e_shoff (set later) eh += convLE(0, 4) # e_flags eh += convLE(64, 2) # e_ehsize (64) eh += convLE(56, 2) # e_phentsize (56) eh += convLE(0, 2) # e_phnum (set later) eh += convLE(64, 2) # e_shentsize (64) eh += convLE(0, 2) # e_shnum (set later) eh += convLE(0, 2) # e_shstrndx (set later) e = ElfHeader() e.retrieve(eh) return e
import sys