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

Gallopsled / pwntools / 8912ca5a8c3a9725c3ba6d30561607150a6faebe-PR-2205

pending completion
8912ca5a8c3a9725c3ba6d30561607150a6faebe-PR-2205

Pull #2205

github-actions

web-flow
Merge 81f463e2c into 8b4cacf8b
Pull Request #2205: Fix stable Python 2 installation from a built wheel

3878 of 6371 branches covered (60.87%)

12199 of 16604 relevant lines covered (73.47%)

0.73 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