-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrobtopCrypto.py
74 lines (59 loc) · 1.77 KB
/
robtopCrypto.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import saveUtil
import hashlib
import base64
from typing import Any, Dict, Tuple
import httpRequest
import levelUtil
def makeSeed(encoded: bytes) -> str:
"""
seed2 function for robtop games
"""
seed2: str = ""
if len(encoded) < 49:
seed2 = encoded.decode()
else:
seed2 = ""
slot = len(encoded) // 50
for i in range(0, 50):
seed2 += encoded.decode()[slot * i]
return saveUtil.Xor(
hashlib.sha1(
seed2.encode() +
b"xI25fpAapCQg").hexdigest(),
41274)
def getGJP(password: str) -> bytes:
"""
gets gjp from password
"""
return base64.urlsafe_b64encode(saveUtil.Xor(password, 37526).encode())
loginURL: str = "http://www.boomlings.com/database/accounts/loginGJAccount.php"
def loginUser(username: str, password: str) -> Tuple[int, int]:
"""
logins a user
returns [account id, player id]
"""
data: Dict[str, Any] = {
"userName": username,
"password": password,
"secret": "Wmfv3899gc9",
"udid": "s12-03912-0391-2039"
}
loginRequest: bytes = httpRequest.postRequest(loginURL, data)
if loginRequest == b"-1":
raise ValueError()
accID: int = int(loginRequest.split(b',')[0])
playerID: int = int(loginRequest.split(b',')[1])
return accID, playerID
userInfoURL: str = "http://www.boomlings.com/database/getGJUserInfo20.php"
def getUsername(accID: int) -> str:
"""
gets user from account id
"""
data: Dict[str, Any] = {
"targetAccountID": accID,
"secret": "Wmfd2893gb7",
"gameVersion": 21
}
userRequest: bytes = httpRequest.postRequest(userInfoURL, data)
userInfo = levelUtil.parseKeyVarArray(userRequest.decode(), ":")
return userInfo["1"]