i want to rewrite an already written script with another use for the application…
- User
i want to rewrite an already written script with another use for the application fruitcraft, this the code "import base64 import time import os from urllib.parse import unquote import json import requests import random import string os.system("cls")
var = 'load_code_here'
code=input('edata: ') code=unquote(code.replace("edata=",""))
bs64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" xor = [24, 22, 49, 41, 12, 19, 12, 52, 12, 54, 25, 33, 28, 38, 5, 58, 12, 19, 0, 53, 13, 22, 5, 46, 29, 6, 49, 37, 28, 35, 8, 56, 14, 6, 9, 33, 28, 54, 21, 36]
def getIndex(c) : if (ord(c) >= ord('A') and ord(c) <= ord('Z')) : return ord(c) - ord('A') elif (ord(c) >= ord('a') and ord(c) <= ord('z')) : return ord(c) - ord('a') + 26 elif (ord(c) >= ord('0') and ord(c) <= ord('9')) : return ord(c) - ord('0') + 52 elif (c == '+') : return 62 elif (c == '/') : return 63 else : return -1
def FruitCraftDecode(st): st = list(st) for i in range(0, len(st)) : if (st[i] == '=') : continue st[i] = bs64[getIndex(st[i]) ^ xor[i % 40]] st = str(base64.b64decode(''.join(st)))[2:-1] return st
def FruitCraftEncode(st): st = list(str(base64.b64encode(st.encode()))[2:-1]) for i in range(0, len(st)) : if (st[i] == '=') : continue st[i] = bs64[getIndex(st[i]) ^ xor[i % 40]] st = ''.join(st) return st
def send(url0, data, c): #time.sleep(1) url = "http://iran.fruitcraft.ir/"+url0 headers = { "Cookie": "FRUITPASSPORT="+c, "Host": "iran.fruitcraft.ir", "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", "User-Agent": "Dalvik/2.1.0 (Linux; U; Android 14; SM-B980N Build/TP1A.230124.014)" } data = { "edata":data }
response = requests.post(url, headers=headers, data=data, verify=False) return(response.text)def get_random_string(length): letters = string.ascii_lowercase result_str = ''.join(random.choice(letters) for i in range(length)) return(result_str) x = int(input("Count: ")) for x in range(x): load = var.replace("edata=","") cookie = get_random_string(32) result=json.loads(FruitCraftDecode(send("player/load", unquote(load), cookie))) print(result) resultofc = json.loads(FruitCraftDecode(send("live-battle/triggerability", (code), cookie))) print(resultofc) " here is another script to gather values and more reference about how these scripts should be "import base64 import time import os from urllib.parse import unquote import json import requests import random import string os.system("cls")
cardcode="Gk4dSENREVxSQE1YU1FGUD4NFR4BLVtcGlhUQlEZ"
bs64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" xor = [24, 22, 49, 41, 12, 19, 12, 52, 12, 54, 25, 33, 28, 38, 5, 58, 12, 19, 0, 53, 13, 22, 5, 46, 29, 6, 49, 37, 28, 35, 8, 56, 14, 6, 9, 33, 28, 54, 21, 36]
def getIndex(c) : if (ord(c) >= ord('A') and ord(c) <= ord('Z')) : return ord(c) - ord('A') elif (ord(c) >= ord('a') and ord(c) <= ord('z')) : return ord(c) - ord('a') + 26 elif (ord(c) >= ord('0') and ord(c) <= ord('9')) : return ord(c) - ord('0') + 52 elif (c == '+') : return 62 elif (c == '/') : return 63 else : return -1
- Assistant
- User
write a python script to ask for fruitpassport and use it as cookie for the host "iran.fruitcraft.ir" then i want it to send request load based on this raw info "POST /cards/collectgold HTTP/1.1 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Cookie: FRUITPASSPORT=12dd815964cacb46461c507d4f8a05d0; Content-Length: 34 User-Agent: Dalvik/2.1.0 (Linux; U; Android 7.1.2; SM-A908N Build/PPR1.180610.011) Host: iran.fruitcraft.ir Connection: Keep-Alive Accept-Encoding: gzip
edata=Gk4KXVpRXRJDSEMTfmMXSA%3D%3D" and the response should be base on this raw info "HTTP/1.1 200 OK server: nginx/1.18.0 date: Tue, 16 Jan 2024 10:11:55 GMT content-type: text/html; charset=UTF-8 transfer-encoding: chunked x-powered-by: PHP/7.1.33 Expires: Thu, 19 Nov 1981 08:52:00 GMT cache-control: no-store, no-cache, must-revalidate pragma: no-cache
134 Gk4aRVJARhVDSBUIRFUZFwUPAA1HSEkaWw0NHwAHFQkNblRbXwJDSFRKAQAFBU1MBAAEC1dKZwUOHwFGW15QAgIDBlNNUAYVXVRqVg4CGAkGBltXVj0AHwkLFgkNEwlAQRMEXkMdXlxRagIBGAAAEUZRVww+EgkIDhsMVWxVR0RbQ1ZKBAQGBlBYQkBHFV1UXD0CHAkIBA8dWFxabAMZBhMbUkRcWg9MTlpUXhBUWREVLAILDQg2UlxYXwMCBj4bRRIPBFZeQV9cSwsJDU5DHQABBR82UlJERwUJE0NAV1FZRgQTCQ== 0 "
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.