_hInstance dd ?
_hWinMain dd ?
_szClassName db 'RemoteClass', 0
_szCaptionMain db 'RemoteWindow', 0
_szDestroyWindow db 'DestroyWindow', 0
_szPostQuitMessage db 'PostQuitMessage', 0
_szDefWindowProc db 'DefWindowProcA', 0
_szLoadCursor db 'LoadCursorA', 0
_szRegisterClassEx db 'RegisterClassExA', 0
_szCreateWindowEx db 'CreateWindowExA', 0
_szShowWindow db 'ShowWindow', 0
_szUpdateWindow db 'UpdateWindow', 0
_szGetMessage db 'GetMessageA', 0
_szTranslateMessage db 'TranslateMessage', 0
_szDispatchMessage db 'DispatchMessageA', 0, 0
_szDllUser db 'User32.dll', 0
_RemoteThread proc uses ebx edi esi, lParam
local @hModule
call @F
@@:
pop ebx
sub ebx, offset @B ;
;<--------------------------------------------------------->
_invoke [ebx + _lpGetModuleHandle], NULL
mov [ebx + _hInstance], eax
lea eax, [ebx + offset _szDllUser]
_invoke [ebx + _lpGetModuleHandle], eax
mov @hModule, eax
lea esi, [ebx + offset _szDestroyWindow]
lea edi, [ebx + offset _lpDestroyWindow]
.while TRUE
_invoke [ebx + _lpGetProcAddress], @hModule, esi
mov [edi], eax
add edi, 4
@@:
lodsb
or al, al
jnz @B
.break .if ! byte ptr [esi + 1]
.endw
;<----------------------------------------------------------->
call _WinMain
ret
_RemoteThread endp