Function at 0x4599e5
Capabilities:
Check for peb ntglobalflag flag

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x56ce52
mov eax, dword fs:[0]
push eax
sub esp, 0x70
mov eax, dword [0x5c31c8]
xor eax, esp
mov dword [esp + 0x68], eax
push ebx
push esi
push edi
mov eax, dword [0x5c31c8]
xor eax, esp
push eax
lea eax, [esp + 0x80]
mov dword fs:[0], eax
mov edi, ecx
mov dword [esp + 0x2c], edi
mov eax, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
mov dword [esp + 0x18], eax
mov dword [esp + 0x30], edi
call fcn.005383c0
push esi
lea eax, [esp + 0x28]
xor ebx, ebx
push eax
lea ecx, [edi + 0x18]
mov dword [esp + 0x90], ebx
call fcn.00456b7b
mov esi, dword [esp + 0x24]
cmp esi, dword [edi + 0x18]
je 0x459b94
mov eax, dword [esi + 0x2c]
mov cl, bl
mov ebx, dword [esi + 0x28]
mov byte [esp + 0x17], cl
mov dword [esp + 0x1c], eax
push 0x30
pop edi
cmp ebx, eax
je 0x459b74
lea edi, [ebx + 4]
mov dword [esp + 0x20], edi
cmp byte [ebp + 0x10], 0
jne 0x459af4
push dword [esp + 0x18]
mov ecx, edi
call fcn.0042cb3b
mov edx, dword [esp + 0x18]
test eax, eax
jne 0x459bca
mov ax, word [edi + 0x1a]
cmp ax, word [edx + 0x1a]
jne 0x459bca
xor eax, eax
mov dword [esp + 0x4c], 0xf
mov dword [esp + 0x48], eax
mov byte [esp + 0x38], al
mov byte [esp + 0x88], 1
mov ecx, edi
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], eax
lea eax, [esp + 0x38]
push eax
call fcn.00459c85
xor eax, eax
lea ecx, [esp + 0x38]
push eax
mov byte [esp + 0x8c], al
inc eax
push eax
call fcn.00401d3f
mov eax, dword [esp + 0x1c]
mov cl, byte [esp + 0x17]
mov edx, dword [esp + 0x18]
mov esi, dword [edi + 0x20]
mov edi, dword [edi + 0x24]
mov dword [esp + 0x28], edi
cmp esi, edi
je 0x459b56
mov eax, edi
mov edi, dword [esi]
cmp edi, dword [esi + 4]
je 0x459b47
push edx
mov ecx, edi
call fcn.0042cb3b
mov edx, dword [esp + 0x18]
test eax, eax
jne 0x459b37
mov ax, word [edi + 0x1a]
cmp ax, word [edx + 0x1a]
jne 0x459b37
mov ax, word [edi + 0x1c]
cmp ax, word [edx + 0x1c]
je 0x459bd7
add edi, 0x20
cmp edi, dword [esi + 4]
jne 0x459b0f
mov cl, byte [esp + 0x17]
mov eax, dword [esp + 0x28]
add esi, 0xc
cmp esi, eax
jne 0x459b08
test cl, cl
jne 0x459b6d
mov eax, dword [esp + 0x1c]
mov edi, dword [esp + 0x20]
push 0x30
pop edx
add ebx, edx
add edi, edx
mov dword [esp + 0x20], edi
cmp ebx, eax
jne 0x459a7e
mov esi, dword [esp + 0x24]
push 0x30
pop edi
mov eax, dword [esi + 0x2c]
mov ecx, dword [esi + 0x28]
sub eax, ecx
cdq
idiv edi
mov edx, dword [esi + 0x2c]
push 0x4588ef
push eax
call fcn.0045b1e0
xor eax, eax
pop ecx
pop ecx
lea ebx, [eax + 1]
mov ecx, dword [esp + 0x2c]
or dword [esp + 0x88], 0xffffffff
call fcn.005383d0
mov al, bl
mov ecx, dword [esp + 0x80]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x68]
xor ecx, esp
call fcn.0055daac
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [esp + 0x1c]
mov cl, byte [esp + 0x17]
jmp 0x459af8
cmp byte [ebp + 0x10], 0
je 0x459c0f
mov ecx, dword [esp + 0x20]
cmp ecx, edx
je 0x459bf7
push 0xffffffffffffffff
push 0
push edx
call fcn.00401cab
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x18]
mov ax, word [edx + 0x1a]
mov word [ecx + 0x1a], ax
mov ax, word [edx + 0x1c]
mov word [ecx + 0x1c], ax
mov ax, word [edx + 0x18]
mov word [ecx + 0x18], ax
mov eax, dword [esi + 4]
xor ecx, ecx
sub eax, dword [esi]
inc ecx
sar eax, 5
cmp eax, ecx
jbe 0x459c65
push edi
lea ecx, [esp + 0x5c]
call fcn.004588bf
push edi
lea eax, [esp + 0x38]
mov byte [esp + 0x8c], 2
push eax
mov ecx, esi
call fcn.0045a313
lea eax, [esp + 0x58]
mov ecx, esi
push eax
call fcn.0045a2b1
xor eax, eax
lea ecx, [esp + 0x58]
push eax
mov byte [esp + 0x8c], al
inc eax
push eax
call fcn.00401d3f
mov edx, dword [esp + 0x18]
xor ecx, ecx
inc ecx
cmp byte [ebp + 0x10], 0
push 3
pop eax
cmovne eax, ecx
cmp dword [ebx], eax
je 0x459c7e
mov dword [ebx], eax
mov byte [esp + 0x17], cl
jmp 0x459b43
mov bl, cl
jmp 0x459b94