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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4160ff
mov eax, dword fs:[0]
push eax
sub esp, 0x94
mov eax, dword [0x41f008]
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 dword [ebp - 0xa0], ebx
mov eax, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
inc dword [0x420268]
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 byte [ebx + 0x64], 0
mov dword [ebx + 0x3f0], 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 byte [ebp - 4], 4
mov byte [ebx + 0x420], 0
mov eax, dword [0x420280]
sub eax, dword [0x42027c]
sar eax, 2
mov dword [ebx + 0x48], eax
mov eax, dword [0x420280]
mov dword [0x42026c], ebx
mov dword [ebp - 0x98], ebx
cmp dword [0x420284], eax
je 0x40239f
mov dword [eax], ebx
add dword [0x420280], 4
jmp 0x4023ac
lea ecx, [ebp - 0x98]
push ecx
push eax
call fcn.00404e40
push esi
lea ecx, [ebx + 0x20]
call fcn.00401970
test al, al
je 0x4024f5
push esi
lea eax, [ebp - 0x90]
push 0x40
push eax
call fcn.004096e4
push 0x41c970
lea eax, [ebp - 0x90]
push 0x40
push eax
call fcn.00409748
add esp, 0x18
mov ecx, ebx
push 0x41c978
push esi
call fcn.004017b0
test al, al
je 0x4024f5
push 0x41c980
push esi
lea ecx, [ebx + 8]
call fcn.004017b0
test al, al
je 0x4024f5
push 0x41c988
push esi
lea ecx, [ebx + 0x10]
call fcn.004017b0
test al, al
je 0x4024f5
push dword [ebx + 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
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 0x4024f5
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 esi
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 + 0x41c]
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 + 0x41c], eax
lea eax, [ebp - 0x94]
push eax
push 0
push ebx
push 0x403810
push 0
push 0
mov dword [ebp - 0x94], 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov ecx, dword [ebx + 0x40]
mov edx, dword [0x420278]
add ecx, 0x8324
mov dword [ebx + 0x418], 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 0x40251e
push 0
push 0x41ca24
push str.Could_not_connect_to_OpenMPT.
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov ecx, ebx
call fcn.00402540
push 0x424
push ebx
call fcn.00405c44
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.00405848
mov esp, ebp
pop ebp
ret 8