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

Gallopsled / pwntools / 1

30 Apr 2023 07:01PM UTC coverage: 1.303% (-70.2%) from 71.475%
1

push

github

web-flow
Fmtstr no dollar payload (#2185)

* added feature to the fmtstr module, now able to generate payload without the dollar syntax.

* made some improvements in the no_dollar feature implemented

* reduced different lines

* removed some blank lines and debug stuff

* (fix) missing check for no_dollar option

* (fix) updatet argument type for documentation

* updated CHANGELOG.md

* (fix) typo in the CHANGELOG.md version

* Update pwnlib/fmtstr.py

suggested change, dont need comparison in calling the make_payload_dollar

Co-authored-by: Arusekk <arek_koz@o2.pl>

* Update pwnlib/fmtstr.py

suggestion; better use a non null byte thing to fill the values used by the %c to pad before writing.

Co-authored-by: Arusekk <arek_koz@o2.pl>

* (fix) minor fixes, typos on comments

* update pwnlib/fmtstr.py : suggestion from Arusekk, made improvements to save some bytes in the generation of the payload

* added tests to fmtstr_payload with no dollar flag

* update CHANGELOG.md with correct version

---------

Co-authored-by: Arusekk <arek_koz@o2.pl>

2 of 5912 branches covered (0.03%)

0 of 14 new or added lines in 1 file covered. (0.0%)

11893 existing lines in 140 files now uncovered.

221 of 16955 relevant lines covered (1.3%)

0.01 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
UNCOV
2
from __future__ import absolute_import
×
UNCOV
3
from __future__ import division
×
4

UNCOV
5
import sys
×
6

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

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

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

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

23

UNCOV
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

UNCOV
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

© 2026 Coveralls, Inc