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

Disassembly:
mov ecx, dword fs:[0x14]
mov ecx, dword [ecx]
lea eax, [esp - 4]
cmp eax, dword [ecx + 8]
jbe 0x520641
sub esp, 0x84
lea ecx, [esp + 4]
mov dword [esp + 0x58], ecx
mov ebx, dword [esp + 0x88]
mov ebp, dword [ebx + 0x26c]
mov dword [esp + 0x2c], ebp
mov esi, dword [ebx + 0x268]
mov dword [esp + 0x4c], esi
mov eax, ecx
mov ecx, dword [ebx + 0x270]
mov dword [esp + 0x30], ecx
lea edi, [ebx + 0x268]
mov dword [esp + 0x54], edi
xor edx, edx
jmp 0x5203fa
lea edi, [esp + 0x5c]
xor eax, eax
call fcn.0045a35b
mov ecx, dword [esp + 0x4c]
mov dword [esp + 0x64], ecx
mov edx, dword [esp + 0x2c]
mov dword [esp + 0x68], edx
mov ebx, dword [esp + 0x30]
mov dword [esp + 0x6c], ebx
mov ebp, dword [esp + 0x88]
mov dword [esp], ebp
mov edi, dword [esp + 0x58]
lea esi, [esp + 0x5c]
call fcn.0045a83e
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x18], ecx
mov ebx, dword [esp + 0x44]
mov ebp, dword [esp + 0x48]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebp
call fcn.0051e610
movzx ecx, byte [esp + 0x45]
mov edx, dword [esp + 0x28]
add edx, ecx
mov eax, dword [esp + 0x58]
mov ecx, dword [esp + 0x30]
mov ebx, dword [esp + 0x88]
mov ebp, dword [esp + 0x2c]
mov esi, dword [esp + 0x4c]
mov edi, dword [esp + 0x54]
cmp edx, ebp
jge 0x5205b3
mov dword [esp + 0x28], edx
mov ebx, dword [ebx + 0x190]
mov edi, esp
xor eax, eax
call fcn.0045a35b
mov dword [esp + 8], esi
mov dword [esp + 0xc], ebp
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], edx
mov ecx, dword [ebx]
mov edx, ebx
call ecx
mov ecx, dword [esp + 0x18]
mov ebx, dword [esp + 0x1c]
mov dword [esp + 0x44], ecx
mov dword [esp + 0x48], ebx
mov ecx, dword [esp + 0x44]
mov ebx, dword [esp + 0x48]
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x40], ebx
movzx ecx, byte [esp + 0x3e]
test cl, cl
jne 0x5205ac
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x48]
mov dword [esp + 0x34], ecx
mov dword [esp + 0x38], edx
movzx ecx, byte [esp + 0x39]
test cl, 8
sete cl
test cl, cl
je 0x52037d
mov eax, dword [esp + 0x88]
mov dword [esp], eax
call fcn.0051f1d0
mov eax, dword [esp + 0x88]
mov dword [esp], eax
lea ecx, [eax + 0x1d4]
mov dword [esp + 0x50], ecx
mov dword [esp + 4], ecx
mov dword [esp + 8], pe_nt_image_headers32
mov dword [esp + 0xc], pe_nt_image_headers32
call fcn.0051e260
mov ecx, dword [esp + 0x10]
cmp ecx, 0x80
ja 0x520636
mov dword [esp + 0x24], ecx
lea edi, [esp + 0x70]
xor eax, eax
call fcn.0045a35b
mov ecx, dword [esp + 0x4c]
mov dword [esp + 0x78], ecx
mov edx, dword [esp + 0x2c]
mov dword [esp + 0x7c], edx
mov ebx, dword [esp + 0x30]
mov dword [esp + 0x80], ebx
mov ebp, dword [esp + 0x88]
mov dword [esp], ebp
mov edi, dword [esp + 0x58]
lea esi, [esp + 0x70]
call fcn.0045a83e
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x18], ecx
mov ebx, dword [esp + 0x44]
mov ebp, dword [esp + 0x48]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebp
call fcn.0051e610
movzx ecx, byte [esp + 0x45]
mov edx, dword [esp + 0x28]
lea eax, [ecx + edx]
mov ecx, dword [esp + 0x2c]
cmp eax, ecx
ja 0x520631
sub ecx, eax
mov edx, dword [esp + 0x88]
mov dword [edx + 0x26c], ecx
mov ecx, dword [esp + 0x30]
sub ecx, eax
mov dword [edx + 0x270], ecx
mov ebx, dword [0x795b00]
neg ecx
sar ecx, 0x1f
and eax, ecx
mov ecx, dword [esp + 0x4c]
add eax, ecx
test ebx, ebx
jne 0x5205a1
mov dword [edx + 0x268], eax
mov eax, dword [esp + 0x50]
mov dword [esp + 0x8c], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x90], eax
mov dword [esp + 0x94], pe_nt_image_headers32
add esp, 0x84
ret
mov edi, dword [esp + 0x54]
call fcn.0045a0f0
jmp 0x520579
xor ecx, ecx
jmp 0x520477
mov dword [ebx + 0x26c], 0
mov dword [ebx + 0x270], 0
mov ecx, dword [0x795b00]
test ecx, ecx
jne 0x520617
mov dword [ebx + 0x268], 0
lea eax, [0x59ccd0]
mov dword [ebx + 0x25c], eax
mov dword [esp], ebx
call fcn.00522470
mov eax, dword [esp + 4]
mov ecx, dword [esp + 8]
mov edx, dword [esp + 0xc]
mov dword [esp + 0x8c], eax
mov dword [esp + 0x90], ecx
mov dword [esp + 0x94], edx
add esp, 0x84
ret
xor eax, eax
call fcn.0045a0f0
lea edi, [ebx + 0x25c]
lea eax, [0x59ccd0]
call fcn.0045a0f0
jmp 0x5205e7
call fcn.0045a1d0
mov edx, pe_nt_image_headers32
call fcn.0045a190
nop
call fcn.00458ba0
jmp fcn.00520320