Created
November 29, 2016 14:57
-
-
Save calmh/283a598ba41edb49cea26249b8b2e2c8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import socket | |
hex = "" | |
for line in sys.stdin.readlines(): | |
first_space = line.index(' ') | |
if first_space > 2: | |
line = line[first_space:] | |
hex += line.replace(' ', '').strip() | |
data = hex.decode('hex') | |
host, port = sys.argv[1].split(':') | |
port = int(port) | |
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
sock.sendto(data, (host, port)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment