Created
April 2, 2012 16:49
-
-
Save warmist/2284959 to your computer and use it in GitHub Desktop.
A dfusion script to find places that set death flag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function DEATH_FIND() | |
local unit=df.global.world.units.all[0] | |
local offset=select(2,df.sizeof(unit:_field("flags1")))-select(2,df.sizeof(unit)) | |
print(string.format("flags offset:%x",offset)) | |
local list=offsets.findall(GetTextRegion().start,0x83,ANYBYTE,DWORD_,offset,2) | |
for k,v in pairs(list) do | |
local call_pos=offsets.find(v,0xe8,DWORD) | |
if call_pos~=nil and call_pos~=0 and call_pos-v<1000 then | |
print(string.format("%3d.%6d =>%6x",k,(call_pos-v),v)) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment