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

Gallopsled / pwntools / 12901998513

22 Jan 2025 05:41AM UTC coverage: 73.544% (-0.1%) from 73.648%
12901998513

Pull #2530

github

web-flow
Merge 4d9455e0b into cff58e153
Pull Request #2530: checksec: more forgiving when passed directory arguments

3789 of 6404 branches covered (59.17%)

2 of 3 new or added lines in 1 file covered. (66.67%)

19 existing lines in 5 files now uncovered.

13299 of 18083 relevant lines covered (73.54%)

0.74 hits per line

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

81.82
/pwnlib/commandline/checksec.py
1
from __future__ import absolute_import
1✔
2
from __future__ import division
1✔
3

4
import argparse
1✔
5
import sys
1✔
6

7
from pwn import *
1✔
8
from pwnlib.commandline import common
1✔
9

10
parser = common.parser_commands.add_parser(
1✔
11
    'checksec',
12
    help = 'Check binary security settings',
13
    description = 'Check binary security settings',
14
)
15
parser.add_argument(
1✔
16
    'elf',
17
    nargs='*',
18
    help='Files to check'
19
)
20
parser.add_argument(
1✔
21
    '--file',
22
    nargs='*',
23
    dest='elf2',
24
    metavar='elf',
25
    help='File to check (for compatibility with checksec.sh)'
26
)
27

28
def main(args):
1✔
29
    files = args.elf or args.elf2 or []
1✔
30
    files = [open(f, 'rb') for f in filter(os.path.isfile, files)]
1✔
31

32
    if not files:
1!
33
        parser.print_usage()
×
34
        return
×
35

36
    for f in files:
1✔
37
        try:
1✔
38
            e = ELF(f.name)
1✔
NEW
39
        except Exception as e:
×
40
            print("{name}: {error}".format(name=f.name, error=e))
×
41

42
if __name__ == '__main__':
1✔
43
    common.main(__file__, main)
1✔
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