Function at 0x408340
Capabilities:
Link many functions at runtime

Disassembly:
sub esp, 0x470
mov eax, dword [esp + 0x50c]
mov dword [esp + 4], ecx
test eax, eax
je 0x40835b
mov dword [eax], 0
mov eax, dword [esp + 0x474]
push ebx
push ebp
push esi
test eax, eax
push edi
je 0x408479
cmp byte [eax], 0
je 0x408479
push 0x43c764
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
push 0x43c748
push esi
call edi
push 0x43c738
push esi
mov dword [esp + 0x2c], eax
call edi
push 0x43c728
push esi
mov ebx, eax
call edi
mov ebp, eax
push 0x43c718
push esi
mov dword [esp + 0x30], ebp
call edi
push 0x43c708
push esi
mov dword [esp + 0x28], eax
call edi
xor edx, edx
mov dword [esp + 0x2c], eax
cmp ebp, edx
je 0x408479
cmp ebx, edx
je 0x408479
cmp dword [esp + 0x20], edx
je 0x408479
cmp eax, edx
je 0x408479
mov ebp, dword [esp + 0x24]
cmp ebp, edx
je 0x408479
mov esi, dword [esp + 0x498]
mov ecx, 0x4a
xor eax, eax
lea edi, [esp + 0x30]
rep stosd dword es:[edi], eax
cmp esi, 2
mov dword [esp + 0x1c], edx
mov dword [esp + 0x30], 0x128
mov dword [esp + 0x18], edx
jne 0x408451
mov eax, dword [esp + 0x48c]
cmp eax, 5
ja 0x408437
jne 0x408451
cmp dword [esp + 0x490], 1
jb 0x408451
mov ecx, dword [esp + 0x14]
push 1
push 0x43c6f4
mov dword [esp + 0x20], 1
call fcn.00409030
xor edx, edx
push edx
push 2
mov dword [esp + 0x18], edx
call ebp
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x408488
mov eax, dword [esp + 0x18]
test eax, eax
je 0x408479
mov ecx, dword [esp + 0x14]
push 0
push 0x43c6f4
call fcn.00409030
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x470
ret 0x9c
cmp esi, 2
jne 0x408582
mov al, byte [0x440950]
mov ecx, 0x40
mov byte [esp + 0x158], al
xor eax, eax
lea edi, [esp + 0x159]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, dword [esp + 0x484]
lea ecx, [esp + 0x158]
push ecx
mov ecx, dword [esp + 0x18]
push edi
call fcn.00408670
lea edx, [esp + 0x30]
push edx
push ebp
call ebx
test eax, eax
je 0x4085d1
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
lea eax, [esp + 0x158]
lea ecx, [esp + 0x54]
push eax
push ecx
call ebx
test eax, eax
jne 0x40856e
mov edx, dword [esp + 0x38]
mov dword [esp + 0x25c], 0x224
push edx
push 8
call dword [esp + 0x2c]
mov esi, eax
cmp esi, 0xffffffff
je 0x40856e
lea eax, [esp + 0x25c]
push eax
push esi
call dword [esp + 0x28]
test eax, eax
je 0x40855f
lea ecx, [esp + 0x37c]
push edi
push ecx
call ebx
test eax, eax
je 0x40854f
lea edx, [esp + 0x25c]
push edx
push esi
call dword [esp + 0x34]
test eax, eax
je 0x40855f
lea eax, [esp + 0x37c]
push edi
push eax
call ebx
test eax, eax
jne 0x40852f
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x10], 1
mov dword [esp + 0x1c], ecx
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x4085d1
lea edx, [esp + 0x30]
push edx
push ebp
call dword [esp + 0x30]
test eax, eax
jne 0x4084df
jmp 0x4085d1
lea eax, [esp + 0x30]
push eax
push ebp
call ebx
test eax, eax
je 0x4085d1
mov edi, dword [esp + 0x484]
mov esi, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
lea ecx, [esp + 0x54]
push edi
push ecx
call esi
test eax, eax
je 0x4085c1
lea edx, [esp + 0x30]
push edx
push ebp
call dword [esp + 0x30]
test eax, eax
je 0x4085d1
lea eax, [esp + 0x54]
push edi
push eax
call esi
test eax, eax
jne 0x4085a7
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x10], 1
mov dword [esp + 0x1c], ecx
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x18]
test eax, eax
je 0x4085f0
mov ecx, dword [esp + 0x14]
push 0
push 0x43c6f4
call fcn.00409030
mov eax, dword [esp + 0x10]
test eax, eax
je 0x408479
mov eax, dword [esp + 0x51c]
test eax, eax
je 0x40860d
mov edx, dword [esp + 0x1c]
mov dword [eax], edx
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x470
ret 0x9c