MCPcopy
hub / github.com/Gallopsled/pwntools / main

Function main

pwnlib/commandline/elfpatch.py:23–34  ·  view source on GitHub ↗
(a)

Source from the content-addressed store, hash-verified

21
22
23def 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
36if __name__ == '__main__':
37 pwnlib.commandline.common.main(__file__, main)

Callers

nothing calls this directly

Calls 5

writeMethod · 0.95
get_dataMethod · 0.95
unhexFunction · 0.85
ELFClass · 0.85
writeMethod · 0.45

Tested by

no test coverage detected