MCPcopy
hub / github.com/Gallopsled/pwntools / _string

Function _string

pwnlib/commandline/shellcraft.py:23–31  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

21# |____/|_| |_|\___|_|_|\___|_| \__,_|_| \__|
22
23def _string(s):
24 out = []
25 for co in bytearray(s):
26 c = chr(co)
27 if co >= 0x20 and co <= 0x7e and c not in '/$\'"`&#x27;:
28 out.append(c)
29 else:
30 out.append('\\x%02x' % co)
31 return '"' + ''.join(out) + '"\n'
32
33
34p = common.parser_commands.add_parser(

Callers 1

mainFunction · 0.85

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected