mirror of
https://github.com/GameHackingBook/GameHackingCode
synced 2026-06-08 11:08:54 +00:00
Added lua scripts and fixed a typo in state machine code
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
function _verifyLinkedList(address)
|
||||
local nextItem = readInteger(address) or 0
|
||||
local previousItem = readInteger(address + 4) or 0
|
||||
local nextItemBack = readInteger(nextItem + 4)
|
||||
local previousItemForward = readInteger(previousItem)
|
||||
|
||||
return (address == nextItemBack
|
||||
and address == previousItemForward)
|
||||
end
|
||||
|
||||
function isValueInLinkedList(valueAddress)
|
||||
for address = valueAddress - 8, valueAddress - 48, -4 do
|
||||
if (_verifyLinkedList(address)) then
|
||||
return address
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
local node = isValueInLinkedList(addressOfSomeValue)
|
||||
if (node > 0) then
|
||||
print(string.format("Value in LL, top of node at 0x0%x", node))
|
||||
end
|
||||
Reference in New Issue
Block a user