.486 ; create 32 bit code
.model flat, stdcall ; 32 bit memory model
option casemap :none ; case sensitive
include windows.inc
include kernel32.inc
includelib kernel32.lib
RemoteInjectModule PROTO :DWORD,:DWORD
RemoteUnloadModule PROTO :DWORD,:DWORD
.data
szKernel32 db 'Kernel32',0
szGetModuleHandleA db 'GetModuleHandleA',0
szLoadLibraryA db 'LoadLibraryA',0
szFreeLibrary db 'FreeLibrary',0
.code
Start:
RemoteInjectModule proc dwProcID,pszModule
LOCAL hProcess, hThread, dwExitCode
LOCAL pszBuffer,pdwAddress
Invoke OpenProcess,PROCESS_QUERY_INFORMATION Or PROCESS_CREATE_THREAD Or PROCESS_VM_OPERATION Or PROCESS_VM_WRITE, 0, dwProcID
MOV hProcess,EAX
.If hProcess == 0
JMP ErrHandle
.Endif