Removed unused triggers folder

develop
Warmist 2012-09-15 18:05:53 +03:00
parent 4f9732bfda
commit 2f131178d8
7 changed files with 0 additions and 222 deletions

@ -1 +0,0 @@
as -anl --32 -o triggers.o triggers.asm

@ -1,20 +0,0 @@
function func.Find_Print()
pos=offsets.find(offsets.base(),0x73,0x02,0x8b,0xce,0x53,0x6a,0x01,0x6a,0x06,CALL) -- a hack for now...
return engine.peekd(pos+10)+pos+14-offsets.base()
end
function func.PrintMessage(msg,color1,color2)
func.f_print_pos= func.f_print_pos or func.Find_Print()
print(string.format("Print @:%x",func.f_print_pos))
debuger.suspend()
d=NewCallTable() -- make a call table
t=Allocate(string.len(msg))
engine.pokestr(t,msg)
--print(string.format("Message location:%x",t))
d["ECX"]=t --set ecx to message location
d["STACK5"]=color1 -- push to stack color1
d["STACK4"]=color2 -- push to stack color2
d["STACK3"]=0 -- this is usually 0 maybe a struct pointing to location of this message?
PushFunction(func.f_print_pos+offsets.base(),d) -- prep to call function
-- was 0x27F030
debuger.resume()
end

@ -1,12 +0,0 @@
func={}
dofile("dfusion/triggers/functions.lua")
func.menu=MakeMenu()
function func.PrintMessage_()
print("Type a message:")
msg=io.stdin:read()
func.PrintMessage(msg,6,1)
end
if not(FILE) then -- if not in script mode
func.menu:add("Print message",func.PrintMessage_)
func.menu:display()
end

@ -1,107 +0,0 @@
if FILE then
return
end
callinfo={}
callinfo.regs={}
callinfo.regs["EAX"]=0
callinfo.regs["EBX"]=1
callinfo.regs["ECX"]=2
callinfo.regs["EDX"]=3
callinfo.regs["ESI"]=4
callinfo.regs["EDI"]=5
callinfo.regs["STACK1"]=6
callinfo.regs["STACK2"]=7
callinfo.regs["STACK3"]=8
callinfo.regs["STACK4"]=9
callinfo.regs["STACK5"]=10
mypos=engine.getmod("triggers_main")
function GetCount()
return engine.peek(0,triggers.count)
end
function SetCount(val)
engine.poke(0,triggers.count,val)
end
function NewCallTable(tbl)
ret=tbl or {}
for k,v in pairs(callinfo.regs) do
ret[k]=0
end
return ret
end
function PushFunction(off,data)
local i=GetCount()
engine.poked(triggers.table.off+i*44,off) -- add function to table
engine.poked(triggers.data.off+0,data["EAX"]) --set register data...
engine.poked(triggers.data.off+4,data["EBX"])
engine.poked(triggers.data.off+8,data["ECX"])
engine.poked(triggers.data.off+12,data["EDX"])
engine.poked(triggers.data.off+16,data["ESI"])
engine.poked(triggers.data.off+20,data["EDI"])
engine.poked(triggers.data.off+24,data["STACK1"])
engine.poked(triggers.data.off+28,data["STACK2"])
engine.poked(triggers.data.off+32,data["STACK3"])
engine.poked(triggers.data.off+36,data["STACK4"])
engine.poked(triggers.data.off+40,data["STACK5"])
SetCount(i+1)
end
function loadTriggers()
if triggers then return end
triggers={}
p=engine.getmod("triggerdata")
triggers.count={off=engine.peekd(p),rtype=DWORD}
triggers.table={off=engine.peekd(p+4),rtype=DWORD}
triggers.ret={off=engine.peekd(p+8),rtype=DWORD}
triggers.data={off=engine.peekd(p+12),rtype=DWORD}
end
if mypos then
loadTriggers()
dofile("dfusion/triggers/functions_menu.lua")
--return
else
triggers={}
off=0x56D345+offsets.base()
print(string.format("Function start %x",off))
ModData=engine.installMod("dfusion/triggers/triggers.o","triggers_main")
print("installed")
modpos=ModData.pos
modsize=ModData.size
fdata=engine.newmod("function_body",256)
engine.poked(modpos+engine.FindMarker(ModData,"trigercount"),modpos+modsize) -- count of functions
engine.poked(modpos+engine.FindMarker(ModData,"f_loc"),modpos+modsize+4) -- function table start
engine.poked(modpos+engine.FindMarker(ModData,"f_data"),fdata) -- function data start
engine.poked(modpos+engine.FindMarker(ModData,"saveplace31"),modpos+modsize+260) -- save function loc
engine.poked(modpos+engine.FindMarker(ModData,"saveplace32"),modpos+modsize+260) -- save function loc
engine.poked(modpos+engine.FindMarker(ModData,"saveplace33"),modpos+modsize+260) -- save function loc
engine.poked(modpos+engine.FindMarker(ModData,"saveplace"),modpos+modsize+256) -- save function loc
engine.poked(modpos+engine.FindMarker(ModData,"trigcount2"),modpos+modsize) -- count of functions (for zeroing)
engine.poked(modpos+engine.FindMarker(ModData,"saveplace2"),modpos+modsize+256) -- save function loc
engine.poked(modpos+engine.FindMarker(ModData,"results"),modpos+modsize+256) --overwrite function call with results
triggers.count={off=modpos+modsize,rtype=DWORD}
triggers.table={off=modpos+modsize+4,rtype=DWORD}
triggers.ret={off=modpos+modsize+256,rtype=DWORD}
triggers.data={off=fdata,rtype=DWORD}
pp=Allocate(4*4)
engine.poked(pp,triggers.count.off)
engine.poked(pp+4,triggers.table.off)
engine.poked(pp+8,triggers.ret.off)
engine.poked(pp+12,triggers.data.off)
engine.newmod("triggerdata",0,pp)
function pokeCall(off)
engine.pokeb(off,0xe8)
--b=engine.peekb(off+1)
engine.poked(off+1,modpos-off-5)
--engine.pokeb(off+5,b)
end
print(string.format("Mod @:%x",modpos))
dat=engine.peekarb(off,5)
engine.pokearb(modpos,dat,5)
pokeCall(off)
end

@ -1,68 +0,0 @@
.intel_syntax
nop #5 nops for instruction thats replaced by call
nop
nop
nop
nop
pushad
pushfd
saveplace31:
mov [0xDEADBEEF], esp
trigercount:
mov eax, [0xDEADBEEF] #mov count of triggers.
f_loc:
mov esi, 0xdeadbeef #mov location of functions.
f_data:
mov ebx, 0xDEADBEEF #mov a start of function data
test eax,eax
jz lend
lstart:
dec eax
push ebx
push eax
mov eax,[esi+eax*4]
saveplace:
mov [0xDEADBEEF],eax #save function for later
pop eax
push eax
mov edx,44
mul edx
add eax,ebx
#stack preparation
mov ebx,[eax+24]
push ebx
mov ebx,[eax+28]
push ebx
mov ebx,[eax+32]
push ebx
mov ebx,[eax+36]
push ebx
mov ebx,[eax+40]
push ebx
mov ebx,[eax+4]
mov ecx,[eax+8]
mov edx,[eax+12]
mov esi,[eax+16]
mov edi,[eax+20]
mov eax,[eax]
saveplace2:
call [0xdeadbeef] #same save loc
results:
mov [0xDEADBEEF],eax #get result
saveplace33:
mov esp, [0xDEADBEEF]
add esp, -8
pop eax
pop ebx
cmp eax,0
jnz lstart
lend:
xor eax,eax
trigcount2:
mov dword ptr [0xDEADBEEF], eax # zero triggers
saveplace32:
mov esp, [0xDEADBEEF]
popfd
popad
ret

@ -1,14 +0,0 @@
.intel_syntax
#eax - num of function
#ebx -start of data
mov ecx,eax
mul 10
add ebx
mov ebx,[eax+4]
mov ecx,[eax+8]
mov edx,[eax+12]
mov esi,[eax+16]
mov edi,[eax+20]
mov eax,[eax]
retn