Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gg.showUiButton()
- gg.alert("已切換到基址查詢模式\n\n點擊 SX 按鈕可調出功能表\n同時也可以使用修改器功能")
- function Start()
- MAIN = gg.choice({
- "查询",
- "返回",
- "退出",
- })
- if MAIN == nil then
- else
- if MAIN == 1 then CK() end
- if MAIN == 2 then BACK() end
- if MAIN == 3 then END() end
- end
- FMXR=-1
- end
- local results = {}
- function formatHex(num)
- if not num then return "未知" end
- return string.format("0x%X", num)
- end
- function getAllMemoryRanges()
- local ranges = gg.getRangesList()
- if not ranges then
- gg.alert("无法获取内存区域信息")
- return nil
- end
- return ranges
- end
- function findMemoryRegion(address, ranges)
- for i, region in ipairs(ranges) do
- if address >= region.start and address <= region['end'] then
- return region
- end
- end
- return nil
- end
- function analyzeAddress(address, number, ranges)
- local region = findMemoryRegion(address, ranges)
- if not region then
- return {
- number = number,
- address = formatHex(address),
- moduleName = "未找到",
- moduleBase = "未知",
- offset = "无法计算"
- }
- end
- local offset = address - region.start
- return {
- number = number,
- address = formatHex(address),
- moduleName = region.name or "未命名模块",
- moduleBase = formatHex(region.start),
- offset = formatHex(offset)
- }
- end
- function processAddresses()
- local selected = gg.getSelectedResults()
- if not selected or #selected == 0 then
- gg.alert("请先勾选要分析的地址!")
- return false
- end
- local ranges = getAllMemoryRanges()
- if not ranges then return false end
- results = {}
- for i, item in ipairs(selected) do
- local address = item.address
- if address and address ~= 0 then
- local info = analyzeAddress(address, i, ranges)
- table.insert(results, info)
- end
- end
- return true
- end
- function showResults()
- local resultText = "地址分析结果:\n\n"
- for _, info in ipairs(results) do
- resultText = resultText ..
- "编号: " .. info.number .. "\n" ..
- "地址: " .. info.address .. "\n" ..
- "模块名: " .. info.moduleName .. "\n" ..
- "模块基址: " .. info.moduleBase .. "\n" ..
- "偏移量: " .. info.offset .. ""
- end
- gg.alert(resultText)
- end
- function CK()
- local status, err = pcall(function()
- if processAddresses() then
- showResults()
- end
- end)
- if not status then
- gg.alert("脚本执行出错:" .. tostring(err))
- end
- end
- function BACK()
- local menu = gg.alert('請選擇要切換的模式\n如果搜索列表有數據請先保存到列表中再繼續返回操作', "返回", "正常模式", "調試模式")
- if menu == 1 then
- Start()
- elseif menu == 2 then
- API = gg.makeRequest(' https://pastebin.com/raw/YuSvmysd ').content
- if not API then
- gg.alert('no interned access,please try again later')
- else
- pcall(load(API))
- end
- elseif menu == 3 then
- API = gg.makeRequest(' https://pastebin.com/raw/vhMuGyGv ').content
- if not API then
- gg.alert('no interned access,please try again later')
- else
- pcall(load(API))
- end
- end
- end
- function END()
- gg.setVisible(true)
- os.exit()
- end
- while(true)do
- gg.sleep(1)
- if gg.isClickedUiButton() then
- FMXR=1
- else
- FMXR=-1
- end
- if FMXR==1 then
- Start()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement