Skip to content

Instantly share code, notes, and snippets.

@erkie
Last active February 28, 2018 14:43
Show Gist options
  • Save erkie/75aed185290ddb3967930abd0b1fc216 to your computer and use it in GitHub Desktop.
Save erkie/75aed185290ddb3967930abd0b1fc216 to your computer and use it in GitHub Desktop.
Always accept any client trying to connect to an idtech3 server

Be sure to add this to your /etc/hosts file:

127.0.0.1 codauthorize.activision.com
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server_address = '127.0.0.1'
server_port = 20500
server = (server_address, server_port)
sock.bind(server)
print("Listening on udp://" + server_address + ":" + str(server_port))
HEADER = "\xff\xff\xff\xff"
while True:
payload, client_address = sock.recvfrom(512)
# Strip first 4 empty bytes
cmd = payload[4:]
print("Received command from server:")
print(cmd)
pieces = cmd.split(" ")
if pieces[0] == "getIpAuthorize":
challenge = pieces[1]
print("getIpAuthorize: challenge is: " + challenge)
responsePacket = HEADER + "ipAuthorize " + challenge + " accept"
print(responsePacket)
sock.sendto(responsePacket, client_address)
else:
print("Command is unknown... Sending gibberish")
sock.sendto(HEADER + "unknown", client_address)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment