local base64 = {} local extract = _G.bit32 and _G.bit32.extract if not extract then if _G.bit then local shl, shr, band = _G.bit.lshift, _G.bit.rshift, _G.bit.band extract = function( v, from, width ) return band( shr( v, from ), shl( 1, width ) - 1 ) end elseif _G._VERSION == "Lua 5.1" then extract = function( v, from, width ) local w = 0 local flag = 2^from for i = 0, width-1 do local flag2 = flag + flag if v % flag2 >= flag then w = w + 2^i end flag = flag2 end return w end else extract = load[[return function( v, from, width ) return ( v >> from ) & ((1 << width) - 1) end]]() end end function base64.makeencoder( s62, s63, spad ) local encoder = {} for b64code, char in pairs{[0]='A','B','C','D','E','F','G','H','I','J', 'K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y', 'Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n', 'o','p','q','r','s','t','u','v','w','x','y','z','0','1','2', '3','4','5','6','7','8','9',s62 or '+',s63 or'/',spad or'='} do encoder[b64code] = char:byte() end return encoder end function base64.makedecoder( s62, s63, spad ) local decoder = {} for b64code, charcode in pairs( base64.makeencoder( s62, s63, spad )) do decoder[charcode] = b64code end return decoder end local DEFAULT_ENCODER = base64.makeencoder() local DEFAULT_DECODER = base64.makedecoder() local char, concat = string.char, table.concat function base64.encode( str, encoder, usecaching ) encoder = encoder or DEFAULT_ENCODER local t, k, n = {}, 1, #str local lastn = n % 3 local cache = {} for i = 1, n-lastn, 3 do local a, b, c = str:byte( i, i+2 ) local v = a*0x10000 + b*0x100 + c local s if usecaching then s = cache[v] if not s then s = char(encoder[extract(v,18,6)], encoder[extract(v,12,6)], encoder[extract(v,6,6)], encoder[extract(v,0,6)]) cache[v] = s end else s = char(encoder[extract(v,18,6)], encoder[extract(v,12,6)], encoder[extract(v,6,6)], encoder[extract(v,0,6)]) end t[k] = s k = k + 1 end if lastn == 2 then local a, b = str:byte( n-1, n ) local v = a*0x10000 + b*0x100 t[k] = char(encoder[extract(v,18,6)], encoder[extract(v,12,6)], encoder[extract(v,6,6)], encoder[64]) elseif lastn == 1 then local v = str:byte( n )*0x10000 t[k] = char(encoder[extract(v,18,6)], encoder[extract(v,12,6)], encoder[64], encoder[64]) end return concat( t ) end function base64.decode( b64, decoder, usecaching ) decoder = decoder or DEFAULT_DECODER local pattern = '[^%w%+%/%=]' if decoder then local s62, s63 for charcode, b64code in pairs( decoder ) do if b64code == 62 then s62 = charcode elseif b64code == 63 then s63 = charcode end end pattern = ('[^%%w%%%s%%%s%%=]'):format( char(s62), char(s63) ) end b64 = b64:gsub( pattern, '' ) local cache = usecaching and {} local t, k = {}, 1 local n = #b64 local padding = b64:sub(-2) == '==' and 2 or b64:sub(-1) == '=' and 1 or 0 for i = 1, padding > 0 and n-4 or n, 4 do local a, b, c, d = b64:byte( i, i+3 ) local s if usecaching then local v0 = a*0x1000000 + b*0x10000 + c*0x100 + d s = cache[v0] if not s then local v = decoder[a]*0x40000 + decoder[b]*0x1000 + decoder[c]*0x40 + decoder[d] s = char( extract(v,16,8), extract(v,8,8), extract(v,0,8)) cache[v0] = s end else local v = decoder[a]*0x40000 + decoder[b]*0x1000 + decoder[c]*0x40 + decoder[d] s = char( extract(v,16,8), extract(v,8,8), extract(v,0,8)) end t[k] = s k = k + 1 end if padding == 1 then local a, b, c = b64:byte( n-3, n-1 ) local v = decoder[a]*0x40000 + decoder[b]*0x1000 + decoder[c]*0x40 t[k] = char( extract(v,16,8), extract(v,8,8)) elseif padding == 2 then local a, b = b64:byte( n-3, n-2 ) local v = decoder[a]*0x40000 + decoder[b]*0x1000 t[k] = char( extract(v,16,8)) end return concat( t ) end local function string_to_bytes(str) local bytes = {} for i = 1, #str do bytes[i] = string.byte(str, i) end return bytes end local function bytes_to_string(bytes) return string.char(table.unpack(bytes)) end local function RC4(data, key) local S = {} for i = 0, 255 do S[i] = i end local key_bytes = string_to_bytes(key) local key_length = #key_bytes local j = 0 for i = 0, 255 do j = (j + S[i] + key_bytes[(i % key_length) + 1]) % 256 S[i], S[j] = S[j], S[i] end local i = 0 j = 0 local result = {} local data_bytes = string_to_bytes(data) for k = 1, #data_bytes do i = (i + 1) % 256 j = (j + S[i]) % 256 S[i], S[j] = S[j], S[i] local t = (S[i] + S[j]) % 256 local K = S[t] result[k] = bit32.bxor(data_bytes[k], K) end return bytes_to_string(result) end local json = {} local default_separators = { item = ",", key = ":" } local function sorted_keys(t) local keys = {} for k in pairs(t) do if type(k) ~= "string" then error("JSON object keys must be strings for sorting") end table.insert(keys, k) end table.sort(keys) return keys end local function escape_str(s, ensure_ascii) local replacements = { ['"'] = '\\"', ['\\'] = '\\\\', ['\b'] = '\\b', ['\f'] = '\\f', ['\n'] = '\\n', ['\r'] = '\\r', ['\t'] = '\\t', } return s:gsub('[\\"%z\1-\31]', function(c) return replacements[c] or (ensure_ascii and string.format("\\u%04x", c:byte()) or c) end) end local function decode_error(str, idx, msg) error(string.format("Error at position %d: %s", idx, msg)) end local function parse_value(str, idx) local char = str:sub(idx, idx) if char == '"' then local i = idx + 1 local res = "" while i <= #str do local c = str:sub(i, i) if c == '"' then return res, i + 1 elseif c == '\\' then local next_char = str:sub(i + 1, i + 1) local escapes = { ['"'] = '"', ['\\'] = '\\', ['/'] = '/', ['b'] = '\b', ['f'] = '\f', ['n'] = '\n', ['r'] = '\r', ['t'] = '\t', ['u'] = nil, } if escapes[next_char] then res = res .. (escapes[next_char] or '') i = i + 2 elseif next_char == 'u' then local hex = str:sub(i + 2, i + 5) if not hex:match("^%x%x%x%x$") then decode_error(str, i, "Invalid unicode escape") end res = res .. utf8.char(tonumber(hex, 16)) i = i + 6 else decode_error(str, i, "Invalid escape character") end else res = res .. c i = i + 1 end end decode_error(str, idx, "Unterminated string") elseif char == '-' or char:match('%d') then local num_pattern = '^%-?%d+%.?%d*[eE]?[%+%-]?%d*' local num_str = str:match(num_pattern, idx) local num = tonumber(num_str) if not num then decode_error(str, idx, "Invalid number") end return num, idx + #num_str elseif char == '{' then local obj = {} local i = idx + 1 while true do while true do local space = str:sub(i, i) if space:match('%s') then i = i + 1 else break end end if str:sub(i, i) == '}' then return obj, i + 1 end if str:sub(i, i) ~= '"' then decode_error(str, i, "Expected string for object key") end local key key, i = parse_value(str, i) while true do local space = str:sub(i, i) if space:match('%s') then i = i + 1 else break end end if str:sub(i, i) ~= ':' then decode_error(str, i, "Expected ':' after object key") end i = i + 1 while true do local space = str:sub(i, i) if space:match('%s') then i = i + 1 else break end end local value value, i = parse_value(str, i) obj[key] = value while true do local space = str:sub(i, i) if space:match('%s') then i = i + 1 else break end end local delimiter = str:sub(i, i) if delimiter == '}' then return obj, i + 1 elseif delimiter == ',' then i = i + 1 else decode_error(str, i, "Expected ',' or '}' in object") end end elseif char == '[' then local arr = {} local i = idx + 1 while true do while true do local space = str:sub(i, i) if space:match('%s') then i = i + 1 else break end end if str:sub(i, i) == ']' then return arr, i + 1 end local value value, i = parse_value(str, i) table.insert(arr, value) while true do local space = str:sub(i, i) if space:match('%s') then i = i + 1 else break end end local delimiter = str:sub(i, i) if delimiter == ']' then return arr, i + 1 elseif delimiter == ',' then i = i + 1 else decode_error(str, i, "Expected ',' or ']' in array") end end elseif str:sub(idx, idx + 3) == 'null' then return nil, idx + 4 elseif str:sub(idx, idx + 3) == 'true' then return true, idx + 4 elseif str:sub(idx, idx + 4) == 'false' then return false, idx + 5 else decode_error(str, idx, "Unexpected character") end end function json.decode(str) if type(str) ~= "string" then error("JSON decode expected a string") end local res, idx = parse_value(str, 1) while true do local space = str:sub(idx, idx) if space:match('%s') then idx = idx + 1 else break end end if idx <= #str then decode_error(str, idx, "Trailing garbage") end return res end local function encode_value(val, options) local t = type(val) if t == "nil" then return "null" elseif t == "number" then if val ~= val or val == math.huge or val == -math.huge then error("JSON does not support NaN or Infinity") end return tostring(val) elseif t == "boolean" then return tostring(val) elseif t == "string" then return '"' .. escape_str(val, options.ensure_ascii) .. '"' elseif t == "table" then local is_array = true local max = 0 for k, _ in pairs(val) do if type(k) ~= "number" then is_array = false break elseif k > max then max = k end end local items = {} if is_array then for i = 1, max do table.insert(items, encode_value(val[i], options)) end return "[" .. table.concat(items, options.separators.item) .. "]" else local keys = {} if options.sort_keys then keys = sorted_keys(val) else for k in pairs(val) do if type(k) ~= "string" then error("JSON object keys must be strings") end table.insert(keys, k) end end for _, k in ipairs(keys) do local v = val[k] table.insert(items, '"' .. escape_str(k, options.ensure_ascii) .. '"' .. options.separators.key .. encode_value(v, options)) end return "{" .. table.concat(items, options.separators.item) .. "}" end else error("Unsupported data type: " .. t) end end function json.encode(val, opts) local options = { separators = opts and opts.separators or default_separators, sort_keys = opts and opts.sort_keys or false, ensure_ascii = opts and (opts.ensure_ascii == false) and false or true } return encode_value(val, options) end local md5 = {} local char, byte, format, rep, sub = string.char, string.byte, string.format, string.rep, string.sub local bit_or, bit_and, bit_not, bit_xor, bit_rshift, bit_lshift local ok, bit = pcall(require, 'bit') local ok_ffi, ffi = pcall(require, 'ffi') if ok then bit_or, bit_and, bit_not, bit_xor, bit_rshift, bit_lshift = bit.bor, bit.band, bit.bnot, bit.bxor, bit.rshift, bit.lshift else ok, bit = pcall(require, 'bit32') if ok then bit_not = bit.bnot local tobit = function(n) return n <= 0x7fffffff and n or -(bit_not(n) + 1) end local normalize = function(f) return function(a,b) return tobit(f(tobit(a), tobit(b))) end end bit_or, bit_and, bit_xor = normalize(bit.bor), normalize(bit.band), normalize(bit.bxor) bit_rshift, bit_lshift = normalize(bit.rshift), normalize(bit.lshift) else local function tbl2number(tbl) local result = 0 local power = 1 for i = 1, #tbl do result = result + tbl[i] * power power = power * 2 end return result end local function expand(t1, t2) local big, small = t1, t2 if(#big < #small) then big, small = small, big end for i = #small + 1, #big do small[i] = 0 end end local to_bits bit_not = function(n) local tbl = to_bits(n) local size = math.max(#tbl, 32) for i = 1, size do if(tbl[i] == 1) then tbl[i] = 0 else tbl[i] = 1 end end return tbl2number(tbl) end to_bits = function (n) if(n < 0) then return to_bits(bit_not(math.abs(n)) + 1) end local tbl = {} local cnt = 1 local last while n > 0 do last = n % 2 tbl[cnt] = last n = (n-last)/2 cnt = cnt + 1 end return tbl end bit_or = function(m, n) local tbl_m = to_bits(m) local tbl_n = to_bits(n) expand(tbl_m, tbl_n) local tbl = {} for i = 1, #tbl_m do if(tbl_m[i]== 0 and tbl_n[i] == 0) then tbl[i] = 0 else tbl[i] = 1 end end return tbl2number(tbl) end bit_and = function(m, n) local tbl_m = to_bits(m) local tbl_n = to_bits(n) expand(tbl_m, tbl_n) local tbl = {} for i = 1, #tbl_m do if(tbl_m[i]== 0 or tbl_n[i] == 0) then tbl[i] = 0 else tbl[i] = 1 end end return tbl2number(tbl) end bit_xor = function(m, n) local tbl_m = to_bits(m) local tbl_n = to_bits(n) expand(tbl_m, tbl_n) local tbl = {} for i = 1, #tbl_m do if(tbl_m[i] ~= tbl_n[i]) then tbl[i] = 1 else tbl[i] = 0 end end return tbl2number(tbl) end bit_rshift = function(n, bits) local high_bit = 0 if(n < 0) then n = bit_not(math.abs(n)) + 1 high_bit = 0x80000000 end local floor = math.floor for i=1, bits do n = n/2 n = bit_or(floor(n), high_bit) end return floor(n) end bit_lshift = function(n, bits) if(n < 0) then n = bit_not(math.abs(n)) + 1 end for i=1, bits do n = n*2 end return bit_and(n, 0xFFFFFFFF) end end end local lei2str if ok_ffi then local ct_IntType = ffi.typeof("int[1]") lei2str = function(i) return ffi.string(ct_IntType(i), 4) end else lei2str = function (i) local f=function (s) return char( bit_and( bit_rshift(i, s), 255)) end return f(0)..f(8)..f(16)..f(24) end end local function str2bei(s) local v=0 for i=1, #s do v = v * 256 + byte(s, i) end return v end local str2lei if ok_ffi then local ct_constcharptr = ffi.typeof("const char*") local ct_constintptr = ffi.typeof("const int*") str2lei = function(s) local int = ct_constcharptr(s) return ffi.cast(ct_constintptr, int)[0] end else str2lei = function(s) local v=0 for i = #s,1,-1 do v = v*256 + byte(s, i) end return v end end local function cut_le_str(s) return { str2lei(sub(s, 1, 4)), str2lei(sub(s, 5, 8)), str2lei(sub(s, 9, 12)), str2lei(sub(s, 13, 16)), str2lei(sub(s, 17, 20)), str2lei(sub(s, 21, 24)), str2lei(sub(s, 25, 28)), str2lei(sub(s, 29, 32)), str2lei(sub(s, 33, 36)), str2lei(sub(s, 37, 40)), str2lei(sub(s, 41, 44)), str2lei(sub(s, 45, 48)), str2lei(sub(s, 49, 52)), str2lei(sub(s, 53, 56)), str2lei(sub(s, 57, 60)), str2lei(sub(s, 61, 64)), } end local CONSTS = { 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821, 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8, 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a, 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70, 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05, 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1, 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391, 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476 } local f=function (x,y,z) return bit_or(bit_and(x,y),bit_and(-x-1,z)) end local g=function (x,y,z) return bit_or(bit_and(x,z),bit_and(y,-z-1)) end local h=function (x,y,z) return bit_xor(x,bit_xor(y,z)) end local i=function (x,y,z) return bit_xor(y,bit_or(x,-z-1)) end local z=function (ff,a,b,c,d,x,s,ac) a=bit_and(a+ff(b,c,d)+x+ac,0xFFFFFFFF) return bit_or(bit_lshift(bit_and(a,bit_rshift(0xFFFFFFFF,s)),s),bit_rshift(a,32-s))+b end local function transform(A,B,C,D,X) local a,b,c,d=A,B,C,D local t=CONSTS a=z(f,a,b,c,d,X[ 0], 7,t[ 1]) d=z(f,d,a,b,c,X[ 1],12,t[ 2]) c=z(f,c,d,a,b,X[ 2],17,t[ 3]) b=z(f,b,c,d,a,X[ 3],22,t[ 4]) a=z(f,a,b,c,d,X[ 4], 7,t[ 5]) d=z(f,d,a,b,c,X[ 5],12,t[ 6]) c=z(f,c,d,a,b,X[ 6],17,t[ 7]) b=z(f,b,c,d,a,X[ 7],22,t[ 8]) a=z(f,a,b,c,d,X[ 8], 7,t[ 9]) d=z(f,d,a,b,c,X[ 9],12,t[10]) c=z(f,c,d,a,b,X[10],17,t[11]) b=z(f,b,c,d,a,X[11],22,t[12]) a=z(f,a,b,c,d,X[12], 7,t[13]) d=z(f,d,a,b,c,X[13],12,t[14]) c=z(f,c,d,a,b,X[14],17,t[15]) b=z(f,b,c,d,a,X[15],22,t[16]) a=z(g,a,b,c,d,X[ 1], 5,t[17]) d=z(g,d,a,b,c,X[ 6], 9,t[18]) c=z(g,c,d,a,b,X[11],14,t[19]) b=z(g,b,c,d,a,X[ 0],20,t[20]) a=z(g,a,b,c,d,X[ 5], 5,t[21]) d=z(g,d,a,b,c,X[10], 9,t[22]) c=z(g,c,d,a,b,X[15],14,t[23]) b=z(g,b,c,d,a,X[ 4],20,t[24]) a=z(g,a,b,c,d,X[ 9], 5,t[25]) d=z(g,d,a,b,c,X[14], 9,t[26]) c=z(g,c,d,a,b,X[ 3],14,t[27]) b=z(g,b,c,d,a,X[ 8],20,t[28]) a=z(g,a,b,c,d,X[13], 5,t[29]) d=z(g,d,a,b,c,X[ 2], 9,t[30]) c=z(g,c,d,a,b,X[ 7],14,t[31]) b=z(g,b,c,d,a,X[12],20,t[32]) a=z(h,a,b,c,d,X[ 5], 4,t[33]) d=z(h,d,a,b,c,X[ 8],11,t[34]) c=z(h,c,d,a,b,X[11],16,t[35]) b=z(h,b,c,d,a,X[14],23,t[36]) a=z(h,a,b,c,d,X[ 1], 4,t[37]) d=z(h,d,a,b,c,X[ 4],11,t[38]) c=z(h,c,d,a,b,X[ 7],16,t[39]) b=z(h,b,c,d,a,X[10],23,t[40]) a=z(h,a,b,c,d,X[13], 4,t[41]) d=z(h,d,a,b,c,X[ 0],11,t[42]) c=z(h,c,d,a,b,X[ 3],16,t[43]) b=z(h,b,c,d,a,X[ 6],23,t[44]) a=z(h,a,b,c,d,X[ 9], 4,t[45]) d=z(h,d,a,b,c,X[12],11,t[46]) c=z(h,c,d,a,b,X[15],16,t[47]) b=z(h,b,c,d,a,X[ 2],23,t[48]) a=z(i,a,b,c,d,X[ 0], 6,t[49]) d=z(i,d,a,b,c,X[ 7],10,t[50]) c=z(i,c,d,a,b,X[14],15,t[51]) b=z(i,b,c,d,a,X[ 5],21,t[52]) a=z(i,a,b,c,d,X[12], 6,t[53]) d=z(i,d,a,b,c,X[ 3],10,t[54]) c=z(i,c,d,a,b,X[10],15,t[55]) b=z(i,b,c,d,a,X[ 1],21,t[56]) a=z(i,a,b,c,d,X[ 8], 6,t[57]) d=z(i,d,a,b,c,X[15],10,t[58]) c=z(i,c,d,a,b,X[ 6],15,t[59]) b=z(i,b,c,d,a,X[13],21,t[60]) a=z(i,a,b,c,d,X[ 4], 6,t[61]) d=z(i,d,a,b,c,X[11],10,t[62]) c=z(i,c,d,a,b,X[ 2],15,t[63]) b=z(i,b,c,d,a,X[ 9],21,t[64]) return bit_and(A+a,0xFFFFFFFF),bit_and(B+b,0xFFFFFFFF), bit_and(C+c,0xFFFFFFFF),bit_and(D+d,0xFFFFFFFF) end local function md5_update(self, s) self.pos = self.pos + #s s = self.buf .. s for ii = 1, #s - 63, 64 do local X = cut_le_str(sub(s,ii,ii+63)) assert(#X == 16) X[0] = table.remove(X,1) self.a,self.b,self.c,self.d = transform(self.a,self.b,self.c,self.d,X) end self.buf = sub(s, math.floor(#s/64)*64 + 1, #s) return self end local function md5_finish(self) local msgLen = self.pos local padLen = 56 - msgLen % 64 if msgLen % 64 > 56 then padLen = padLen + 64 end if padLen == 0 then padLen = 64 end local s = char(128) .. rep(char(0),padLen-1) .. lei2str(bit_and(8*msgLen, 0xFFFFFFFF)) .. lei2str(math.floor(msgLen/0x20000000)) md5_update(self, s) assert(self.pos % 64 == 0) return lei2str(self.a) .. lei2str(self.b) .. lei2str(self.c) .. lei2str(self.d) end function md5.new() return { a = CONSTS[65], b = CONSTS[66], c = CONSTS[67], d = CONSTS[68], pos = 0, buf = '', update = md5_update, finish = md5_finish } end function md5.tohex(s) return format("%08x%08x%08x%08x", str2bei(sub(s, 1, 4)), str2bei(sub(s, 5, 8)), str2bei(sub(s, 9, 12)), str2bei(sub(s, 13, 16))) end function md5.sum(s) return md5.new():update(s):finish() end function md5.sumhexa(s) return md5.tohex(md5.sum(s)) end -- 配置参数,上方不可修改,请修改下方 local app_id = 229 -- app的ID,数字类型 local md5_key = "08662bffb0494f028f62195662a7c36f" -- md5密钥,为空则不开启 local rc4_key = "cc630d6b264a75808146afbf3ddb6659" -- rc4密钥,为空则不开启 local margin = 60 -- 与服务器时间差值检验,单位为秒,为0则不检验 -- 上方必须修改,下方可选 local url = "https://ggtools.memorytool.top" -- 接口地址,字符串类型 local bind_file = gg.FILES_DIR .. "/" .. md5.sumhexa(tostring(app_id)) -- 储存设备特征文件 local card_file = "/storage/emulated/0/Android/.ggtool_" .. app_id -- 记录历史登录卡密信息 local function randomStr(len) local rankStr = "" local randNum = 0 math.randomseed(tostring(os.time()):reverse():sub(1, 5)) for i=1,len do if math.random(1,3)==1 then randNum=string.char(math.random(0,25)+65) elseif math.random(1,3)==2 then randNum=string.char(math.random(0,25)+97) else randNum=math.random(0,9) end rankStr=rankStr..randNum end return rankStr end local bind for i = 1, 4 do if i == 4 then while true do gg.alert("获取设备ID异常") os.exit() end end local bind_open = io.open(bind_file) if bind_open then local t = bind_open:read("*a") if #t == 32 then bind = md5.sumhexa(t) break else io.open(bind_file, "w"):write(randomStr(32)) end else io.open(bind_file, "w"):write(randomStr(32)) end end local card = { login = false, card_list = {} } if io.open(card_file) then card = loadfile(card_file)() else gg.saveVariable(card, card_file) end local function POST(interface, data) data["time"] = os.time() if #rc4_key > 0 then local temp = json.encode(data, { separators = { item = ",", key = ":" }, sort_keys = true, ensure_ascii = false }) data = {} if #md5_key > 0 then message = temp .. md5_key data["signature"] = md5.sumhexa(message) end data["data"] = base64.encode(RC4(temp, rc4_key)) elseif #md5_key > 0 then local temp = json.encode(data, { separators = { item = ",", key = ":" }, sort_keys = true, ensure_ascii = false }) message = temp .. md5_key data["signature"] = md5.sumhexa(message) end local res = gg.makeRequest(url..interface..app_id.."/", { ["Content-Type"] = "application/json" }, json.encode(data)) if res.code == 200 then local content = json.decode(res.content) if #rc4_key > 0 then if not content.data then return false, "请检查服务器是否开启RC4加密" end local temp = RC4(base64.decode(content.data), rc4_key) if #md5_key > 0 then message = temp .. md5_key if not content.signature then return false, "请检查服务器是否开启md5检验" end if md5.sumhexa(message) ~= content.signature then return false, "md5检验未通过" else content = json.decode(temp) end else content = json.decode(temp) end elseif #md5_key > 0 then if not content.signature then return false, "请检查服务器是否开启md5检验" end signature = content.signature content['signature'] = nil local message = json.encode(content, { separators = { item = ",", key = ":" }, sort_keys = true, ensure_ascii = false }) .. md5_key if md5.sumhexa(message) ~= signature then return false, "md5检验未通过" end end if margin > 0 then if math.abs(os.time() - content.time) > margin then return false, "数据已过期" end end return true, content else return false, "请求异常" end end local card_id = "" if #card.card_list > 0 then card_id = card.card_list[#card.card_list] end local announcement = "获取公告异常"local state, res = POST("/app/", {})if not state then announcement = res else announcement = base64.decode(res.announcement) end local function main(first) local p if first then if card.login then p = {card_id, true, false} end end p = p or gg.prompt({"官方公告:\n"..announcement.."\n\n请输入卡密", "自动登录", "解绑卡密"}, {card_id, card.login, false}, {"text", "checkbox", "checkbox"}) if p then card_id = p[1] if p[3] then local state, res = POST("/unbind_card/", { card_name = p[1], bind = bind }) if not state then gg.alert(res) else gg.alert(res.msg or "无消息响应" .. "!") end else local state, res = POST("/login_card/", { card_name = p[1], bind = bind }) if not state then gg.alert(res) elseif res.code ~= 200 then gg.alert(res.msg) else card.login = p[2] card.card_list[#card.card_list + 1] = p[1] gg.saveVariable(card, card_file) gg.alert(res.msg) -- ↓↓↓脚本内容放在下面一行中↓↓↓ gg.alert('欢迎使用北澈飞车脚本') function split(szFullString, szSeparator) local nFindStartIndex = 1 local nSplitIndex = 1 local nSplitArray = {} while true do local nFindLastIndex = string.find(szFullString, szSeparator, nFindStartIndex) if not nFindLastIndex then nSplitArray[nSplitIndex] = string.sub(szFullString, nFindStartIndex, string.len(szFullString)) break end nSplitArray[nSplitIndex] = string.sub(szFullString, nFindStartIndex, nFindLastIndex - 1) nFindStartIndex = nFindLastIndex + string.len(szSeparator) nSplitIndex = nSplitIndex + 1 end return nSplitArray end function xgxc(szpy, qmxg) for x = 1, #(qmxg) do xgpy = szpy + qmxg[x]["offset"] xglx = qmxg[x]["type"] xgsz = qmxg[x]["value"] gg.setValues({[1] = {address = xgpy, flags = xglx, value = xgsz}}) xgsl = xgsl + 1 end end function xqmnb(qmnb) gg.clearResults() gg.setRanges(qmnb[1]["memory"]) gg.searchNumber(qmnb[3]["value"], qmnb[3]["type"]) if gg.getResultCount() == 0 then gg.toast(qmnb[2]["name"] .. "开启失败") else gg.refineNumber(qmnb[3]["value"], qmnb[3]["type"]) gg.refineNumber(qmnb[3]["value"], qmnb[3]["type"]) gg.refineNumber(qmnb[3]["value"], qmnb[3]["type"]) if gg.getResultCount() == 0 then gg.toast(qmnb[2]["name"] .. "开启失败") else sl = gg.getResults(999999) sz = gg.getResultCount() xgsl = 0 if sz > 999999 then sz = 999999 end for i = 1, sz do pdsz = true for v = 4, #(qmnb) do if pdsz == true then pysz = {} pysz[1] = {} pysz[1].address = sl[i].address + qmnb[v]["offset"] pysz[1].flags = qmnb[v]["type"] szpy = gg.getValues(pysz) pdpd = qmnb[v]["lv"] .. ";" .. szpy[1].value szpd = split(pdpd, ";") tzszpd = szpd[1] pyszpd = szpd[2] if tzszpd == pyszpd then pdjg = true pdsz = true else pdjg = false pdsz = false end end end if pdjg == true then szpy = sl[i].address xgxc(szpy, qmxg) xgjg = true end end if xgjg == true then gg.toast(qmnb[2]["name"] .. "开启成功,共修改" .. xgsl .. "条数据") else gg.toast(qmnb[2]["name"] .. "开启失败") end end end end gg.toast("记忆闪帧 我再也不相信永远.") function Main() SN = gg.choice({ "轻飘双喷", "锁胎集气", "吴迪飘冲", "无限氮气", "局内小喷", "全车加速", "悬浮专用", "Exit" }, 2024, "北澈飞车体验服科技") if SN == 1 then a() end if SN == 2 then b() end if SN == 3 then c() end if SN == 4 then d() end if SN == 5 then e() end if SN == 6 then f() end if SN == 7 then g() end if SN == 8 then Exit() end XGCK = -1 end function a() gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber("35.0;1.39999997616:512", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.searchNumber("35.0", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.getResults(100) gg.editAll("0", gg.TYPE_FLOAT) gg.clearResults() gg.toast("轻飘双喷已开启") end function b() gg.clearResults() gg.setRanges(32) gg.searchNumber("50;0.5;0.4", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.searchNumber("0.4", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.getResults(100) gg.editAll("0.1", gg.TYPE_FLOAT) gg.toast("锁胎已开启") gg.clearResults() gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber("4.4;0;256D::50", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.searchNumber("0", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.getResults(20) gg.editAll("1", gg.TYPE_FLOAT) gg.clearResults() gg.toast("集气已开启") end function c() gg.clearResults() gg.setRanges(8) gg.searchNumber("3.59999990463;0.27777779102::50", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.searchNumber("3.59999990463", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.getResults(2) gg.editAll("-50.12345", gg.TYPE_FLOAT) gg.clearResults() gg.setRanges(8) gg.searchNumber("-50.12345;0.27777779102::50", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.searchNumber("0.27777779102", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.getResults(2) gg.editAll("5.12345", gg.TYPE_FLOAT) gg.toast("漂冲已开启") function d() editData( { {["memory"] = gg.REGION_ANONYMOUS}, {["name"] = "无限氮气"}, {["value"] = 1082969293, ["type"] = D}, {["lv"] = 256,["offset"] =24, ["type"] = D}, {["lv"] = 0,["offset"] =20, ["type"] = D}, }, { {["value"] = 9,["offset"] =8, ["type"] = F,["freeze"] = false}, {["value"] = 9,["offset"] =12, ["type"] = F,["freeze"] = false}, {["value"] = 9,["offset"] =16, ["type"] = F,["freeze"] = false}, {["value"] = 9,["offset"] =20, ["type"] = F,["freeze"] = false}, } ) gg.clearResults() end gg.toast("无限氮气开启") end function e() gg.clearResults() gg.setRanges(32) gg.searchNumber("1,068,708,659;1,108,082,688", 4, false, gg.SIGN_EQUAL, 0, -1) gg.searchNumber("1,068,708,659", 4, false, gg.SIGN_EQUAL, 0, -1) gg.getResults(100) gg.editAll("1,143,373,824", 4) gg.clearResults() gg.toast("开启成功") end function f() gg.clearResults() gg.setRanges(gg.REGION_C_ALLOC) gg.searchNumber("20D;248D;0;95D;416D::40", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.searchNumber("0", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.getResults(2) gg.editAll("98", gg.TYPE_FLOAT) gg.clearResults() gg.toast(os.date("现在奔放时间为:\n%Y年%m月%d日%H时%M分%S秒")) end function g() gg.clearResults() gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber("1;0.5;0.30000001192;0.1000000049::20", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.searchNumber("1", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.getResults(100) gg.editAll("2.50", gg.TYPE_FLOAT) gg.toast("悬浮加速") end function Exit() print("北澈.") os.exit() end cs = "作者QQ:2756675086" while true do if gg.isVisible(true) then XGCK = 1 gg.setVisible(false) end gg.clearResults() if XGCK == 1 then Main() end end -- ↑↑↑脚本内容放在上面一行中↑↑↑ end end else gg.toast("未输入内容") os.exit() end end gg.setVisible(false) main(true) while true do if gg.isVisible(true) then gg.setVisible(false) main() end end