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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x74
push ebx
mov ebx, dword [ebp + 0xc]
lea eax, [esp + 0x14]
push esi
push edi
mov edi, edx
mov dword [esp + 0x1c], 0
mov esi, ecx
mov dword [esp + 0x34], edi
lea edx, [esp + 0x20]
mov dword [esp + 0x30], esi
mov ecx, ebx
mov dword [esp + 0x20], 1
mov dword [esp + 0x24], 1
mov dword [esp + 0x28], eax
call fcn.004044e0
test eax, eax
jne 0x405096
mov eax, 0xfffffff4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, ebx
mov dword [esp + 0x38], 1
mov ebx, dword [ebp + 8]
mov ecx, ebx
mov dword [esp + 0x3c], 0
mov dword [esp + 0x40], 0
mov dword [esp + 0x44], 1
mov dword [esp + 0x48], 0
mov dword [esp + 0x4c], 0
mov dword [esp + 0x5c], 1
mov dword [esp + 0x60], 0
mov dword [esp + 0x64], 0
mov dword [esp + 0x50], 1
mov dword [esp + 0x54], 0
mov dword [esp + 0x58], 0
mov dword [esp + 0x68], 1
mov dword [esp + 0x6c], 0
mov dword [esp + 0x70], 0
call fcn.00404450
test eax, eax
jns 0x405155
test esi, esi
je 0x405135
xor edx, edx
mov ecx, esi
call fcn.00403ce0
mov esi, eax
test esi, esi
jne 0x40554c
test edi, edi
je 0x40514c
mov edx, ebx
mov ecx, edi
call fcn.00403940
mov esi, eax
test esi, esi
jne 0x40554c
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, ebx
lea ecx, [esp + 0x38]
call fcn.00403940
mov esi, eax
test esi, esi
jne 0x40554c
mov edx, dword [ebp + 0xc]
lea ecx, [esp + 0x44]
call fcn.00403940
mov esi, eax
test esi, esi
jne 0x40554c
mov edx, dword [ebx + 4]
add edx, 2
mov dword [esp + 0x44], 1
mov dword [esp + 0x38], 1
cmp edx, 0x2710
jbe 0x4051a6
lea esi, [eax - 0x10]
jmp 0x40554c
lea ecx, [esp + 0x5c]
call fcn.00403810
mov esi, eax
test esi, esi
jne 0x40554c
xor edx, edx
lea ecx, [esp + 0x5c]
call fcn.00403ce0
mov esi, eax
test esi, esi
jne 0x40554c
lea edx, [eax + 2]
lea ecx, [esp + 0x50]
call fcn.00403810
mov esi, eax
test esi, esi
jne 0x40554c
lea edx, [eax + 3]
lea ecx, [esp + 0x68]
call fcn.00403810
mov esi, eax
test esi, esi
jne 0x40554c
lea eax, [esp + 0x44]
push eax
call fcn.00403dd0
and eax, 0x1f
add esp, 4
cmp eax, 0x1f
jae 0x405246
mov ebx, 0x1f
lea ecx, [esp + 0x38]
sub ebx, eax
mov edx, ebx
mov dword [esp + 0x1c], ebx
call fcn.00404220
mov esi, eax
test esi, esi
jne 0x40554c
mov edx, ebx
lea ecx, [esp + 0x44]
call fcn.00404220
mov esi, eax
test esi, esi
jne 0x40554c
jmp 0x40524e
mov dword [esp + 0x1c], 0
mov ebx, dword [esp + 0x3c]
lea ecx, [esp + 0x44]
mov eax, dword [esp + 0x48]
dec ebx
dec eax
mov edi, ebx
sub edi, eax
mov dword [esp + 0x14], eax
mov eax, edi
shl eax, 5
mov edx, eax
mov dword [esp + 0x10], eax
call fcn.00404220
mov esi, eax
test esi, esi
jne 0x40554c
lea edx, [esp + 0x44]
lea ecx, [esp + 0x38]
call fcn.004044e0
test eax, eax
js 0x4052c5
nop
mov eax, dword [esp + 0x64]
lea edx, [esp + 0x38]
mov ecx, edx
inc dword [eax + edi*4]
lea eax, [esp + 0x44]
push eax
call fcn.00404970
mov esi, eax
add esp, 4
test esi, esi
jne 0x40554c
lea edx, [esp + 0x44]
lea ecx, [esp + 0x38]
call fcn.004044e0
test eax, eax
jns 0x405290
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x44]
call fcn.00404370
mov esi, eax
test esi, esi
jne 0x40554c
mov ecx, dword [esp + 0x14]
cmp ebx, ecx
jbe 0x4054dc
mov eax, dword [esp + 0x4c]
lea ecx, [eax + ecx*4]
mov eax, dword [esp + 0x10]
add eax, 0xffffffe0
mov dword [esp + 0x18], ecx
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x64]
sub eax, 4
lea edi, [eax + edi*4]
nop dword [eax + eax]
mov eax, dword [esp + 0x40]
mov edx, dword [ecx]
mov esi, dword [eax + ebx*4]
cmp esi, edx
jb 0x405325
mov dword [edi], 0xffffffff
jmp 0x405355
test edx, edx
je 0x405350
cmp esi, edx
jae 0x405350
mov ecx, dword [eax + ebx*4 - 4]
xor eax, eax
push 0
push edx
or eax, esi
push eax
push ecx
call fcn.0050c810
test edx, edx
jne 0x405348
cmp eax, 0xffffffff
jbe 0x405353
mov dword [esp + 0x24], 0
or eax, 0xffffffff
mov dword [edi], eax
inc dword [edi]
dec dword [edi]
lea ecx, [esp + 0x50]
xor edx, edx
call fcn.00403ce0
mov esi, eax
test esi, esi
jne 0x40554c
cmp dword [esp + 0x14], 1
jb 0x40537c
mov eax, dword [esp + 0x18]
mov eax, dword [eax - 4]
mov ecx, dword [esp + 0x58]
lea edx, [esp + 0x50]
mov dword [esp + 0x74], 1
mov dword [esp + 0x78], 1
mov dword [ecx], eax
mov eax, dword [esp + 0x18]
mov eax, dword [eax]
mov dword [ecx + 4], eax
lea eax, [esp + 0x20]
mov dword [esp + 0x7c], eax
mov ecx, edx
mov eax, dword [edi]
mov dword [esp + 0x20], eax
lea eax, [esp + 0x74]
push eax
call fcn.00404d90
mov esi, eax
add esp, 4
test esi, esi
jne 0x40554c
xor edx, edx
lea ecx, [esp + 0x68]
call fcn.00403ce0
mov esi, eax
test esi, esi
jne 0x40554c
mov edx, dword [esp + 0x40]
cmp ebx, 2
jb 0x4053e8
mov eax, dword [edx + ebx*4 - 8]
mov ecx, dword [esp + 0x70]
mov dword [ecx], eax
cmp ebx, 1
jae 0x4053f7
xor eax, eax
jmp 0x4053fb
mov eax, dword [edx + ebx*4 - 4]
mov dword [ecx + 4], eax
mov eax, dword [edx + ebx*4]
lea edx, [esp + 0x68]
mov dword [ecx + 8], eax
lea ecx, [esp + 0x50]
call fcn.004044e0
test eax, eax
jg 0x405357
push dword [edi]
lea edx, [esp + 0x48]
lea ecx, [esp + 0x54]
call fcn.00405010
mov esi, eax
add esp, 4
test esi, esi
jne 0x40554c
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x50]
call fcn.00404220
mov esi, eax
test esi, esi
jne 0x40554c
lea eax, [esp + 0x50]
lea edx, [esp + 0x38]
push eax
mov ecx, edx
call fcn.00404970
mov esi, eax
add esp, 4
test esi, esi
jne 0x40554c
xor edx, edx
lea ecx, [esp + 0x38]
call fcn.004045a0
test eax, eax
jns 0x4054c5
lea edx, [esp + 0x44]
lea ecx, [esp + 0x50]
call fcn.00403940
mov esi, eax
test esi, esi
jne 0x40554c
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x50]
call fcn.00404220
mov esi, eax
test esi, esi
jne 0x40554c
lea eax, [esp + 0x50]
lea edx, [esp + 0x38]
push eax
mov ecx, edx
call fcn.00404900
mov esi, eax
add esp, 4
test esi, esi
jne 0x40554c
dec dword [edi]
sub dword [esp + 0x10], 0x20
dec ebx
mov ecx, dword [esp + 0x18]
sub edi, 4
cmp ebx, dword [esp + 0x14]
ja 0x405310
mov ebx, dword [esp + 0x30]
test ebx, ebx
je 0x405504
lea edx, [esp + 0x5c]
mov ecx, ebx
call fcn.00403940
mov esi, eax
test esi, esi
jne 0x40554c
mov edi, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
mov eax, dword [edi]
imul eax, dword [ecx]
mov dword [ebx], eax
jmp 0x405507
mov edi, dword [ebp + 8]
mov ebx, dword [esp + 0x34]
test ebx, ebx
je 0x40554c
mov edx, dword [esp + 0x1c]
lea ecx, [esp + 0x38]
call fcn.00404370
mov esi, eax
test esi, esi
jne 0x40554c
mov eax, dword [edi]
lea edx, [esp + 0x38]
mov ecx, ebx
mov dword [esp + 0x38], eax
call fcn.00403940
mov esi, eax
test esi, esi
jne 0x40554c
xor edx, edx
mov ecx, ebx
call fcn.004045a0
test eax, eax
jne 0x40554c
mov dword [ebx], 1
lea ecx, [esp + 0x38]
call fcn.004037c0
lea ecx, [esp + 0x44]
call fcn.004037c0
lea ecx, [esp + 0x5c]
call fcn.004037c0
lea ecx, [esp + 0x50]
call fcn.004037c0
lea ecx, [esp + 0x68]
call fcn.004037c0
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret