Function at 0x5217c0
Capabilities:
Check for peb ntglobalflag flag

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x5605ac
mov eax, dword fs:[0]
push eax
sub esp, 0x60
mov eax, dword [0x58829c]
xor eax, esp
mov dword [esp + 0x58], eax
push ebx
push esi
push edi
mov eax, dword [0x58829c]
xor eax, esp
push eax
lea eax, [esp + 0x70]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [esp + 0x10], ebx
lea edi, [ebx + 0x70]
mov ecx, edi
call fcn.00525b60
xor eax, eax
mov dword [esp + 0x64], 7
push 0xffffffffffffffff
push eax
mov word [esp + 0x58], ax
lea ecx, [esp + 0x58]
lea eax, [ebx + 0x58]
mov dword [esp + 0x68], 0
push eax
call fcn.00444890
mov dword [esp + 0x78], 0
mov ebx, 7
xor edx, edx
mov dword [esp + 0x4c], ebx
xor eax, eax
mov dword [esp + 0x48], edx
mov word [esp + 0x38], ax
mov dword [esp + 0x34], ebx
mov dword [esp + 0x30], eax
mov word [esp + 0x20], ax
xor ecx, ecx
mov byte [esp + 0x78], 2
mov esi, dword [sym.imp.msvcr120.dll_void___cdecl_operator_delete_void__]
mov dword [esp + 0x14], ecx
cmp dword [esp + 0x60], ecx
jle 0x521c28
jmp 0x521880
cmp dword [esp + 0x64], 8
lea eax, [esp + 0x50]
cmovae eax, dword [esp + 0x50]
movzx esi, word [eax + ecx*2]
cmp ebx, 1
jae 0x5218a7
push edx
push 1
lea ecx, [esp + 0x40]
call fcn.00436e20
mov ebx, dword [esp + 0x4c]
cmp ebx, 8
lea eax, [esp + 0x38]
lea edx, [esp + 0x38]
cmovae eax, dword [esp + 0x38]
mov word [eax], si
lea eax, [esp + 0x38]
cmp dword [esp + 0x4c], 8
mov esi, 1
mov dword [esp + 0x48], 1
cmovae eax, dword [esp + 0x38]
xor ecx, ecx
mov word [eax + 2], cx
cmp dword [esp + 0x4c], 8
mov ecx, dword [esp + 0x48]
cmovae edx, dword [esp + 0x38]
cmp ecx, esi
cmovb esi, ecx
test esi, esi
je 0x52190c
mov ecx, 0x57539c
mov ax, word [edx]
cmp ax, word [ecx]
jne 0x52191c
add edx, 2
add ecx, 2
dec esi
jne 0x5218f7
mov ecx, dword [esp + 0x48]
xor eax, eax
test eax, eax
jne 0x521938
cmp ecx, 1
jae 0x52192e
or eax, 0xffffffff
jmp 0x521936
movzx eax, word [edx]
cmp ax, word [ecx]
mov ecx, dword [esp + 0x48]
sbb eax, eax
and eax, 0xfffffffe
inc eax
jmp 0x52190e
xor eax, eax
cmp ecx, 1
setne al
test eax, eax
sete al
test al, al
sete al
test al, al
je 0x52195f
push 0xffffffffffffffff
push 0
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x2c]
call fcn.00443b00
mov ecx, dword [esp + 0x14]
jmp 0x521b4f
mov esi, dword [esp + 0x30]
xor ecx, ecx
mov ebx, dword [esp + 0x34]
test esi, esi
mov al, 1
movzx eax, al
cmove eax, ecx
cmp ebx, 8
mov dword [esp + 0x18], eax
lea eax, [esp + 0x20]
cmovae eax, dword [esp + 0x20]
cmp word [eax], 0x20
jne 0x521a0d
xor edx, edx
mov cl, 1
test esi, esi
je 0x5219bf
cmp ebx, 8
movzx ecx, cl
lea eax, [esp + 0x20]
mov dword [esp + 0x1c], 0
cmovae eax, dword [esp + 0x20]
cmp word [eax + edx*2], 0x20
cmovne ecx, dword [esp + 0x1c]
inc edx
cmp edx, esi
jb 0x521995
test cl, cl
je 0x521a0d
mov ebx, dword [esp + 0x14]
lea ecx, [esp + 0x50]
push 1
mov dword [esp + 0x20], 0x7d
lea eax, [ebx + 1]
push eax
lea eax, [esp + 0x24]
push eax
call fcn.00525d30
cmp eax, 0xffffffff
je 0x5219f8
push 0xffffffffffffffff
push 0
lea ecx, [esp + 0x28]
inc eax
push ecx
push eax
lea ecx, [esp + 0x60]
call fcn.00499260
push 0
push 0x568a60
lea ecx, [esp + 0x28]
call fcn.00444990
jmp 0x521ab9
cmp byte [esp + 0x18], 0
je 0x521ab5
push 0x35c
call dword [sym.imp.msvcr120.dll_void____cdecl_operator_new_unsigned_int_]
mov ecx, eax
add esp, 4
mov dword [esp + 0x18], ecx
mov ebx, dword [esp + 0x10]
mov byte [esp + 0x78], 3
test ecx, ecx
je 0x521a46
lea eax, [ebx + 0x10]
push eax
call fcn.0051f710
mov esi, eax
jmp 0x521a48
xor esi, esi
lea eax, [ebx + 0xac]
mov byte [esp + 0x78], 2
push eax
lea ecx, [esi + 0x1cc]
call fcn.00521c80
lea eax, [ebx + 0x174]
push eax
lea ecx, [esi + 0x294]
call fcn.00521c80
mov eax, dword [edi + 0x14]
cmp dword [edi + 0x10], eax
jne 0x521a84
add eax, 0xa
mov ecx, edi
push eax
call fcn.00436aa0
mov ecx, dword [edi + 0x10]
mov eax, dword [edi + 0x18]
mov dword [eax + ecx*4], esi
lea ecx, [esi + 0x1c]
inc dword [edi + 0x10]
lea eax, [esp + 0x20]
cmp ecx, eax
je 0x521aa5
push 0xffffffffffffffff
push 0
push eax
call fcn.00444890
push 0
push 0x568a60
lea ecx, [esp + 0x28]
call fcn.00444990
mov ebx, dword [esp + 0x14]
push 0x35c
call dword [sym.imp.msvcr120.dll_void____cdecl_operator_new_unsigned_int_]
mov ecx, eax
add esp, 4
mov dword [esp + 0x18], ecx
mov byte [esp + 0x78], 4
test ecx, ecx
je 0x521ae7
mov eax, dword [esp + 0x10]
add eax, 0x10
push eax
call fcn.0051f710
mov esi, eax
jmp 0x521ae9
xor esi, esi
mov eax, dword [esp + 0x10]
lea ecx, [esi + 0x1cc]
add eax, 0xac
mov byte [esp + 0x78], 2
push eax
call fcn.00521c80
mov eax, dword [esp + 0x10]
lea ecx, [esi + 0x294]
add eax, 0x174
push eax
call fcn.00521c80
mov eax, dword [edi + 0x14]
cmp dword [edi + 0x10], eax
jne 0x521b2b
add eax, 0xa
mov ecx, edi
push eax
call fcn.00436aa0
mov ecx, dword [edi + 0x10]
mov eax, dword [edi + 0x18]
mov dword [eax + ecx*4], esi
lea eax, [esp + 0x50]
inc dword [edi + 0x10]
push eax
lea eax, [esi + 0x1c]
push eax
lea eax, [esi + 0x104]
push eax
push ebx
call fcn.00521dc0
mov ecx, eax
mov edx, dword [esp + 0x48]
inc ecx
mov ebx, dword [esp + 0x4c]
mov dword [esp + 0x14], ecx
cmp ecx, dword [esp + 0x60]
jl 0x521880
cmp dword [esp + 0x30], 0
jbe 0x521c0e
push 0x35c
call dword [sym.imp.msvcr120.dll_void____cdecl_operator_new_unsigned_int_]
add esp, 4
mov dword [esp + 0x18], eax
mov ebx, dword [esp + 0x10]
mov byte [esp + 0x78], 5
test eax, eax
je 0x521b9f
lea ecx, [ebx + 0x10]
push ecx
mov ecx, eax
call fcn.0051f710
mov esi, eax
jmp 0x521ba1
xor esi, esi
lea eax, [ebx + 0xac]
mov byte [esp + 0x78], 2
push eax
lea ecx, [esi + 0x1cc]
call fcn.00521c80
lea eax, [ebx + 0x174]
push eax
lea ecx, [esi + 0x294]
call fcn.00521c80
mov eax, dword [edi + 0x14]
cmp dword [edi + 0x10], eax
jne 0x521bdd
add eax, 0xa
mov ecx, edi
push eax
call fcn.00436aa0
mov ecx, dword [edi + 0x10]
mov eax, dword [edi + 0x18]
mov dword [eax + ecx*4], esi
lea ecx, [esi + 0x1c]
inc dword [edi + 0x10]
lea eax, [esp + 0x20]
cmp ecx, eax
je 0x521bfe
push 0xffffffffffffffff
push 0
push eax
call fcn.00444890
push 0
push 0x568a60
lea ecx, [esp + 0x28]
call fcn.00444990
cmp dword [esp + 0x34], 8
mov esi, dword [sym.imp.msvcr120.dll_void___cdecl_operator_delete_void__]
jb 0x521c24
push dword [esp + 0x20]
call esi
add esp, 4
mov ebx, dword [esp + 0x4c]
xor eax, eax
mov dword [esp + 0x34], 7
mov dword [esp + 0x30], 0
mov word [esp + 0x20], ax
cmp ebx, 8
jb 0x521c4d
push dword [esp + 0x38]
call esi
add esp, 4
cmp dword [esp + 0x64], 8
jb 0x521c5d
push dword [esp + 0x50]
call esi
add esp, 4
mov ecx, dword [esp + 0x70]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x58]
xor ecx, esp
call fcn.00551c1f
mov esp, ebp
pop ebp
ret