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

Disassembly:
sub esp, 0x70
mov eax, dword [0x464380]
xor eax, esp
mov dword [esp + 0x6c], eax
mov eax, dword [esp + 0x78]
push ebx
push ebp
mov ebp, dword [esp + 0x7c]
push esi
mov dword [esp + 0x20], eax
xor eax, eax
push edi
mov ebx, ecx
lea esi, [esp + 0x54]
mov edi, ebp
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x34], eax
mov dword [esp + 0x14], eax
call fcn.00401f50
xor edi, edi
cmp eax, edi
jne 0x402ae2
mov eax, dword [esp + 0x58]
cmp eax, edi
ja 0x402583
mov esi, dword [esp + 0x54]
cmp esi, 0x80000000
jae 0x402583
cmp eax, edi
ja 0x402583
cmp esi, 0x4000000
jb 0x40259b
pop edi
pop esi
pop ebp
mov eax, 4
pop ebx
mov ecx, dword [esp + 0x6c]
xor ecx, esp
call fcn.00413385
add esp, 0x70
ret
cmp esi, 0x20
ja 0x402583
cmp esi, edi
mov dword [ebx + 0x10], esi
jne 0x402674
mov dword [ebx], edi
cmp esi, edi
jbe 0x4025c8
xor ecx, ecx
mov edx, esi
mov eax, dword [ebx]
lea eax, [ecx + eax + 0x10]
add ecx, 0x18
sub edx, 1
mov dword [eax], edi
mov dword [eax + 4], edi
jne 0x4025b5
cmp esi, edi
mov dword [esp + 0x18], edi
jbe 0x402583
mov dword [esp + 0x38], edi
mov ebx, dword [ebx]
add ebx, dword [esp + 0x38]
mov ecx, dword [ebp + 4]
cmp ecx, edi
mov dword [esp + 0x20], ebx
je 0x402933
mov eax, dword [ebp]
add ecx, 0xffffffff
mov dword [ebp + 4], ecx
movzx edx, byte [eax]
add eax, 1
mov byte [esp + 0x13], dl
and edx, 0xf
mov dword [ebp], eax
mov edi, edx
mov esi, 0
jbe 0x402631
jmp 0x402610
test ecx, ecx
je 0x402933
sub ecx, 1
mov dword [ebp + 4], ecx
mov dl, byte [eax]
mov byte [esp + esi + 0x6c], dl
add eax, 1
add esi, 1
cmp esi, edi
mov dword [ebp], eax
jb 0x402610
cmp edi, 8
ja 0x402583
xor eax, eax
cmp edi, eax
mov dword [ebx + 8], eax
mov dword [ebx + 0xc], eax
jbe 0x4026ac
lea esi, [esp + edi + 0x6b]
mov dword [esp + 0x28], edi
mov edi, dword [esp + 0x20]
xor ebx, ebx
movzx eax, byte [esi]
cdq
mov ecx, ebx
call fcn.00413420
or dword [edi + 8], eax
or dword [edi + 0xc], edx
sub esi, 1
add ebx, 8
sub dword [esp + 0x28], 1
jne 0x402654
jmp 0x4026b0
mov eax, dword [esp + 0x24]
mov edx, dword [eax]
lea ecx, [esi + esi*2]
add ecx, ecx
add ecx, ecx
add ecx, ecx
push ecx
push eax
call edx
add esp, 8
cmp eax, edi
mov dword [ebx], eax
jne 0x4025ad
pop edi
pop esi
pop ebp
mov eax, 2
pop ebx
mov ecx, dword [esp + 0x6c]
xor ecx, esp
call fcn.00413385
add esp, 0x70
ret
mov edi, dword [esp + 0x20]
test byte [esp + 0x13], 0x10
je 0x402760
lea esi, [esp + 0x5c]
mov edi, ebp
call fcn.00401f50
test eax, eax
jne 0x402ae2
mov ecx, dword [esp + 0x60]
test ecx, ecx
ja 0x402583
mov eax, dword [esp + 0x5c]
jb 0x4026eb
cmp eax, 0x80000000
jae 0x402583
test ecx, ecx
ja 0x402583
jb 0x402700
cmp eax, 0x4000000
jae 0x402583
mov ebx, dword [esp + 0x20]
lea esi, [esp + 0x64]
mov dword [ebx], eax
call fcn.00401f50
test eax, eax
jne 0x402ae2
mov ecx, dword [esp + 0x68]
test ecx, ecx
ja 0x402583
mov eax, dword [esp + 0x64]
jb 0x402734
cmp eax, 0x80000000
jae 0x402583
test ecx, ecx
ja 0x402583
jb 0x402749
cmp eax, 0x4000000
jae 0x402583
cmp dword [ebx], 0x20
mov dword [ebx + 4], eax
ja 0x402583
cmp eax, 0x20
ja 0x402583
jmp 0x402771
mov ebx, dword [esp + 0x20]
mov dword [edi], 1
mov dword [edi + 4], 1
test byte [esp + 0x13], 0x20
je 0x4027d4
xor eax, eax
lea esi, [esp + 0x4c]
mov edi, ebp
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
call fcn.00401f50
test eax, eax
jne 0x402ae2
mov esi, dword [esp + 0x4c]
xor edi, edi
cmp esi, edi
mov dword [ebx + 0x14], edi
jne 0x4027a7
mov dword [ebx + 0x10], edi
jmp 0x4027c2
mov eax, dword [esp + 0x24]
push esi
push eax
mov eax, dword [eax]
call eax
add esp, 8
cmp eax, edi
mov dword [ebx + 0x10], eax
je 0x402694
mov dword [ebx + 0x14], esi
mov edi, dword [ebx + 0x10]
mov eax, ebp
call fcn.00401ed0
test eax, eax
jne 0x402ae2
test byte [esp + 0x13], 0x80
je 0x402901
nop
mov eax, dword [ebp + 4]
test eax, eax
je 0x402933
lea ecx, [eax - 1]
mov eax, dword [ebp]
mov dword [ebp + 4], ecx
mov bl, byte [eax]
mov dl, bl
and dl, 0xf
lea esi, [eax + 1]
movzx eax, dl
cdq
xor edi, edi
cmp edx, edi
mov dword [ebp], esi
ja 0x402933
jb 0x402819
cmp eax, ecx
ja 0x402933
sub ecx, eax
add esi, eax
test bl, 0x10
mov dword [ebp + 4], ecx
mov dword [ebp], esi
je 0x4028b4
lea esi, [esp + 0x3c]
mov edi, ebp
call fcn.00401f50
test eax, eax
jne 0x402ae2
mov ecx, dword [esp + 0x40]
test ecx, ecx
ja 0x402583
mov eax, dword [esp + 0x3c]
jb 0x40285c
cmp eax, 0x80000000
jae 0x402583
test ecx, ecx
ja 0x402583
jb 0x402871
cmp eax, 0x4000000
jae 0x402583
lea esi, [esp + 0x2c]
call fcn.00401f50
test eax, eax
jne 0x402ae2
mov ecx, dword [esp + 0x30]
test ecx, ecx
ja 0x402583
mov eax, dword [esp + 0x2c]
jb 0x40289f
cmp eax, 0x80000000
jae 0x402583
test ecx, ecx
ja 0x402583
jb 0x4028b4
cmp eax, 0x4000000
jae 0x402583
test bl, 0x20
je 0x4028f5
xor eax, eax
lea esi, [esp + 0x44]
mov edi, ebp
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
call fcn.00401f50
test eax, eax
jne 0x402ae2
mov edx, dword [esp + 0x48]
mov eax, dword [ebp + 4]
xor ecx, ecx
cmp edx, ecx
ja 0x402933
mov ecx, dword [esp + 0x44]
jb 0x4028ed
cmp ecx, eax
ja 0x402933
sub eax, ecx
add dword [ebp], ecx
mov dword [ebp + 4], eax
test bl, bl
js 0x4027e0
mov ebx, dword [esp + 0x20]
mov eax, dword [ebx]
add dword [esp + 0x34], eax
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
add eax, dword [ebx + 4]
add dword [esp + 0x38], 0x18
add ecx, 1
cmp ecx, dword [esp + 0x54]
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ecx
jae 0x40294b
mov ebx, dword [esp + 0x1c]
xor edi, edi
jmp 0x4025d4
pop edi
pop esi
pop ebp
mov eax, 0x10
pop ebx
mov ecx, dword [esp + 0x6c]
xor ecx, esp
call fcn.00413385
add esp, 0x70
ret
xor ebx, ebx
cmp eax, ebx
je 0x402583
mov edi, dword [esp + 0x1c]
lea esi, [eax - 1]
cmp esi, ebx
mov dword [esp + 0x14], esi
mov dword [edi + 0x14], esi
jne 0x40296c
mov dword [edi + 4], ebx
jmp 0x40298b
mov eax, dword [esp + 0x24]
mov edx, dword [eax]
lea ecx, [esi*8]
push ecx
push eax
call edx
add esp, 8
cmp eax, ebx
mov dword [edi + 4], eax
je 0x402694
cmp esi, ebx
mov dword [esp + 0x18], ebx
jbe 0x402a50
jmp 0x4029a0
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax + 4]
mov edx, dword [esp + 0x18]
lea esi, [esp + 0x2c]
mov edi, ebp
lea ebx, [ecx + edx*8]
call fcn.00401f50
test eax, eax
jne 0x402ae2
mov ecx, dword [esp + 0x30]
test ecx, ecx
ja 0x402583
mov eax, dword [esp + 0x2c]
jb 0x4029de
cmp eax, 0x80000000
jae 0x402583
test ecx, ecx
ja 0x402583
jb 0x4029f3
cmp eax, 0x4000000
jae 0x402583
lea esi, [esp + 0x3c]
mov dword [ebx], eax
call fcn.00401f50
test eax, eax
jne 0x402ae2
mov ecx, dword [esp + 0x40]
test ecx, ecx
ja 0x402583
mov eax, dword [esp + 0x3c]
jb 0x402a23
cmp eax, 0x80000000
jae 0x402583
test ecx, ecx
ja 0x402583
jb 0x402a38
cmp eax, 0x4000000
jae 0x402583
mov dword [ebx + 4], eax
mov eax, dword [esp + 0x18]
add eax, 1
cmp eax, dword [esp + 0x14]
mov dword [esp + 0x18], eax
jb 0x4029a0
mov ebx, dword [esp + 0x34]
mov eax, dword [esp + 0x14]
cmp ebx, eax
jb 0x402583
mov edi, dword [esp + 0x1c]
mov esi, ebx
sub esi, eax
mov dword [esp + 0x28], esi
mov dword [edi + 0x18], esi
jne 0x402af5
mov dword [edi + 8], 0
xor ebx, ebx
test esi, esi
jbe 0x402ae0
mov edx, dword [esp + 0x1c]
mov eax, dword [edx + 8]
lea ecx, [eax + ebx*4]
lea esi, [esp + 0x2c]
mov edi, ebp
mov dword [esp + 0x14], ecx
call fcn.00401f50
test eax, eax
jne 0x402ae2
mov ecx, dword [esp + 0x30]
test ecx, ecx
ja 0x402583
mov eax, dword [esp + 0x2c]
jb 0x402abc
cmp eax, 0x80000000
jae 0x402583
test ecx, ecx
ja 0x402583
jb 0x402ad1
cmp eax, 0x4000000
jae 0x402583
mov edx, dword [esp + 0x14]
add ebx, 1
cmp ebx, dword [esp + 0x28]
mov dword [edx], eax
jb 0x402a82
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x6c]
xor ecx, esp
call fcn.00413385
add esp, 0x70
ret
lea eax, [esi*4]
push eax
mov eax, dword [esp + 0x28]
mov ecx, dword [eax]
push eax
call ecx
add esp, 8
test eax, eax
mov dword [edi + 8], eax
je 0x402694
cmp esi, 1
jne 0x402a7c
xor esi, esi
test ebx, ebx
jbe 0x402b4b
mov ebp, dword [edi + 0x14]
xor ecx, ecx
test ebp, ebp
jbe 0x402b4b
mov edx, dword [edi + 4]
nop
cmp dword [edx], esi
je 0x402b40
add ecx, 1
add edx, 8
cmp ecx, ebp
jb 0x402b30
jmp 0x402b4b
test ecx, ecx
jl 0x402b4b
add esi, 1
cmp esi, ebx
jb 0x402b26
cmp esi, ebx
je 0x402583
mov ecx, dword [esp + 0x7c]
pop edi
mov dword [eax], esi
pop esi
pop ebp
pop ebx
xor ecx, esp
xor eax, eax
call fcn.00413385
add esp, 0x70
ret