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

Disassembly:
mov ecx, dword fs:[0x14]
mov ecx, dword [ecx]
cmp esp, dword [ecx + 8]
jbe 0x5219dc
sub esp, 0x70
mov eax, dword [esp + 0x78]
test eax, eax
jne 0x521872
mov eax, dword [esp + 0x80]
xor ecx, ecx
xor edx, edx
xor ebx, ebx
xor ebp, ebp
xor esi, esi
test ecx, ecx
jne 0x521860
mov dword [esp + 0x44], ebx
mov dword [esp + 0x24], esi
mov ecx, dword [esp + 0x74]
mov edx, dword [ecx]
lea edi, [eax + ebp]
mov dword [esp + 0x1c], edi
mov esi, dword [edx + 8]
mov edx, dword [edx + 4]
lea ebx, [esi - 1]
test ebx, ebx
jl 0x521859
mov edx, dword [edx + esi*4 - 4]
cmp edx, 0x10000
jb 0x521852
shr edx, 0x10
mov esi, 0x10
cmp edx, 0x100
jb 0x52151a
shr edx, 8
add esi, 8
cmp edx, 0x100
jae 0x5219b4
shl ebx, 5
lea edi, [0xa3e500]
movzx edx, byte [edx + edi]
add edx, esi
add edx, ebx
lea ebx, [eax + ebp + 0xb]
lea esi, [edx + 7]
sar esi, 0x1f
shr esi, 0x1d
lea edx, [esi + edx + 7]
sar edx, 3
cmp edx, ebx
jl 0x521834
mov dword [esp + 0x34], eax
mov dword [esp + 0x2c], edx
mov dword [esp + 0x20], ebp
mov byte [esp + 0x60], 0
mov dword [esp + 0x64], 0
mov dword [esp + 0x68], 0
mov dword [esp + 0x6c], 0
lea eax, [esp + 0x60]
mov dword [esp], eax
mov eax, dword [esp + 0x88]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x8c]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x90]
mov dword [esp + 0xc], eax
call fcn.004edb60
mov eax, dword [esp + 0x10]
mov byte [esp + 0x50], 0
mov dword [esp + 0x54], 0
mov dword [esp + 0x58], 0
mov dword [esp + 0x5c], 0
lea ecx, [esp + 0x50]
mov dword [esp], ecx
mov ecx, dword [esp + 0x74]
mov dword [esp + 4], ecx
mov dword [esp + 8], eax
call fcn.00523780
mov eax, dword [esp + 0xc]
mov dword [esp], eax
call fcn.004edbf0
mov eax, dword [esp + 8]
mov dword [esp + 0x30], eax
mov ecx, dword [esp + 4]
mov dword [esp + 0x48], ecx
mov edx, dword [esp + 0x2c]
cmp eax, edx
jle 0x52182b
mov ebx, edx
mov dword [esp + 0x40], edx
lea eax, [0x731080]
mov dword [esp], eax
mov dword [esp + 4], ebx
mov dword [esp + 8], ebx
call fcn.00438a70
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0xc]
mov ebx, dword [esp + 0x40]
mov ebp, ecx
sub ecx, ebx
cmp ecx, ebp
ja 0x5219ad
mov ebx, eax
sub eax, ecx
neg eax
sar eax, 0x1f
and eax, ecx
add eax, edx
mov esi, ebp
sub ebp, ecx
mov ecx, dword [esp + 0x30]
cmp ebp, ecx
jle 0x521824
mov dword [esp + 0x40], ebx
mov dword [esp + 0x3c], esi
mov dword [esp + 0x4c], edx
mov ebp, dword [esp + 0x48]
cmp eax, ebp
je 0x521683
mov dword [esp], eax
mov dword [esp + 4], ebp
mov dword [esp + 8], ecx
call fcn.0044d1e0
mov eax, dword [esp + 0x3c]
test eax, eax
jbe 0x5219a6
mov ecx, dword [esp + 0x4c]
movzx edx, byte [ecx]
cmp eax, 1
jbe 0x52199f
movzx ebx, byte [ecx + 1]
dec edx
shr edx, 0x1f
xor ebx, 1
movzx ebx, bl
dec ebx
shr ebx, 0x1f
and edx, ebx
mov ebx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x34]
mov esi, ebx
sub ebx, ebp
test esi, esi
jl 0x521998
cmp ebx, esi
ja 0x521998
mov ebp, dword [esp + 0x40]
cmp esi, ebp
ja 0x521998
mov dword [esp + 0x28], edx
mov dword [esp + 0x38], ebx
sub ebp, ebx
mov edx, ebp
xchg ebp, ebx
neg ebx
xchg ebp, ebx
sar ebp, 0x1f
and ebp, ebx
add ebp, ecx
mov dword [esp], ebp
sub esi, ebx
mov dword [esp + 4], esi
mov dword [esp + 8], edx
mov edx, dword [esp + 0x7c]
mov dword [esp + 0xc], edx
mov edx, dword [esp + 0x80]
mov dword [esp + 0x10], edx
mov edx, dword [esp + 0x84]
mov dword [esp + 0x14], edx
call fcn.004db700
mov eax, dword [esp + 0x28]
and eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x1c]
sub ecx, edx
mov edx, dword [esp + 0x38]
test edx, edx
jl 0x521991
cmp ecx, edx
ja 0x521991
mov dword [esp + 0x28], eax
mov dword [esp + 0x38], ecx
mov eax, dword [esp + 0x40]
sub eax, ecx
mov ebx, eax
neg eax
sar eax, 0x1f
and eax, ecx
mov ebp, dword [esp + 0x4c]
add eax, ebp
mov dword [esp], eax
sub edx, ecx
mov dword [esp + 4], edx
mov dword [esp + 8], ebx
mov eax, dword [esp + 0x44]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x14], eax
call fcn.004db700
mov eax, dword [esp + 0x28]
and eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x38]
lea edx, [ecx - 1]
mov ebx, dword [esp + 0x3c]
cmp edx, ebx
jae 0x52198a
mov ebp, dword [esp + 0x4c]
movzx ecx, byte [ecx + ebp - 1]
dec ecx
shr ecx, 0x1f
and ecx, eax
mov eax, 2
jmp 0x5217da
lea esi, [eax + 1]
movzx edi, byte [ebp + eax]
xor edi, 0xffffffff
xchg edi, eax
movzx eax, al
xchg edi, eax
dec edi
shr edi, 0x1f
and ecx, edi
mov eax, esi
cmp eax, edx
jge 0x5217e7
cmp eax, ebx
jb 0x5217c2
jmp 0x521983
cmp ecx, 1
je 0x52180a
mov eax, dword [0xa7cea4]
mov ecx, dword [0xa7cea0]
mov dword [esp + 0x94], ecx
mov dword [esp + 0x98], eax
add esp, 0x70
ret
mov dword [esp + 0x94], 0
mov dword [esp + 0x98], 0
add esp, 0x70
ret
mov ecx, ebp
jmp 0x52165f
mov ebx, edx
mov edx, eax
jmp 0x52160c
mov eax, dword [0xa7cea0]
mov ecx, dword [0xa7cea4]
mov dword [esp + 0x94], eax
mov dword [esp + 0x98], ecx
add esp, 0x70
ret
xor esi, esi
jmp 0x52150c
xor edx, edx
jmp 0x521537
mov dword [esp + 0x94], ecx
mov dword [esp + 0x98], edx
add esp, 0x70
ret
lea ecx, [eax - 1]
cmp ecx, 0x13
jae 0x5219c2
mov ecx, dword [0xa7592c]
mov edx, dword [0xa75928]
cmp eax, ecx
jae 0x5219bb
movzx ecx, byte [edx + eax]
mov edx, dword [esp + 0x80]
cmp ecx, edx
je 0x5218ee
lea eax, [0x7436e0]
mov dword [esp], eax
call fcn.00409d00
mov edi, dword [esp + 4]
mov dword [edi + 4], 0x28
mov eax, dword [0xa8f2d0]
test eax, eax
jne 0x5218e1
lea eax, [0x7a3856]
mov dword [edi], eax
xor eax, eax
lea ecx, [0x7fe200]
mov edx, edi
xor ebx, ebx
xor ebp, ebp
xor esi, esi
jmp 0x5214c6
lea eax, [0x7a3856]
call fcn.0044c9e0
jmp 0x5218cc
mov dword [esp + 0x40], ecx
lea ecx, [0x733f40]
mov dword [esp], ecx
mov ecx, dword [0xa7c830]
mov dword [esp + 4], ecx
mov dword [esp + 8], eax
call fcn.0040cd30
mov eax, dword [esp + 0xc]
mov ecx, dword [eax]
movzx edx, byte [esp + 0x10]
mov ebx, dword [eax + 8]
mov eax, dword [eax + 4]
test dl, dl
je 0x521936
xor edx, edx
mov ebp, eax
mov esi, ebx
mov eax, dword [esp + 0x40]
mov ebx, ecx
xor ecx, ecx
jmp 0x5214c6
lea eax, [0x7436e0]
mov dword [esp], eax
call fcn.00409d00
mov edi, dword [esp + 4]
mov dword [edi + 4], 0x25
mov eax, dword [0xa8f2d0]
test eax, eax
jne 0x521976
lea eax, [0x7a263d]
mov dword [edi], eax
xor eax, eax
lea ecx, [0x7fe200]
mov edx, edi
xor ebx, ebx
xor ebp, ebp
xor esi, esi
jmp 0x5214c6
lea eax, [0x7a263d]
call fcn.0044c9e0
jmp 0x521961
call fcn.004266e0
ud2
call fcn.004266e0
ud2
call fcn.004267e0
ud2
call fcn.004267e0
ud2
call fcn.004266e0
ud2
call fcn.004266e0
ud2
call fcn.004267e0
ud2
call fcn.004266e0
ud2
call fcn.004266e0
ud2
lea eax, [0x730dc0]
mov dword [esp], eax
lea eax, [0x7fc580]
mov dword [esp + 4], eax
call fcn.004275c0
ud2
call fcn.0044b280
jmp fcn.00521490