Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local targetPackage = "com.plarium.mechlegion"
- local scriptVersion = "3.330.00"
- local Update = "2025/08/11"
- function showApkInfo()
- local info = gg.getTargetInfo()
- local is64 = info.x64 and "64-bit" or "32-bit"
- local packageName = gg.getTargetPackage()
- local version = info.versionName or "Unknown"
- if version ~= scriptVersion then
- gg.alert("Please update scripts!\nScript version: " .. scriptVersion .. "\nAPK version: " .. version)
- os.exit()
- end
- local message = string.format(
- "APK Info :\n\nApk Name : Mech Arena\nPackage : %s\nGame Version : %s\nScript Version :%s\nArchitecture : %s\n Update : %s\nScript By : AbhiModszYT",
- packageName, version, scriptVersion, is64, Update
- )
- gg.alert(message)
- end
- function checkArch()
- local info = gg.getTargetInfo()
- if info.x64 then
- gg.toast("Please Install 32-bit APK")
- os.exit()
- else
- gg.toast("32-bit Architecture Detected")
- gg.sleep(5000)
- end
- end
- showApkInfo()
- checkArch()
- local n, startAddress, endAddress = nil, 0, 0
- local originalValues = {}
- local function name(lib)
- if n == lib then
- return startAddress, endAddress
- end
- local ranges = gg.getRangesList(lib or 'libil2cpp.so')
- for i, v in ipairs(ranges) do
- if v.state == "Xa" then
- startAddress = v.start
- endAddress = ranges[#ranges]['end']
- break
- end
- end
- return startAddress, endAddress
- end
- local function hexToBytes(hex)
- local t = {}
- for h in string.gmatch(hex, "%S%S") do
- table.insert(t, tonumber(h, 16))
- end
- return t
- end
- local function togglePatch(libname, offset, hex, label)
- name(libname)
- local address = startAddress + offset
- local newBytes = hexToBytes(hex)
- local byteCount = #newBytes
- local readTable = {}
- for i = 0, byteCount - 1 do
- table.insert(readTable, {address = address + i, flags = gg.TYPE_BYTE})
- end
- local currentValues = gg.getValues(readTable)
- local key = string.format("%s_%X", libname, offset)
- if originalValues[key] == nil then
- originalValues[key] = {}
- for i, v in ipairs(currentValues) do
- table.insert(originalValues[key], v.value)
- end
- local patchTable = {}
- for i, b in ipairs(newBytes) do
- table.insert(patchTable, {
- address = address + i - 1,
- flags = gg.TYPE_BYTE,
- value = b
- })
- end
- gg.setValues(patchTable)
- gg.toast(label .. " Enabled")
- else
- local restoreTable = {}
- for i, val in ipairs(originalValues[key]) do
- table.insert(restoreTable, {
- address = address + i - 1,
- flags = gg.TYPE_BYTE,
- value = val
- })
- end
- gg.setValues(restoreTable)
- originalValues[key] = nil
- gg.toast(label .. " Disabled")
- end
- end
- local patches = {
- {name = "Speed Hack", offset = 0x35659F0, hex = "C8 01 44 E3 1E FF 2F E1"},
- {name = "No Cooldown Dash", offset = 0x3562E58, hex = "00 00 A0 E3 1E FF 2F E1"},
- {name = "No Cooldown Skills", offset = 0x3562F54, hex = "00 00 A0 E3 1E FF 2F E1"},
- -- name = "Unlimited Dash", offset = 0x3527030, hex = "00 00 A0 E3 1E FF 2F E1"},
- {name = "No Reload", offset = 0x27312D8, hex = "80 0F 43 E3 1E FF 2F E1"},
- }
- local function isPatchEnabled(libname, offset)
- local key = string.format("%s_%X", libname, offset)
- return originalValues[key] ~= nil
- end
- local function main()
- local menuItems = {}
- for i, patch in ipairs(patches) do
- local status = isPatchEnabled("libil2cpp.so", patch.offset) and "✅" or "❌"
- table.insert(menuItems, string.format("%s %s", patch.name, status))
- end
- table.insert(menuItems, "Exit Script")
- local menu = gg.choice(menuItems, nil, "Hacks : Enabled ✅ / Disabled ❌")
- if not menu then return end
- if menu == #menuItems then
- os.exit()
- else
- local patch = patches[menu]
- togglePatch("libil2cpp.so", patch.offset, patch.hex, patch.name)
- end
- end
- while true do
- if gg.isVisible() then
- gg.setVisible(false)
- main()
- end
- gg.sleep(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment