patchkit is still stuck on python2, which is both obsolete and actively being pushed out of major distros like ubuntu. Better path forward is to use lief to update the binary the way i want.
ls = lief.parse("./ls")
section = Section(".injected.entry", lief.ELF.SECTION_TYPES.PROGBITS)
section += lief.ELF.SECTION_FLAGS.EXECINSTR
section += lief.ELF.SECTION_FLAGS.WRITE
section.content = [] # int array of bytes goes here
section = ls.add(section, loaded=True)
ls.header.entrypoint = section.virtual_address + STUB.header.entrypoint
ls.write(output)
patchkit is still stuck on python2, which is both obsolete and actively being pushed out of major distros like ubuntu. Better path forward is to use lief to update the binary the way i want.