feat(core): CheatEngine item container coprse loaders

This commit is contained in:
gromchek 2026-01-17 15:25:16 +03:00
parent 52bd97bc47
commit 89a8691959
14 changed files with 2787 additions and 106 deletions

View file

@ -716,55 +716,45 @@ function GetCGObjectAddr(guidValue)
return nil
end
local CGUNIT_C_VTABLE = 0xa34d90
local CGPLAYER_C_VTABLE = 0xa326c8
local VTABLE_TYPES = {
[0xA34D90] = "unit",
[0xA326C8] = "player",
[0xA33428] = "item",
[0xA332D0] = "container",
[0xA331C8] = "corpse",
}
local memScan = createMemScan()
local foundList = createFoundList(memScan)
local function cleanup()
foundList.destroy()
memScan.destroy()
end
memScan.firstScan(
soExactValue,
vtQword,
rtRounded,
soExactValue, vtQword, rtRounded,
string.format("%016X", guidValue),
nil,
0x0,
0x7FFFFFFFFFFFFFFF,
"",
fsmNotAligned,
nil,
true,
false,
false,
false
nil, 0x0, 0x7FFFFFFFFFFFFFFF,
"", fsmNotAligned, nil,
true, false, false, false
)
memScan.waitTillDone()
foundList.initialize()
local resultAddr, resultType = nil, nil
for i = 0, foundList.Count - 1 do
local addrGUIDvalue = tonumber(foundList.Address[i], 16)
if addrGUIDvalue then
local base = addrGUIDvalue - 0x30
local vtbl = readInteger(base)
if vtbl == CGPLAYER_C_VTABLE then
resultAddr, resultType = base, "player"
break
elseif vtbl == CGUNIT_C_VTABLE then
resultAddr, resultType = base, "unit"
break
local addr = tonumber(foundList.Address[i], 16)
if addr then
local base = addr - 0x30
local objType = VTABLE_TYPES[readInteger(base)]
if objType then
cleanup()
return base, objType
end
end
end
foundList.destroy()
memScan.destroy()
if resultAddr then
return resultAddr, resultType
end
cleanup()
return nil
end