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

Gallopsled / pwntools / a9bfe94a5c5087bad5a1d28eddc3071dea90ca3d

pending completion
a9bfe94a5c5087bad5a1d28eddc3071dea90ca3d

push

github-actions

GitHub
Merge branch 'dev' into rop_raw_list

3886 of 6368 branches covered (61.02%)

102 of 102 new or added lines in 15 files covered. (100.0%)

12212 of 16604 relevant lines covered (73.55%)

0.74 hits per line

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

91.3
/pwnlib/commandline/hex.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

8
from pwnlib.commandline import common
1✔
9
from pwnlib.util.fiddling import enhex
1✔
10

11
parser = common.parser_commands.add_parser(
1✔
12
    'hex',
13
    help = 'Hex-encodes data provided on the command line or stdin',
14
    description = 'Hex-encodes data provided on the command line or stdin')
15

16
parser.add_argument('data', nargs='*',
1✔
17
    help='Data to convert into hex')
18

19
def main(args):
1✔
20
    if not args.data:
1✔
21
        print(enhex(getattr(sys.stdin, 'buffer', sys.stdin).read()))
1✔
22
    else:
23
        data = ' '.join(args.data)
1✔
24
        if not hasattr(data, 'decode'):
1!
25
            data = data.encode('utf-8', 'surrogateescape')
×
26
        print(enhex(data))
1✔
27

28
if __name__ == '__main__':
1✔
29
    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