Skip to content

Instantly share code, notes, and snippets.

@Lobbyra
Last active March 9, 2023 17:30
Show Gist options
  • Save Lobbyra/6e3d24f165594717b5c8742d1ca72311 to your computer and use it in GitHub Desktop.
Save Lobbyra/6e3d24f165594717b5c8742d1ca72311 to your computer and use it in GitHub Desktop.
42_to_\x4\x2.py
#!/usr/bin/python3
# DONE BY gemaroul & jecaudal
import sys
sys.stderr.write("becarefull to enter an odd hex\n")
arr = []
for i, v in enumerate(sys.argv[1]):
if i % 2:
arr.append(sys.argv[1][i - 1] + sys.argv[1][i])
arr.reverse()
res = '\\x'.join(arr)
res = '\\x' + res
print(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment