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

Gallopsled / pwntools / 8d7613a419f51385e765cb9998da65eb488faa2e

pending completion
8d7613a419f51385e765cb9998da65eb488faa2e

push

github-actions

web-flow
Merge branch 'dev' into process-env-add-2

3905 of 6422 branches covered (60.81%)

1649 of 1649 new or added lines in 79 files covered. (100.0%)

12255 of 16708 relevant lines covered (73.35%)

0.73 hits per line

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

76.0
/pwnlib/commandline/unhex.py
1
#!/usr/bin/env python2
2
from __future__ import absolute_import
1✔
3
from __future__ import division
1✔
4

5
import argparse
1✔
6
import sys
1✔
7
from string import whitespace
1✔
8

9
from pwnlib.commandline import common
1✔
10
from pwnlib.util.fiddling import unhex
1✔
11

12
parser = common.parser_commands.add_parser(
1✔
13
    'unhex',
14
    help = 'Decodes hex-encoded data provided on the command line or via stdin.',
15
    description = 'Decodes hex-encoded data provided on the command line or via stdin.'
16
)
17

18
parser.add_argument('hex', nargs='*',
1✔
19
    help='Hex bytes to decode')
20

21
def main(args):
1✔
22
    try:
1✔
23
        o = getattr(sys.stdout, 'buffer', sys.stdout)
1✔
24
        if not args.hex:
1!
25
            s = getattr(sys.stdin, 'buffer', sys.stdin).read().translate(None, whitespace.encode('ascii'))
×
26
            o.write(unhex(s))
×
27
        else:
28
            o.write(unhex(''.join(args.hex)))
1✔
29
    except TypeError as e:
×
30
        sys.stderr.write(str(e) + '\n')
×
31
        raise
×
32

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

© 2025 Coveralls, Inc