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

Gallopsled / pwntools / 1

11 Jul 2023 10:24PM UTC coverage: 19.327% (-52.2%) from 71.479%
1

push

github

web-flow
shellcraft: more explicit sleep.asm docstring (#2226)

This commit adds information that the sleep shellcraft function does not check if it returned as part of an interrupt and it does not retry the syscall if this occured.

189 of 5940 branches covered (3.18%)

3286 of 17002 relevant lines covered (19.33%)

0.39 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.args
×
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
    description = 'Patch an ELF file'
17
)
18

19
p.add_argument('elf',help="File to patch")
×
20
p.add_argument('offset',help="Offset to patch in virtual address (hex encoded)")
×
21
p.add_argument('bytes',help='Bytes to patch (hex encoded)')
×
22

23

24
def main(a):
×
25
    if not a.offset.startswith('0x'):
×
26
        a.offset = '0x' + a.offset
×
27

28
    offset = int(a.offset, 16)
×
29
    bytes  = unhex(a.bytes)
×
30

31
    with context.silent:
×
32
        elf    = ELF(a.elf)
×
33

34
    elf.write(offset, bytes)
×
35
    getattr(sys.stdout, 'buffer', sys.stdout).write(elf.get_data())
×
36

37
if __name__ == '__main__':
×
38
    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