19 lines
390 B
Text
19 lines
390 B
Text
|
#!/usr/bin/env python3
|
||
|
|
||
|
import argparse
|
||
|
|
||
|
def _hexip(s: str):
|
||
|
ip = []
|
||
|
for i in range(0, len(args.hex), 2):
|
||
|
octet = int(args.hex[i:i+2], 16)
|
||
|
ip.append(str(octet))
|
||
|
return ".".join(ip)
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
parser = argparse.ArgumentParser("webchat IP dehexlify")
|
||
|
parser.add_argument("hex")
|
||
|
args = parser.parse_args()
|
||
|
|
||
|
print(_hexip(args.hex))
|
||
|
|