Function at 0x40f6f2
Capabilities:
Check for peb ntglobalflag flag

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4ce50f
mov eax, dword fs:[0]
push eax
sub esp, 0x80
push ebx
push esi
push edi
mov eax, dword [0x509590]
xor eax, esp
push eax
lea eax, [esp + 0x90]
mov dword fs:[0], eax
mov esi, ecx
mov dword [esp + 0x14], esi
push 0x1a8
call fcn.0045e877
pop ecx
mov dword [esp + 0x1c], eax
mov ebx, dword [ebp + 8]
xor edi, edi
cmp eax, edi
mov dword [esp + 0x98], edi
je 0x40f752
push ebx
push eax
call fcn.00408fbb
mov edi, eax
or dword [esp + 0x98], 0xffffffff
push 0
push 0xa
lea eax, [esi - 0x78]
mov esi, dword [edi]
push 0
push eax
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x30]
push eax
lea eax, [ebx + 0x20]
call fcn.0043f9e1
push eax
mov ecx, edi
call dword [esi + 0x13c]
cmp dword [ebx + 0xbc], 0
mov eax, dword [edi + 0xe4]
jne 0x40f799
and eax, 0xffffffe7
or eax, 0x22
mov ecx, eax
jmp 0x40f7eb
and eax, 0xfffffffd
mov dword [esp + 0x18], eax
lea eax, [esp + 0x30]
push eax
lea eax, [ebx + 0xa8]
push eax
call fcn.0042e649
mov dword [esp + 0x98], 1
cmp dword [eax + 0x18], 8
jb 0x40f7c7
mov eax, dword [eax + 4]
jmp 0x40f7ca
add eax, 4
push eax
mov esi, edi
call fcn.004023f5
or dword [esp + 0x98], 0xffffffff
push 0
push 1
lea esi, [esp + 0x38]
call fcn.004075b1
mov ecx, dword [esp + 0x18]
cmp byte [ebx + 0xe3], 0
je 0x40f7f7
or ecx, 0x40
cmp byte [ebx + 0xe0], 0
je 0x40f806
or ecx, 0x80
mov esi, edi
call fcn.00401310
cmp dword [ebx + 0xa0], 0
je 0x40f861
lea eax, [esp + 0x30]
push eax
lea eax, [ebx + 0x8c]
push eax
call fcn.0042e649
mov dword [esp + 0x98], 2
cmp dword [eax + 0x18], 8
jb 0x40f83d
mov eax, dword [eax + 4]
jmp 0x40f840
add eax, 4
lea ecx, [edi + 0x18c]
push eax
call fcn.0040492a
or dword [esp + 0x98], 0xffffffff
push 0
push 1
lea esi, [esp + 0x38]
call fcn.004075b1
xor eax, eax
cmp byte [ebx + 0xe1], al
je 0x40f870
mov eax, 0x1000
cmp byte [ebx + 0xe2], 0
je 0x40f87c
or eax, 4
or eax, 0x80000
mov ecx, edi
mov dword [edi + 0x17c], eax
call fcn.00401b31
lea eax, [esp + 0x30]
push eax
lea eax, [ebx + 0x34]
push eax
call fcn.0042e649
mov dword [esp + 0x98], 3
cmp dword [eax + 0x18], 8
jb 0x40f8b2
mov eax, dword [eax + 4]
jmp 0x40f8b5
add eax, 4
push eax
mov esi, edi
call fcn.004023f5
or dword [esp + 0x98], 0xffffffff
push 0
push 1
lea esi, [esp + 0x38]
call fcn.004075b1
lea eax, [esp + 0x30]
push eax
lea eax, [ebx + 0xc4]
push eax
call fcn.0042e649
mov dword [esp + 0x98], 4
cmp dword [eax + 0x18], 8
jb 0x40f8f9
mov eax, dword [eax + 4]
jmp 0x40f8fc
add eax, 4
push eax
mov esi, edi
call fcn.00401f09
or dword [esp + 0x98], 0xffffffff
push 0
push 1
lea esi, [esp + 0x38]
call fcn.004075b1
mov ecx, ebx
mov ebx, dword [esp + 0x1c]
call fcn.0040f2b4
push eax
mov eax, edi
call fcn.00403b74
mov ebx, dword [ebp + 8]
mov dword [edi + 0x178], 1
call fcn.004379c0
movzx eax, al
push eax
mov esi, edi
call fcn.00403b86
lea eax, [esp + 0x30]
push eax
mov eax, dword [ebp + 8]
add eax, 0x70
push eax
lea ebx, [edi + 0x1a0]
call fcn.0040945d
lea eax, [esp + 0x30]
lea esi, [esp + 0x4c]
mov dword [esp + 0x98], 5
call fcn.00405b7f
mov dword [esp + 0x68], ebx
mov eax, esi
lea esi, [esp + 0x6c]
mov byte [esp + 0x98], 6
call fcn.00405b7f
mov eax, dword [esp + 0x68]
mov dword [esp + 0x88], eax
mov eax, esi
push eax
mov eax, dword [esp + 0x18]
add eax, 0x318
push eax
lea ebx, [esp + 0x28]
mov byte [esp + 0xa0], 7
call fcn.004103dc
xor ebx, ebx
push ebx
push 1
call fcn.004075b1
push ebx
push 1
lea esi, [esp + 0x54]
call fcn.004075b1
or dword [esp + 0x98], 0xffffffff
push ebx
push 1
lea esi, [esp + 0x38]
call fcn.004075b1
mov eax, dword [esp + 0x14]
push dword [eax + 0x334]
add eax, 0x330
push eax
lea ecx, [esp + 0x24]
push ecx
push eax
mov dword [esp + 0x2c], edi
call fcn.00410a0b
mov ecx, dword [esp + 0x90]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4