Function at 0x402440
Capabilities:
Access peb ldr_data
Create thread
Get ntdll base address

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x418cb4
mov eax, dword fs:[0]
push eax
sub esp, 0x94
mov eax, dword [0x421040]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [ebp - 0x94], ebx
mov eax, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
mov dword [ebp - 0xa0], ebx
inc dword [0x4223a8]
mov dword [ebx], 0
mov dword [ebx + 4], 0
mov dword [ebx + 8], 0
mov dword [ebx + 0xc], 0
mov dword [ebx + 0x10], 0
mov dword [ebx + 0x14], 0
mov dword [ebx + 0x18], 0
mov dword [ebx + 0x1c], 0
mov dword [ebx + 0x20], 0
mov dword [ebx + 0x24], 0
mov dword [ebx + 0x28], 0
mov dword [ebx + 0x2c], 0
mov dword [ebx + 0x30], 0
mov dword [ebx + 0x34], 0
mov dword [ebx + 0x38], 0
mov dword [ebx + 0x3c], 0
mov dword [ebp - 0x9c], eax
mov dword [ebx + 0x40], 0
mov dword [ebx + 0x44], 0
mov dword [ebx + 0x48], 0
mov dword [ebx + 0x4c], 0
mov dword [ebp - 4], 0
mov dword [ebx + 0x50], 0
mov dword [ebx + 0x54], 0
mov dword [ebx + 0x58], 0
mov dword [ebx + 0x5c], 0
mov dword [ebx + 0x60], 0
mov dword [ebx + 0x64], 0
mov byte [ebx + 0x68], 0
mov dword [ebx + 0x3f4], 0
mov dword [ebx + 0x3f8], 0
mov dword [ebx + 0x3fc], 0
mov dword [ebx + 0x400], 0
mov dword [ebx + 0x404], 0
mov dword [ebx + 0x408], 0
mov dword [ebx + 0x40c], 0
mov dword [ebx + 0x410], 0
mov dword [ebx + 0x414], 0
mov dword [ebx + 0x418], 0
mov dword [ebx + 0x41c], 0
mov dword [ebx + 0x420], 0
mov byte [ebp - 4], 4
mov byte [ebx + 0x424], 0
mov eax, dword [0x4223c0]
sub eax, dword [0x4223bc]
sar eax, 2
mov dword [ebx + 0x48], eax
mov eax, dword [0x4223c0]
mov dword [0x4223ac], ebx
mov dword [ebp - 0x98], ebx
cmp eax, dword [0x4223c4]
je 0x402606
mov dword [eax], ebx
add dword [0x4223c0], 4
jmp 0x402613
lea ecx, [ebp - 0x98]
push ecx
push eax
call fcn.004058b0
cmp dword [ebx + 0x20], 0
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
je 0x402640
mov eax, dword [ebx + 0x24]
test eax, eax
je 0x402634
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov dword [ebx + 0x24], 0
push dword [ebx + 0x20]
call edi
mov dword [ebx + 0x20], 0
push esi
push 0
push 0xf001f
call dword [sym.imp.KERNEL32.dll_OpenFileMappingW]
mov dword [ebx + 0x20], eax
test eax, eax
je 0x4027a8
push 0
push 0
push 0
push 0xf001f
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebx + 0x24], eax
test eax, eax
je 0x4027a8
push esi
lea eax, [ebp - 0x90]
push 0x40
push eax
call fcn.004098b7
push 0x41ed78
lea eax, [ebp - 0x90]
push 0x40
push eax
call fcn.0040991b
add esp, 0x18
mov ecx, ebx
push 0x41ed80
push esi
call fcn.004019f0
test al, al
je 0x4027a8
push 0x41ed88
push esi
lea ecx, [ebx + 8]
call fcn.004019f0
test al, al
je 0x4027a8
push 0x41ed90
push esi
lea ecx, [ebx + 0x10]
call fcn.004019f0
test al, al
je 0x4027a8
push dword [ebx + 0x18]
call edi
lea eax, [ebp - 0x90]
push eax
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebx + 0x18], eax
test eax, eax
je 0x4027a8
mov ecx, dword [ebx + 0x24]
lea eax, [ecx + 4]
neg ecx
sbb ecx, ecx
and ecx, eax
mov dword [ebx + 0x40], ecx
push dword [ebx + 0x1c]
call edi
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
call esi
mov edi, eax
call esi
push 2
push 0
push 0
lea ecx, [ebx + 0x1c]
push ecx
push edi
push dword [ebp - 0x9c]
push eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
push dword [ebx + 0x420]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebx + 0x420], eax
lea eax, [ebp - 0x94]
push eax
push 0
push ebx
push 0x403eb0
push 0
push 0
mov dword [ebp - 0x94], 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov ecx, dword [ebx + 0x40]
mov edx, dword [0x4223b8]
add ecx, 0x8324
mov dword [ebx + 0x41c], eax
xchg dword [ecx], edx
mov edx, dword [ebx + 0x40]
mov ecx, dword [ebx + 0x48]
mov dword [edx + 0x8328], ecx
push dword [ebx + 0x18]
call dword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x4027d1
push 0
push 0x41ee2c
push str.Could_not_connect_to_OpenMPT.
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov ecx, ebx
call fcn.00402800
push 0x428
push ebx
call fcn.004062f6
add esp, 8
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00405f3f
mov esp, ebp
pop ebp
ret 8