Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import subprocess
- import re
- import time
- import ftplib
- RawCodesPath = []
- class Transforkey:
- def __init__(self):
- self.Array = [1,2,3]
- self.DoArray = [1,2,3]
- self.Main_Dictionary = []
- self.ForMice = 'Transformice.swf'
- self.ActionScript = 'source.as'
- self.UrlForMice = 'http://Transformice.com/Transformice.swf'
- self.StartTemplate = "b'var\s<q>\[public\]::\w+:<q>\[public\]flash\.utils::Timer'"
- self.EndTemplate = 'return'
- self.SplitTemplate = 'getlex <q>[public]'
- self.OneTwoOneTwoTpl = "callpropvoid <q>[public]::writeUTF, 1 params"
- self.VerKey = []
- self.MainFile = 0
- self.As3ToArray = []
- self.TempBool = False
- self.NewsLines = []
- self.Dic = []
- self.TempDir = []
- self.Version = []
- self.RawCodes = []
- self.File = None
- def SetUp(self, One, Two):
- print 'cat %s.bin >> %s.bin | cat %s.bin >> %s.bin'%(One, self.File, Two, self.File)
- subprocess.call('cat %s.bin >> %s.bin '%(One, self.File), shell=True)
- subprocess.call('cat %s.bin >> %s.bin'%(Two, self.File), shell=True)
- string = subprocess.call('swfdump ' + self.File + '.bin', shell=True)
- return int(string)
- def start(self):
- self.DoArray = [1,2,3]
- if os.path.exists(self.ForMice):os.remove(self.ForMice)
- self.Array = [1,2,3]
- for i in self.Array:
- if os.path.exists(str(i) + '.bin'):os.remove(str(i) + '.bin')
- print "Getting Flash..."
- subprocess.call('wget http://Transformice.com/Transformice.swf', shell=True)
- print "Done | Exporting..."
- subprocess.call('swfextract -b 1 Transformice.swf -o 1.bin | swfextract -b 2 Transformice.swf -o 2.bin | swfextract -b 3 Transformice.swf -o 3.bin', shell=True)
- for i in [1,2,3]:
- if open(str(i)+'.bin', 'rb').read(3) == "CWS":
- self.File = str(i)
- print self.File + '.bin'
- del self.Array[int(self.File)-1]
- break
- # def ReturnVar(self, list):
- # for i, j in enumerate(list):
- # if
- def Main(self):
- global RawCodesPath
- RawCodesPath = []
- self.start()
- if self.SetUp(self.Array[0], self.Array[1]) == 1:
- self.start()
- self.SetUp(self.Array[1], self.Array[0])
- subprocess.call('swfdump -a ' + self.File + '.bin>' + self.ActionScript, shell=True)
- openf = open(self.ActionScript, 'r')
- lines = []
- for i in openf.readlines():
- lines.append(i)
- for i, j in enumerate(lines):
- #if 'var <q>[public]::llIIIiIlOI:<q>[public]flash.utils::Timer' in lines[i]: print 'var <q>[public]::llIIIiIlOI:<q>[public]flash.utils::Timer'
- if re.search(b'var\s<q>\[public\]::\w+:<q>\[public\]flash\.utils::Timer', lines[i])!=None:
- if '[public]flash.events::Event' in lines[i+1]:
- NewLists = lines[i:]
- for i, j in enumerate(NewLists):
- if 'returnvoid' in NewLists[i]:
- NewLists = NewLists[:i]
- break
- for i in NewLists:
- if 'getlex <q>[public]' in i:
- self.Dic.append(self.TempDir)
- self.TempDir = []
- self.TempDir.append(i)
- OmgZomg = False
- Smind = []
- Key = 0
- for i, j in enumerate(NewLists):
- if 'getproperty <q>[private]NULL' in NewLists[i]:
- for m, k in enumerate(lines):
- if 'var <q>[private]NULL::' + NewLists[i].split('::')[1].replace('\n', '') + ':<q>[public]::int' in lines[m]:
- self.Version.append(lines[m].split(' = ')[1].replace('\n', ''))
- break
- break
- rawPacketCodes = []
- """linez = lines
- for (i, j) in enumerate(lines):
- if re.match(b'\s*sealed\sprotectedNS\(\[protected\]\w+\)\s*class\s*<q>\[public\]::\w+\s*extends\s*<q>\[public\]::\w+\{\s*', j):
- if re.match(b'.+constructor \* <q>\[public\]::\w+=\(<q>\[public\]::String\).+', lines[i+9]):
- for k in range(1, 20):
- if re.match(b'.+getproperty\s<q>\[public\]::.+\s+', lines[i+9+k])\
- and re.match(b'.+getproperty\s<q>\[public\]::.+\s+', lines[i+9+k+2]):
- #and re.match(b'.+callpropvoid\s<q>\[public\]::writeUTF.+', lines[i+9+k+2+4]):
- C = re.match(b'.+getproperty\s<q>\[public\]::(.+)\s+', lines[i+9+k]).groups()[0]
- CC = re.match(b'.+getproperty\s<q>\[public\]::(.+)\s+', lines[i+9+k+2]).groups()[0]
- # if CC == C:
- omnom = []
- #rawPacketCodes.append([C[:-1], CC[:-1]])
- C = 'var <q>[public]::' + C
- CC = 'var <q>[public]::' + CC
- #rawPacketCodes.append([C[:-1], CC[:-1]])
- for m, t in enumerate(linez):
- if C in linez[m]:
- omnom.append(linez[m].split(' = ')[1].replace('\n', ''))
- if CC in linez[m]:
- omnom.append(linez[m].split(' = ')[1].replace('\n', ''))
- RawCodesPath.append(str(' '.join(omnom)))
- for i, j in enumerate(lines):
- for m in rawPacketCodes:
- if 'var <q>[public]::' + m[0] in lines(i):
- for k in rawPacketCodes:
- if
- rawSourceData.append()
- print rawPacketCodes"""
- print RawCodesPath
- for String in self.Dic:
- OmgZomg = False
- Key = 0
- for Result in String:
- if 'rshift' in Result: OmgZomg = True
- if 'pushbyte' in Result:
- Key+=int(Result.split('pushbyte')[1].replace(' ', ''))
- if 'pushshort' in Result and int(Result.split('pushshort')[1].replace(' ', '')) not in [6125,800,600]:
- Key+=int(Result.split('pushshort')[1].replace(' ', ''))
- if Key!=0:
- if OmgZomg: Smind.append(chr(Key>>1))
- else:Smind.append(chr(Key))
- self.Version.append(str(str(''.join(Smind))))
- #Version
- return self.Version
- def RawCode(self):
- return self.RawCodes
- now_time = time.time()
- def UpTime():
- File = open('/var/www/html/data.txt', 'w')
- KeyVersion = str(time.time()) + ' ' + ' '.join(Transforkey().Main())
- print KeyVersion
- File.write(KeyVersion)
- File.close()
- #File = open('/var/www/html/pcodes.txt', 'w')
- print RawCodesPath
- #File.write(str(' | '.join( str(n) for n in RawCodesPath)))
- #File.close()
- def upload(ftp, file):
- ext = os.path.splitext(file)[1]
- if ext in (".txt", ".htm", ".html"):
- ftp.storlines("STOR " + file, open(file))
- else:
- ftp.storbinary("STOR " + file, open(file, "rb"), 1024)
- UpTime()
- while True:
- if time.time() - now_time > 120:
- UpTime()
- now_time = time.time()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement