Function at 0x405371
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x40b6b0
mov eax, dword fs:[0]
push eax
sub esp, 0x8b0
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x8a8], eax
push ebx
push esi
push edi
mov eax, dword [section..data]
xor eax, esp
push eax
lea eax, [esp + 0x8c0]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov edi, ecx
xor ebx, ebx
lea ecx, [esp + 0x14]
mov dword [esp + 0x20], edi
mov dword [esp + 0x28], eax
mov dword [esp + 0x38], ebx
call fcn.00409f64
push 0x82b6
lea ecx, [esp + 0x18]
mov dword [esp + 0x8cc], ebx
call fcn.00409f70
push 0xcb20
call fcn.0040a71e
cmp eax, ebx
pop ecx
mov dword [esp + 0x30], eax
jne 0x40542e
or dword [esp + 0x8c8], 0xffffffff
lea ecx, [esp + 0x14]
call fcn.00409f6a
xor eax, eax
mov esi, 0x6590
push esi
push ebx
push eax
call fcn.0040b01c
push 0x208
lea eax, [esp + 0x6bc]
push ebx
push eax
call fcn.0040b01c
mov eax, dword [edi + 0x20]
add esp, 0x18
mov dword [esp + 0x3c], 0x58
mov dword [esp + 0x40], eax
call fcn.00409d72
mov eax, dword [eax + 8]
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 0x58], eax
mov dword [esp + 0x5c], esi
lea eax, [esp + 0x6ac]
mov esi, 0x104
lea ecx, [esp + 0x14]
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x50], ebx
mov dword [esp + 0x54], ebx
mov dword [esp + 0x60], eax
mov dword [esp + 0x64], esi
mov dword [esp + 0x68], ebx
call fcn.0040a348
push esi
mov dword [esp + 0x70], eax
lea eax, [esp + 0x2a0]
push eax
push 0x82ce
push dword [esp + 0x50]
mov dword [esp + 0x80], 0x81a04
mov dword [esp + 0x88], ebx
mov dword [esp + 0x94], ebx
mov dword [esp + 0x90], ebx
call dword [0x401544]
cmp word [esp + 0x29c], bx
mov word [esp + 0x4a2], bx
lea eax, [esp + 0x29c]
je 0x40550a
cmp word [eax], 1
jne 0x405503
mov word [eax], bx
inc eax
inc eax
cmp word [eax], bx
jne 0x4054fa
lea eax, [esp + 0x29c]
mov dword [esp + 0x48], eax
lea eax, [esp + 0x3c]
push eax
call dword [0x401020]
test eax, eax
je 0x405773
mov eax, edi
call fcn.00405bff
push eax
push edi
mov dword [esp + 0x2c], eax
call fcn.004040cc
cmp eax, ebx
mov dword [esp + 0x34], eax
je 0x4057cb
mov eax, dword [esp + 0x24]
mov dword [esp + 0x18], eax
mov edi, 0x7ffffffe
push edi
mov eax, 0x402444
mov edx, esi
lea ecx, [esp + 0x98]
call fcn.00403e54
cmp eax, ebx
jl 0x4053f5
cmp dword [esp + 0x24], ebx
je 0x405615
push dword [esp + 0x18]
mov ecx, dword [esp + 0x24]
call fcn.00409fb2
cmp eax, dword [esp + 0x34]
je 0x4055fc
push edi
lea eax, [esp + 0x98]
mov edx, esi
lea ecx, [esp + 0x4a8]
call fcn.00403e54
cmp eax, ebx
jl 0x4053f5
push dword [esp + 0x18]
mov ecx, dword [esp + 0x24]
lea eax, [esp + 0x30]
push eax
call fcn.00409fee
mov eax, dword [eax]
lea ecx, [esp + 0x4a4]
push ecx
push eax
push 0x402424
mov ecx, esi
lea edi, [esp + 0xa0]
call fcn.00403db2
add esp, 0xc
test eax, eax
lea ecx, [esp + 0x2c]
setl byte [esp + 0x1f]
call fcn.00409f6a
cmp byte [esp + 0x1f], bl
jne 0x4053f5
mov edi, 0x7ffffffe
push dword [esp + 0x18]
mov eax, dword [esp + 0x24]
call fcn.00405be5
cmp eax, ebx
mov dword [esp + 0x18], eax
jne 0x405579
cmp dword [esp + 0x28], ebx
je 0x405668
push edi
lea eax, [esp + 0x98]
mov edx, esi
lea ecx, [esp + 0x4a8]
call fcn.00403e54
cmp eax, ebx
jl 0x4053f5
push dword [esp + 0x28]
lea eax, [esp + 0x4a8]
push eax
push 0x40245c
mov ecx, esi
lea edi, [esp + 0xa0]
call fcn.00403db2
add esp, 0xc
test eax, eax
jl 0x4053f5
mov edi, 0x7ffffffe
movzx eax, word [esp + 0x74]
xor ecx, ecx
push 2
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0040a71e
mov esi, eax
cmp esi, ebx
pop ecx
mov dword [esp + 0x2c], esi
je 0x4057cb
movzx edx, word [esp + 0x74]
cmp edx, ebx
lea eax, [edx - 1]
je 0x4056bd
cmp edx, 0x7fffffff
ja 0x4056bd
cmp eax, edi
jbe 0x4056ad
mov word [esi], bx
jmp 0x4056bd
push eax
mov eax, dword [esp + 0x5c]
mov ecx, esi
call fcn.00403e54
cmp eax, ebx
jge 0x4056d5
movzx eax, word [esp + 0x74]
mov word [esi + eax*2 - 2], bx
xor eax, eax
cmp word [esp + 0x6ac], bx
push 0x80
sete al
mov edi, eax
call fcn.00409d84
pop ecx
mov dword [esp + 0x28], eax
cmp eax, ebx
mov byte [esp + 0x8c8], 1
je 0x405734
push dword [esp + 0x20]
movzx ecx, word [esp + 0x78]
mov edx, dword [esp + 0x5c]
push edi
lea ecx, [edx + ecx*2]
push ecx
lea ecx, [esp + 0xa0]
push ecx
push esi
push dword [esp + 0x48]
mov esi, eax
push ebx
call fcn.00409111
mov esi, eax
jmp 0x405736
xor esi, esi
cmp esi, ebx
mov byte [esp + 0x8c8], bl
je 0x405767
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0xc0]
push dword [esp + 0x24]
mov edi, dword [esp + 0x24]
call fcn.00404c5a
mov edx, dword [esi]
xor eax, eax
inc eax
push eax
mov ecx, esi
mov dword [esp + 0x3c], eax
call dword [edx + 4]
push dword [esp + 0x2c]
call fcn.0040a724
pop ecx
jmp 0x4057cb
call dword [0x40101c]
mov esi, eax
cmp esi, ebx
je 0x4057cb
lea ecx, [esp + 0x18]
call fcn.00409f64
cmp esi, 0x3003
mov byte [esp + 0x8c8], 2
lea ecx, [esp + 0x18]
je 0x4057a3
push 0x3fb
jmp 0x4057a8
push 0x3fa
call fcn.00409f70
push 0x10
push ebx
push dword [esp + 0x20]
mov ecx, edi
call fcn.0040a336