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

Gallopsled / pwntools / d90cfd8b50382b28e65f3168f73034210260c9ed

pending completion
d90cfd8b50382b28e65f3168f73034210260c9ed

push

github-actions

Arusekk
Merge branch 'stable' into beta

3767 of 6278 branches covered (60.0%)

1 of 1 new or added line in 1 file covered. (100.0%)

12249 of 16696 relevant lines covered (73.36%)

1.47 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
2✔
3
from __future__ import division
2✔
4

5
import argparse
2✔
6
import sys
2✔
7

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

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

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

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