• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Gallopsled / pwntools / 1

16 Jun 2020 04:28AM UTC coverage: 0.0% (-69.4%) from 69.405%
1

push

github

heapcrash
Re-enable UI tests in Github Actions

I suspect this will not work because of curses failing to initialize in GHA

0 of 15570 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pwnlib/commandline/elfpatch.py
1
#!/usr/bin/env python2
2
from __future__ import absolute_import
×
3
from __future__ import division
×
4

5
import sys
×
6

7
import pwnlib
×
8
pwnlib.args.free_form = False
×
9

10
from pwn import *
×
11
from pwnlib.commandline import common
×
12

13
p = common.parser_commands.add_parser(
×
14
    'elfpatch',
15
    help = 'Patch an ELF file'
16
)
17

18
p.add_argument('elf',help="File to patch")
×
19
p.add_argument('offset',help="Offset to patch in virtual address (hex encoded)")
×
20
p.add_argument('bytes',help='Bytes to patch (hex encoded)')
×
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__)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc