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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xb4
push ebx
mov ebx, dword [ebp + 8]
push esi
mov dword [esp + 0x44], 0xffffffff
push edi
mov esi, dword [ebx + 8]
mov edx, dword [ebx]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x34], 1
movzx eax, byte [esi + 0x10]
mov dword [esp + 0x4c], esi
mov dword [esp + 0x2c], edx
lea ecx, [eax + eax*8]
mov eax, dword [edx + 4]
lea ecx, [ecx + 1]
test byte [eax + ecx*8 + 0x28], 2
lea ecx, [eax + ecx*8]
mov edi, dword [ecx + 0x10]
mov eax, dword [ebx + 4]
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], edi
mov dword [esp + 0x30], eax
je 0x5213e8
mov ebx, dword [ecx + 0x44]
jmp 0x521495
test byte [edi + 0x1c], 0x80
je 0x5213f6
mov ebx, dword [edi + 8]
jmp 0x521495
lea eax, [esp + 0x48]
mov dword [esp + 0x58], 0
mov dword [esp + 0x5c], eax
xorps xmm0, xmm0
lea eax, [esp + 0x44]
movlpd qword [esp + 0x8f], xmm0
mov dword [esp + 0x60], eax
mov eax, 3
or dword [esp + 0x90], eax
mov word [esp + 0x88], ax
movlpd qword [esp + 0x68], xmm0
movlpd qword [esp + 0x70], xmm0
movlpd qword [esp + 0x78], xmm0
movlpd qword [esp + 0x80], xmm0
movlpd qword [esp + 0x97], xmm0
mov byte [esp + 0x9f], 0
mov dword [esp + 0x8a], 0x10001
mov byte [esp + 0x8e], 5
mov dword [esp + 0x64], edi
mov ax, word [edi + 0x26]
mov word [esp + 0x44], ax
xor eax, eax
mov word [esp + 0x46], ax
test byte [ecx + 0x28], 1
jne 0x521491
mov eax, dword [ecx + 0x10]
mov eax, dword [eax + 8]
mov dword [esp + 0x6c], eax
lea ebx, [esp + 0x58]
mov eax, edi
mov dword [esp + 0x20], ebx
mov edi, 0x1c
add eax, edi
mov edi, dword [esp + 0x10]
mov dword [esp + 0x28], eax
movzx eax, word [edi + 0x26]
mov dword [esp + 0x18], eax
mov eax, dword [ebp + 8]
cmp dword [eax + 0xc], 0
jne 0x521617
mov eax, 0x1020
test word [edx + 0x28], ax
jne 0x521617
mov eax, dword [edx]
mov eax, dword [eax]
mov eax, dword [eax + 0x20]
and eax, 0x8000
or eax, 0
je 0x521617
test byte [ecx + 0x28], 0x4b
jne 0x521617
mov eax, dword [esp + 0x28]
test byte [eax], 0x80
jne 0x521617
test byte [ecx + 0x24], 0x10
jne 0x521617
mov eax, dword [esp + 0x30]
push dword [esp + 0x18]
mov edi, dword [eax + 0x18]
mov eax, dword [eax + 0xc]
lea eax, [eax + eax*2]
shl eax, 4
add eax, edi
mov dword [esp + 0x28], eax
call fcn.004a5a10
movzx eax, ax
add esp, 4
mov dword [esp + 0x38], eax
nop dword [eax]
cmp edi, dword [esp + 0x24]
jae 0x52160f
mov ecx, dword [esi + 8]
mov eax, dword [esi + 0xc]
and ecx, dword [edi + 0x20]
and eax, dword [edi + 0x24]
or ecx, eax
jne 0x5215f9
push ecx
push ecx
push dword [esp + 0x1c]
push edi
call fcn.00516640
add esp, 0x10
test eax, eax
je 0x5215f9
mov eax, dword [esi + 0x38]
mov ecx, 1
mov edx, dword [esp + 0x38]
mov word [esi + 0x18], cx
mov dword [esi + 0x30], ecx
mov ecx, dword [esp + 0x10]
mov dword [esi + 0x20], 0
mov dword [eax], edi
mov eax, dword [esp + 0x18]
add eax, edx
mov word [esi + 0x12], ax
cmp byte [ecx + 0x2b], 2
je 0x5215a6
mov ecx, dword [esp + 0x28]
test dword [ecx], 0x4000
jne 0x5215a6
add eax, 0x1c
jmp 0x5215a9
add eax, 0xffffffe7
movzx eax, ax
mov word [esi + 0x12], ax
test ax, ax
jns 0x5215bb
xor eax, eax
mov word [esi + 0x12], ax
mov eax, 0x2b
push eax
push edx
mov word [esi + 0x16], ax
call fcn.004e85e0
mov ecx, dword [ebp + 0xc]
mov word [esi + 0x14], ax
mov dword [esi + 0x2c], 0x4000
mov eax, dword [edi + 0x24]
or ecx, dword [edi + 0x20]
or eax, dword [ebp + 0x10]
push esi
push dword [ebp + 8]
mov dword [esi], ecx
mov dword [esi + 4], eax
call fcn.005233c0
add esp, 0x10
mov dword [esp + 0x1c], eax
jmp 0x5215fd
mov eax, dword [esp + 0x1c]
add edi, 0x30
test eax, eax
je 0x521530
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x14]
mov edi, dword [esp + 0x10]
mov eax, dword [esp + 0x1c]
nop dword [eax + eax]
test ebx, ebx
je 0x5219e8
mov eax, dword [ebx + 0x24]
test eax, eax
je 0x52164c
push eax
push dword [esp + 0x34]
movzx eax, byte [ecx + 0x24]
push eax
push dword [ecx + 0x2c]
call fcn.005259a0
add esp, 0x10
test eax, eax
je 0x5219c3
test dword [ebx + 0x38], 0x100
jne 0x5219c3
mov eax, dword [ebx + 8]
xor ecx, ecx
movzx eax, word [eax]
mov dword [esi + 0x18], ecx
mov word [esi + 0x1c], cx
mov dword [esi + 0x30], ecx
mov byte [esi + 0x11], cl
mov word [esi + 0x12], cx
mov ecx, dword [ebp + 0xc]
mov word [esi + 0x16], ax
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x14]
mov dword [esi], ecx
mov ecx, dword [ebp + 0x10]
mov dword [esi + 4], ecx
mov dword [esi + 0x20], ebx
push dword [eax + 0x2c]
push ebx
push dword [ebp + 8]
call fcn.004b0e90
mov edx, dword [ebx + 0x38]
add esp, 0xc
mov ecx, edx
mov dword [esp + 0x18], eax
and ecx, 3
cmp cl, 3
jne 0x521717
mov eax, dword [esp + 0x34]
xor ecx, ecx
cmp dword [esp + 0x18], ecx
movzx eax, al
cmovne ecx, eax
mov dword [esi + 0x2c], 0x100
mov byte [esi + 0x11], cl
mov ecx, dword [esp + 0x24]
lea eax, [ecx + 0x10]
mov word [esi + 0x14], ax
cmp byte [edi + 0x2b], 2
je 0x5216e0
test dword [edi + 0x1c], 0x4000
je 0x5216e7
mov dword [esi + 0x2c], 0x2000100
push ecx
push esi
push dword [esp + 0x38]
call fcn.00523670
push esi
push dword [ebp + 8]
call fcn.005233c0
mov ecx, dword [esp + 0x38]
add esp, 0x14
mov word [esi + 0x16], cx
test eax, eax
jne 0x5219e8
mov edx, dword [esp + 0x14]
jmp 0x521995
test dl, 0x20
mov edx, dword [esp + 0x14]
je 0x52173e
xorps xmm0, xmm0
mov dword [esi + 0x2c], 0x240
movlpd qword [esp + 0x38], xmm0
mov ecx, dword [esp + 0x3c]
mov edi, dword [esp + 0x38]
mov dword [esp + 0x28], ecx
jmp 0x5217bd
mov edi, dword [ebx + 0x40]
mov ecx, dword [ebx + 0x44]
and edi, dword [edx + 0x38]
and ecx, dword [edx + 0x3c]
mov dword [esp + 0x28], ecx
mov dword [esi + 0x2c], 0x200
test edi, edi
jne 0x521761
cmp ecx, 0x80000000
je 0x521778
mov eax, dword [ebx + 0x38]
test eax, 0x800
je 0x5217aa
test eax, 0x400
jne 0x5217aa
mov eax, edi
or eax, ecx
je 0x5217b0
push dword [edx + 0x2c]
push ebx
push dword [esp + 0x34]
call fcn.00520ec0
mov edx, dword [esp + 0x20]
add esp, 0xc
test eax, eax
je 0x5217b9
or dword [esi + 0x2c], eax
xorps xmm0, xmm0
movlpd qword [esp + 0x38], xmm0
mov ecx, dword [esp + 0x3c]
mov edi, dword [esp + 0x38]
mov dword [esp + 0x28], ecx
jmp 0x5217bd
mov eax, edi
or eax, ecx
jne 0x5217bd
mov dword [esi + 0x2c], 0x240
jmp 0x5217bd
mov ecx, dword [esp + 0x28]
cmp dword [esp + 0x18], 0
jne 0x521829
mov eax, dword [esp + 0x10]
test byte [eax + 0x1c], 0x80
jne 0x521829
cmp dword [ebx + 0x24], 0
jne 0x521829
test byte [edx + 0x28], 2
jne 0x521829
mov eax, edi
or eax, ecx
jne 0x521991
test byte [ebx + 0x38], 4
jne 0x521991
mov ecx, dword [esp + 0x10]
mov ax, word [ebx + 0x30]
cmp ax, word [ecx + 0x28]
jge 0x5219bf
mov eax, dword [esp + 0x2c]
test byte [eax + 0x28], 4
jne 0x5219bf
cmp byte [0x58d42f], 0
je 0x5219bf
mov eax, dword [eax]
mov eax, dword [eax]
test byte [eax + 0x50], 0x20
jne 0x5219bf
mov eax, dword [esp + 0x34]
xor ecx, ecx
cmp dword [esp + 0x18], ecx
movzx eax, al
cmovne ecx, eax
mov byte [esi + 0x11], cl
movsx ecx, word [ebx + 0x30]
mov eax, ecx
shl eax, 4
sub eax, ecx
mov ecx, dword [esp + 0x10]
cdq
movsx ecx, word [ecx + 0x28]
idiv ecx
mov ecx, dword [esp + 0x24]
inc eax
add eax, ecx
or edi, dword [esp + 0x28]
mov word [esi + 0x14], ax
je 0x521951
lea eax, [ecx + 0x10]
xor edx, edx
mov ecx, dword [esp + 0x2c]
movzx edi, ax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x18], edx
mov eax, dword [eax + 0x2c]
mov dword [esp + 0x38], eax
cmp dword [ecx + 0x5c], edx
jle 0x52193b
mov eax, dword [esp + 0x20]
xor esi, esi
mov ebx, dword [ecx + 0x68]
xorps xmm0, xmm0
mov edx, dword [esp + 0x38]
mov dword [esp + 0x54], edx
lea edx, [esp + 0x50]
mov dword [esp + 0xbc], edx
mov ecx, dword [ebx + esi]
mov edx, dword [esp + 0x18]
mov dword [esp + 0xa4], 0
movlpd qword [esp + 0xac], xmm0
movlpd qword [esp + 0xb4], xmm0
mov dword [esp + 0x50], eax
mov dword [esp + 0xa8], 0x4a89d0
test ecx, ecx
je 0x5218fa
push ecx
lea eax, [esp + 0xa8]
push eax
call fcn.0050c9c0
mov eax, dword [esp + 0x28]
add esp, 8
mov edx, dword [esp + 0x18]
cmp word [esp + 0xb8], 0
jne 0x521933
movzx ecx, word [ebx + esi + 8]
test cx, cx
jg 0x521913
add edi, ecx
jmp 0x52191e
dec edi
test byte [ebx + esi + 0xc], 0x82
je 0x52191e
sub edi, 0x13
mov ecx, dword [esp + 0x2c]
inc edx
add esi, 0x30
mov dword [esp + 0x18], edx
cmp edx, dword [ecx + 0x5c]
jl 0x521891
mov esi, dword [esp + 0x4c]
mov ebx, dword [esp + 0x20]
movzx eax, word [esi + 0x14]
push edi
push eax
call fcn.004e85e0
mov ecx, dword [esp + 0x2c]
add esp, 8
mov word [esi + 0x14], ax
push ecx
push esi
push dword [esp + 0x38]
call fcn.00523670
mov edx, dword [esp + 0x20]
add esp, 0xc
test byte [edx + 0x24], 0x10
je 0x52196f
cmp dword [ebx + 0x28], 0
jne 0x521981
push esi
push dword [ebp + 8]
call fcn.005233c0
mov edx, dword [esp + 0x1c]
add esp, 8
jmp 0x521985
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x24]
mov word [esi + 0x16], cx
test eax, eax
jne 0x5219e8
mov edi, dword [esp + 0x10]
mov eax, dword [ebp + 8]
push 0
push ebx
push edx
push eax
mov byte [eax + 0x10], 0
call fcn.005219f0
mov ecx, dword [ebp + 8]
add esp, 0x10
mov dword [esp + 0x1c], eax
cmp byte [ecx + 0x10], 1
jne 0x5219c7
or dword [edi + 0x1c], 0x100
jmp 0x5219c7
mov edi, ecx
jmp 0x521995
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x14]
test byte [ecx + 0x28], 2
je 0x5219d5
xor ebx, ebx
jmp 0x5219d8
mov ebx, dword [ebx + 0x14]
inc dword [esp + 0x34]
mov dword [esp + 0x20], ebx
test eax, eax
je 0x521620
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret