31-01-2021, 11:33 AM
.This is a very basic loader without Address Space Layout Randomization support
It Can build to produce 32bit or 64bit application (MASM32 or MASM64)
ifndef _Win64
include masm32rt.inc
else
include masm64rt.inc
endif
.const
filename db "victim.exe", 0
targetaddress dd 403000h
values db 4 dup(90h,90h,90h,90h)
sinfo STARTUPINFO<>
pinfo PROCESS_INFORMATION<>
.code
start proc
invoke CreateProcessA, addr filename, NULL, 0, 0, 0, CREATE_SUSPENDED, 0, 0, addr sinfo, addr pinfo
invoke WriteProcessMemory, pinfo.hProcess, targetaddress, addr values, 4, NULL
invoke ResumeThread, pinfo.hThread
invoke ExitProcess, 0
ret 0
start endp
end