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

Gallopsled / pwntools / 1

20 Aug 2023 06:49PM UTC coverage: 1.309% (-70.3%) from 71.623%
1

push

github

web-flow
plt: remove stale MIPS workaround (#2256)

Fixes #2042

2 of 5878 branches covered (0.03%)

221 of 16886 relevant lines covered (1.31%)

0.03 hits per line

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

0.0
/pwnlib/commandline/hex.py
1
#!/usr/bin/env python2
2
from __future__ import absolute_import
×
3
from __future__ import division
×
4

5
import argparse
×
6
import sys
×
7

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

11
parser = common.parser_commands.add_parser(
×
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='*',
×
17
    help='Data to convert into hex')
18

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

28
if __name__ == '__main__':
×
29
    common.main(__file__)
×
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