local 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 -- 执行修改/冻结函数 local function xgxc(szpy, qmxg) local xgsl = 0 local xgjg = false for x = 1, #qmxg do local xgpy = szpy + qmxg[x]["offset"] local xglx = qmxg[x]["type"] local xgsz = qmxg[x]["value"] local xgdj = qmxg[x]["freeze"] if xgdj == nil or xgdj == "" then gg.setValues({[1] = {address = xgpy, flags = xglx, value = xgsz}}) else gg.addListItems({[1] = {address = xgpy, flags = xglx, freeze = xgdj, value = xgsz}}) end xgsl = xgsl + 1 xgjg = true end return xgsl, xgjg end -- 内存搜索与匹配函数(修复qmxg参数传递) local function xqmnb(qmnb, qmxg) 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"] .. "开启成功") return false, 0 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"] .. "开启成功") return false, 0 else local sl = gg.getResults(999999) local sz = gg.getResultCount() local xgsl = 0 local xgjg = false if sz > 999999 then sz = 999999 end for i = 1, sz do local pdsz = true local pdjg = false for v = 4, #qmnb do if pdsz == true then local pysz = {[1] = {address = sl[i].address + qmnb[v]["offset"], flags = qmnb[v]["type"]}} local szpy = gg.getValues(pysz) local pdpd = qmnb[v]["lv"] .. ";" .. szpy[1].value local szpd = split(pdpd, ";") local tzszpd = szpd[1] local pyszpd = szpd[2] if tzszpd == pyszpd then pdjg = true pdsz = true else pdjg = false pdsz = false end end end if pdjg == true then local szpy_addr = sl[i].address local add_sl, add_jg = xgxc(szpy_addr, qmxg) xgsl = xgsl + add_sl xgjg = add_jg or xgjg end end gg.toast(xgjg and (qmnb[2]["name"] .. "开启成功,一共修改" .. xgsl .. "条数据") or (qmnb[2]["name"] .. "未搜索到数据,开启失败")) return xgjg, xgsl end end end -- 自定义范围修改函数 local function ziGaiFanWei() local OP = gg.prompt({'100-300'}, {[1] = '200'}, {[1] = 'number'}) if OP == nil or OP[1] == '' or OP[1] == '0' then gg.toast("取消") return end gg.clearResults() gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber("9.20161819458;23;25;30.5", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.searchNumber("25;30.5", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.getResults(1000) gg.editAll(OP[1], gg.TYPE_FLOAT) gg.clearResults() gg.setRanges(gg.REGION_CODE_APP) gg.searchNumber("-443715560;-299365883", gg.TYPE_DWORD) gg.refineNumber("-443715560", gg.TYPE_DWORD) gg.getResults(10) gg.editAll("0", gg.TYPE_DWORD) gg.clearResults() gg.setRanges(16384) gg.searchNumber("-289596733;-308983296;-298640831;-298370492;-294581562;-298706367:193", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1) gg.searchNumber("-289596733;-308983296;-298640831;-298370492;-294581562;-298706367:193", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1) gg.getResults(100) gg.editAll("0", gg.TYPE_DWORD) gg.clearResults() gg.setRanges(gg.REGION_CODE_APP) gg.searchNumber("-299365883", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1, 0) local revert = gg.getResults(200) gg.editAll("10", gg.TYPE_DWORD) gg.processResume() gg.clearResults() gg.setRanges(32) gg.toast("范围开启成功") end -- 第一组修改参数与执行 local qmnb1 = { {["memory"] = 32}, {["name"] = "头部100%"}, {["value"] = 4740038608910024704, ["type"] = 32}, {["lv"] = 4752423507886342144, ["offset"] = 4, ["type"] = 32}, {["lv"] = 1106509824, ["offset"] = 8, ["type"] = 32}, } local qmxg1 = { {["value"] = 150, ["offset"] = 0, ["type"] = 16}, {["value"] = 150, ["offset"] = 4, ["type"] = 16}, {["value"] = 150, ["offset"] = 8, ["type"] = 16}, } xqmnb(qmnb1, qmxg1) gg.toast("修伤") -- 第二组修改参数与执行 local qmnb2 = { {["memory"] = 32}, {["name"] = " "}, {["value"] = 4771563806291656704, ["type"] = 32}, {["lv"] = 1110966272, ["offset"] = 4, ["type"] = 32}, {["lv"] = 4692750811720056832, ["offset"] = -4, ["type"] = 32}, } local qmxg2 = { {["value"] = 9999, ["offset"] = 0, ["type"] = 16}, } xqmnb(qmnb2, qmxg2) -- 批量数值修改 gg.searchNumber("-298284466", gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1) gg.getResults(15) gg.editAll("0", gg.TYPE_DWORD) gg.clearResults() gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber("90000", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.searchNumber("90000", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.getResults(100) gg.editAll("500000", gg.TYPE_FLOAT) gg.clearResults() gg.setRanges(gg.REGION_ANONYMOUS) gg.searchNumber("15;28;16;26;8;18", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.setRanges(gg.REGION_CODE_APP) gg.searchNumber("-3.77830899e28;-3.74440972e28;-3.71834013e28;-1.7334334e28", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1, 0) gg.refineNumber("-5.77775931e27", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.getResults(2) gg.editAll("-560", gg.TYPE_FLOAT) gg.clearResults() gg.toast("开启完成")