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

Gallopsled / pwntools / 22222945663

20 Feb 2026 11:49AM UTC coverage: 73.592% (-0.3%) from 73.914%
22222945663

push

github

web-flow
Fix typo causing doctests not getting skipped (#2681)

Downloading all those libcs slowed down the CI a lot.

3861 of 6510 branches covered (59.31%)

13318 of 18097 relevant lines covered (73.59%)

0.74 hits per line

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

41.03
/pwnlib/commandline/elfdiff.py
1
import shutil
1✔
2
from argparse import ArgumentParser
1✔
3
from subprocess import CalledProcessError
1✔
4
from subprocess import check_output
1✔
5
from tempfile import NamedTemporaryFile
1✔
6

7
import pwnlib.args
1✔
8
pwnlib.args.free_form = False
1✔
9

10
from pwn import *
1✔
11
from pwnlib.commandline import common
1✔
12

13

14
def dump(objdump, path):
1✔
15
    n = NamedTemporaryFile(delete=False)
×
16
    o = check_output([objdump,'-d','-x','-s',path])
×
17
    n.write(o)
×
18
    n.flush()
×
19
    return n.name
×
20

21
def diff(a,b):
1✔
22
    try: return check_output(['diff',a,b], universal_newlines=True)
×
23
    except CalledProcessError as e:
×
24
        return e.output
×
25

26
p = common.parser_commands.add_parser(
1✔
27
    'elfdiff',
28
    help = 'Compare two ELF files',
29
    description = 'Compare two ELF files'
30
)
31

32
p.add_argument('a')
1✔
33
p.add_argument('b')
1✔
34

35
def main(a):
1✔
36
    with context.silent:
×
37
        x = ELF(a.a)
×
38
        y = ELF(a.b)
×
39

40
    if x.arch != y.arch:
×
41
        log.error("Architectures are not the same: %s vs %s" % (x.arch, y.arch))
×
42

43
    context.arch = x.arch
×
44

45
    objdump = pwnlib.asm.which_binutils('objdump')
×
46

47
    tmp = NamedTemporaryFile()
×
48
    name = tmp.name
×
49

50
    shutil.copy(x.path, name)
×
51
    x = dump(objdump, name)
×
52

53
    shutil.copy(y.path, name)
×
54
    y = dump(objdump, name)
×
55

56
    print(diff(x, y))
×
57

58
if __name__ == '__main__':
1!
59
    pwnlib.commandline.common.main(__file__, main)
×
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