diff --git a/plugins/Dfusion/luafiles/onfunction/init.lua b/plugins/Dfusion/luafiles/onfunction/init.lua index 52620ad10..a32f6efc7 100644 --- a/plugins/Dfusion/luafiles/onfunction/init.lua +++ b/plugins/Dfusion/luafiles/onfunction/init.lua @@ -39,7 +39,6 @@ function onfunction.patch(addr) if(engine.peekb(addr)~=0xe8) then error("Incorrect address, not a function call") else - onfunction.calls[addr+5]=addr+engine.peekd(addr+1)+5 --adds real function to call engine.poked(addr+1,engine.getmod("functions")-addr-5) end @@ -51,6 +50,14 @@ function onfunction.AddFunction(addr,name,hints) onfunction.hints[name]=hints end end +function onfunction.ReadHint(values,name,hintname) + local hints=onfunction.hints[name] + if hints ==nil then return nil end + local hint=hints[hintname] + if type(hint)=="string" then return values[hint] end + local off=hint.off or 0 + return engine.peek(off+values[hint.reg],hints[hintname].rtype) +end function onfunction.SetCallback(name,func) if onfunction.names[name]==nil then error("No such function:"..name) diff --git a/plugins/Dfusion/luafiles/onfunction/locations.lua b/plugins/Dfusion/luafiles/onfunction/locations.lua index 9054003bb..d3e32bb59 100644 --- a/plugins/Dfusion/luafiles/onfunction/locations.lua +++ b/plugins/Dfusion/luafiles/onfunction/locations.lua @@ -5,6 +5,7 @@ if WINDOWS then --windows function defintions onfunction.AddFunction(0x349640+offsets.base(),"AddItem",{item="esp"}) --or esp onfunction.AddFunction(0x26e840+offsets.base(),"Dig_Create",{item_type="esp"}) --esp+8 -> material esp->block type onfunction.AddFunction(0x3d4301+offsets.base(),"Make_Item",{item_type="esp"}) + onfunction.AddFunction(0x5af826+offsets.base(),"Hurt",{target="esi",attacker={off=0x74,rtype=DWORD,reg="esp"}}) else --linux onfunction.AddFunction(0x899befe+offsets.base(),"Move") -- found out by attaching watch... onfunction.AddFunction(0x850eecd+offsets.base(),"Die",{creature="ebx"}) -- same