Dunno if it exists already, but meh, it was fun to make :)
fell free to use in your 1337-uber-bots, if you dont already have such functionality.
Python
fell free to use in your 1337-uber-bots, if you dont already have such functionality.
PHP Code:
import zlib, sys, urllib
# Settings
SERVER = "int1"
NUMCODENZ = 100
# Get the latest swf
webFile = urllib.urlopen("http://" + SERVER + ".darkorbit.bigpoint.com/spacemap/main.swf")
content = webFile.read()
webFile.close()
# madcheckz
if content[1:3] != "WS":
print "not a flash file!"
sys.exit(1)
# dump compressed file (debugging purposes)
dmp2 = open(SERVER + ".swf", 'wb')
dmp2.write(content)
dmp2.close()
# uncompress if nedded
if content[0:3] == "CWS":
print "This is a compressed swf!"
content = content[0:8] + zlib.decompress(content[8:])
content = 'F' + content[1:] # mark it as uncompressed
# dump uncompressed file (debugging purposes)
dmp = open(SERVER + "_uncompressed.swf", 'wb')
dmp.write(content)
dmp.close()
# extract codez
for i in range(len(content)):
if content[i] == '\x05':
ii = i
goon = True
spree = 0
while ii < len(content) and goon:
ii += 6
if content[ii] == '\x05':
spree += 1
else:
goon = False
if spree == NUMCODENZ - 1:
codez = content[i+1:ii].split('\x05')
# save codez to file
out = open(SERVER + ".txt", 'w')
for code in codez:
out.write(code + '\n')
out.close()