|
| 1 | +import hashlib |
| 2 | +import re |
| 3 | +import PySimpleGUI as sg |
| 4 | +import requests |
| 5 | +from requests.structures import CaseInsensitiveDict |
| 6 | + |
| 7 | +sg.theme("DarkBlue2") |
| 8 | + |
| 9 | +layout = [ |
| 10 | + [sg.T("Gamee Cheat", font=("Helvetica", 20), text_color='white')], |
| 11 | + [sg.Text("Game link:", text_color='white', size=(10, 1)), sg.InputText(key="-IN1-", size=(30, 1)), sg.Button("Submit", button_color=('white', '#21506B'), border_width=3)], |
| 12 | + [sg.Text("Score:", text_color='white', size=(10, 1)), sg.InputText(key="-IN2-", size=(10, 1)), sg.Text("Time:", text_color='white', size=(10, 1)), sg.InputText(key="-IN3-", size=(10, 1))], |
| 13 | + [sg.Output(size=(50, 10), key='-OUTPUT-', text_color='white')], |
| 14 | + [sg.Button("Contact Telegram", button_color=('white', '#008CBA'), border_width=3, key='-TELEGRAM-')], |
| 15 | + [sg.T("Coded by Coded_Pro.", text_color='white', font='Courier 8')] |
| 16 | +] |
| 17 | + |
| 18 | +window = sg.Window('Coded Cheats', layout, icon='backup_icon-icons.com_72047.ico', resizable=True, finalize=True) |
| 19 | + |
| 20 | +def open_telegram(): |
| 21 | + import webbrowser |
| 22 | + webbrowser.open('https://t.me/coded_pro') |
| 23 | + |
| 24 | +def get_checksum(score, playTime, url): |
| 25 | + gameStateData = "" |
| 26 | + str2hash = f"{score}:{playTime}:{url}:{gameStateData}:crmjbjm3lczhlgnek9uaxz2l9svlfjw14npauhen" |
| 27 | + result = hashlib.md5(str2hash.encode()) |
| 28 | + checksum = result.hexdigest() |
| 29 | + return checksum |
| 30 | + |
| 31 | +def get_token(Gameurl): |
| 32 | + url = "http://api.service.gameeapp.com" |
| 33 | + headers = CaseInsensitiveDict() |
| 34 | + headers["Host"] = "api.service.gameeapp.com" |
| 35 | + headers["Connection"] = "keep-alive" |
| 36 | + headers["Content-Length"] = "224" |
| 37 | + headers["client-language"] = "en" |
| 38 | + headers["x-install-uuid"] = "0c1cd354-302a-4e76-9745-6d2d3dcf2c56" |
| 39 | + headers["sec-ch-ua-mobile"] = "?0" |
| 40 | + headers["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36" |
| 41 | + headers["sec-ch-ua-platform"] = "Windows" |
| 42 | + headers["Content-Type"] = "application/json" |
| 43 | + headers["Accept"] = "*/*" |
| 44 | + headers["Origin"] = "https://prizes.gamee.com" |
| 45 | + headers["Sec-Fetch-Site"] = "cross-site" |
| 46 | + headers["Sec-Fetch-Mode"] = "cors" |
| 47 | + headers["Sec-Fetch-Dest"] = "empty" |
| 48 | + headers["Referer"] = "https://prizes.gamee.com/" |
| 49 | + headers["Accept-Encoding"] = "gzip, deflate, br" |
| 50 | + headers["Accept-Language"] = "en-US,en;q=0.9" |
| 51 | + data = '{"jsonrpc":"2.0","id":"user.authentication.botLogin","method":"user.authentication.botLogin","params":{"botName":"telegram","botGameUrl":"' + Gameurl + '","botUserIdentifier":null}}' |
| 52 | + try: |
| 53 | + resp = requests.post(url, headers=headers, data=data) |
| 54 | + except: |
| 55 | + return False |
| 56 | + |
| 57 | + print(resp.status_code) |
| 58 | + if resp.status_code == 200: |
| 59 | + result_data = resp.json() |
| 60 | + token = result_data['result']['tokens']['authenticate'] |
| 61 | + return token |
| 62 | + else: |
| 63 | + return False |
| 64 | + |
| 65 | +def game_id(game_url): |
| 66 | + url = "https://api.service.gameeapp.com/" |
| 67 | + headers = CaseInsensitiveDict() |
| 68 | + headers["accept"] = "*/*" |
| 69 | + headers["accept-encoding"] = "gzip, deflate, br" |
| 70 | + headers["accept-language"] = "en-US,en;q=0.9" |
| 71 | + headers["cache-control"] = "no-cache" |
| 72 | + headers["client-language"] = "en" |
| 73 | + headers["content-length"] = "173" |
| 74 | + headers["Content-Type"] = "application/json" |
| 75 | + headers["origin"] = "https://prizes.gamee.com" |
| 76 | + headers["pragma"] = "no-cache" |
| 77 | + headers["referer"] = "https://prizes.gamee.com/" |
| 78 | + headers["sec-ch-ua-mobile"] = "?0" |
| 79 | + headers["sec-ch-ua-platform"] = "Windows" |
| 80 | + headers["sec-fetch-dest"] = "empty" |
| 81 | + headers["sec-fetch-mode"] = "cors" |
| 82 | + headers["sec-fetch-site"] = "cross-site" |
| 83 | + headers["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36" |
| 84 | + data = '{"jsonrpc":"2.0","id":"game.getWebGameplayDetails","method":"game.getWebGameplayDetails","params":{"gameUrl":"' + game_url + '"}}' |
| 85 | + |
| 86 | + try: |
| 87 | + resp = requests.post(url, headers=headers, data=data) |
| 88 | + except: |
| 89 | + return False |
| 90 | + if resp.status_code == 200: |
| 91 | + result_data = resp.json() |
| 92 | + return result_data['result']['game']['id'] |
| 93 | + else: |
| 94 | + return False |
| 95 | + |
| 96 | +def send_score(score, timePlay, checksum, token, game_url, game_id): |
| 97 | + url = "http://api.service.gameeapp.com" |
| 98 | + |
| 99 | + headers = CaseInsensitiveDict() |
| 100 | + headers["Host"] = "api.service.gameeapp.com" |
| 101 | + headers["User-Agent"] = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Brave Chrome/89.0.4389.90 Safari/537.36" |
| 102 | + headers["Accept"] = "*/*" |
| 103 | + headers["Accept-Language"] = "en-US,en;q=0.5" |
| 104 | + headers["Accept-Encoding"] = "gzip, deflate" |
| 105 | + headers["X-Install-Uuid"] = "91516df9-f651-40ef-9c11-ccd357429228" |
| 106 | + headers["Client-Language"] = "en" |
| 107 | + headers["Content-Type"] = "application.json" |
| 108 | + headers["Origin"] = "https://prizes.gamee.com" |
| 109 | + headers["Referer"] = "https://prizes.gamee.com/" |
| 110 | + headers["Sec-Fetch-Dest"] = "empty" |
| 111 | + headers["Sec-Fetch-Mode"] = "cors" |
| 112 | + headers["Sec-Fetch-Site"] = "cross-site" |
| 113 | + headers["Te"] = "trailers" |
| 114 | + headers["Authorization"] = "Bearer {my_token}".format(my_token=token) |
| 115 | + data = '{"jsonrpc":"2.0","id":"game.saveWebGameplay","method":"game.saveWebGameplay","params":{"gameplayData":{"gameId":' + str( |
| 116 | + game_id) + ',"score":' + str(score) + ',"playTime":' + str(timePlay) + ',"gameUrl":"' + game_url + '","metadata":{"gameplayId":30},"releaseNumber":8,"gameStateData":null,"createdTime":"2021-12-28T03:20:24+03:30","checksum":"' + checksum + '","replayVariant":null,"replayData":null,"replayDataChecksum":null,"isSaveState":false,"gameplayOrigin":"game"}}}' |
| 117 | + |
| 118 | + try: |
| 119 | + resp = requests.post(url, headers=headers, data=data) |
| 120 | + except: |
| 121 | + return False |
| 122 | + |
| 123 | + if resp.status_code == 200: |
| 124 | + result_text = "" |
| 125 | + status = 0 |
| 126 | + my_json = resp.json() |
| 127 | + keys_list = list(my_json) |
| 128 | + for i in keys_list: |
| 129 | + if i == "error": |
| 130 | + result_text = my_json['error']['message'] + "\n" + my_json['error']['data']['reason'] + "\n" + "try after " + my_json['user']['cheater']['banStatus'] |
| 131 | + status = 1 |
| 132 | + break |
| 133 | + |
| 134 | + if status == 0: |
| 135 | + user_posin_rank = my_json['result']['surroundingRankings'][0]['ranking'] |
| 136 | + for user in user_posin_rank: |
| 137 | + result_text = str(user['rank']) + " - " + user['user']['firstname'] + " " + user['user'][ |
| 138 | + 'lastname'] + " score : " + str(user['score']) + "\n" + result_text |
| 139 | + return result_text |
| 140 | + else: |
| 141 | + return False |
| 142 | + |
| 143 | +def game_link(url): |
| 144 | + pattern = r"https:\/\/prizes\.gamee\.com(\/game-bot\/.*)#tg" |
| 145 | + result = re.match(pattern, url) |
| 146 | + if result: |
| 147 | + link = result.groups(0)[0] |
| 148 | + return link |
| 149 | + else: |
| 150 | + return False |
| 151 | + |
| 152 | +def check_is_digit(num): |
| 153 | + if num.strip().isdigit(): |
| 154 | + return True |
| 155 | + else: |
| 156 | + return False |
| 157 | + |
| 158 | +while True: |
| 159 | + event, values = window.read() |
| 160 | + |
| 161 | + if event == sg.WIN_CLOSED or event == "Exit" or event == "Cancel": |
| 162 | + window.close() |
| 163 | + break |
| 164 | + elif event == "Submit": |
| 165 | + window['-OUTPUT-'].update(value="") |
| 166 | + score = values['-IN2-'] |
| 167 | + time = values['-IN3-'] |
| 168 | + |
| 169 | + if values['-IN1-'] == '' or score == '' or time == '': |
| 170 | + result = "Fill empty fields!" |
| 171 | + else: |
| 172 | + if not check_is_digit(score) or not check_is_digit(time): |
| 173 | + result = "Score and time fields should be numbers!" |
| 174 | + else: |
| 175 | + game_url = game_link(values['-IN1-']) |
| 176 | + if game_url == False: |
| 177 | + result = "Something went wrong!" + "\n" + "Not a valid link" |
| 178 | + else: |
| 179 | + token = get_token(game_url) |
| 180 | + checksum = get_checksum(score, time, game_url) |
| 181 | + Game_number = game_id(game_url) |
| 182 | + result = send_score(score, time, checksum, token, game_url, Game_number) |
| 183 | + if result == False: |
| 184 | + result = "Something went wrong!" + "\n" + "Check your internet" |
| 185 | + window['-OUTPUT-'].update(result) |
| 186 | + elif event == "-TELEGRAM-": |
| 187 | + open_telegram() |
0 commit comments