(a)
| 21 | |
| 22 | |
| 23 | def main(a): |
| 24 | if not a.offset.startswith('0x'): |
| 25 | a.offset = '0x' + a.offset |
| 26 | |
| 27 | offset = int(a.offset, 16) |
| 28 | bytes = unhex(a.bytes) |
| 29 | |
| 30 | with context.silent: |
| 31 | elf = ELF(a.elf) |
| 32 | |
| 33 | elf.write(offset, bytes) |
| 34 | getattr(sys.stdout, 'buffer', sys.stdout).write(elf.get_data()) |
| 35 | |
| 36 | if __name__ == '__main__': |
| 37 | pwnlib.commandline.common.main(__file__, main) |