Better onfunction hints, new onfunction location (Hurt)

develop
Warmist 2011-09-21 22:52:26 +03:00
parent 6a56eabd71
commit 8e70a02941
2 changed files with 9 additions and 1 deletions

@ -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)

@ -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