COD4 Hacking

Hacking is an overstatement. Fiddling around with COD4. Anyways, here is a code snippet to get information (send the getinfo command) from a COD4 server:

import socket
hex = '\xFF\xFF\xFF\xFF\x67\x65\x74\x73\x74\x61\x74\x75\x73'
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
host = '176.9.142.200'
port = 29056
s.sendto(hex, (host, port))
d = s.recvfrom(1024)

To list the number of players and their names:

import re
print d[0].count('\"')/2 + " players"
list_l = re.findall('"([^"]*)"', d[0]);
print
for pl in list_l:
	print pl
Advertisements

3 thoughts on “COD4 Hacking

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s