SneakySquid icon

Function Pointer Shit

SneakySquid | PRO | 07/17/24 12:41:17 PM UTC (Edited) | 0 ⭐ | 507 👁️ | Never ⏰ | []
Lua |

1.26 KB

|

None

|

0 👍

/

0 👎

-- just this https://github.com/ExtReMLapin/lua_soft_cpp_detour_finders
-- but not shitcode
 
local function GetPointer(obj)
    return string.format("%p", obj)
end
 
 
local BaseAddr = GetPointer(_G)
 
 
print(string.format("Using _G (%d) as the base.", BaseAddr))
 
 
print("HTTP:", BaseAddr - GetPointer(HTTP))
print("RunString:", BaseAddr - GetPointer(RunString))
 
 
print("print:", BaseAddr - GetPointer(print))
print("tostring:", BaseAddr - GetPointer(tostring))
print("debug.getinfo:", BaseAddr - GetPointer(debug.getinfo))
 
 
--[[
    -- Original:
    Using _G (568660800) as the base.
    HTTP:   -264193624
    RunString:  -264191768
    print:  -22344
    tostring:   -21856
    debug.getinfo:  -30376
 
 
    -- Retry:
    Using _G (268374848) as the base.
    HTTP:   -127312
    RunString:  -125456
    print:  -22344
    tostring:   -21856
    debug.getinfo:  -30376
 
 
    -- Server Restart:
    Using _G (502862656) as the base.
    HTTP:   -235357784
    RunString:  -235355928
    print:  -22344
    tostring:   -21856
    debug.getinfo:  -30376
 
 
    -- Game Restart:
    Using _G (822809408) as the base.
    HTTP:   -869976
    RunString:  -868120
    print:  -22344
    tostring:   -21856
    debug.getinfo:  -30376
]]

Comments