Function at 0x4a0247
Capabilities:
Check for peb ntglobalflag flag

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x512e3d
mov eax, dword fs:[0]
push eax
sub esp, 0x70
mov eax, dword [0x549950]
xor eax, esp
mov dword [esp + 0x68], eax
push ebx
push esi
push edi
mov eax, dword [0x549950]
xor eax, esp
push eax
lea eax, [esp + 0x80]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x18]
mov edi, dword [ebp + 0x20]
mov dword [esp + 0x30], eax
lea eax, [esp + 0x3c]
push eax
mov dword [esp + 0x30], ecx
call fcn.00404790
xor ebx, ebx
push eax
mov dword [esp + 0x8c], ebx
call fcn.004a0d05
or dword [esp + 0x8c], 0xffffffff
pop ecx
mov esi, eax
lea ecx, [esp + 0x3c]
mov dword [esp + 0x24], esi
call fcn.00404390
lea eax, [esp + 0x5c]
push eax
mov ecx, esi
call fcn.004a0c31
mov dword [esp + 0x88], 1
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 8]
push ebx
lea ecx, [esp + 0x44]
mov byte [esp + 0x38], al
mov dword [esp + 0x5c], 0xf
call fcn.00401660
mov byte [esp + 0x88], 2
mov al, byte [edi]
cmp al, 0x2b
je 0x4a030d
mov dword [esp + 0x1c], ebx
cmp al, 0x2d
jne 0x4a0315
mov dword [esp + 0x1c], 1
call fcn.004e228d
mov eax, dword [eax]
push dword [ebp + 0x30]
mov al, byte [eax]
push 0x65
push edi
mov byte [esp + 0x24], al
mov byte [esp + 0x25], 0x65
mov byte [esp + 0x26], 0
call fcn.004e21e0
push dword [ebp + 0x30]
mov esi, eax
movsx eax, byte [esp + 0x28]
push eax
push edi
call fcn.004e21e0
add esp, 0x18
mov dword [esp + 0x14], eax
cmp eax, ebx
jne 0x4a0356
mov dword [ebp + 0x2c], ebx
cmp dword [esp + 0x74], 0x10
mov eax, dword [esp + 0x60]
jae 0x4a0365
lea eax, [esp + 0x60]
cmp byte [eax], 0x7f
je 0x4a047a
cmp dword [esp + 0x74], 0x10
mov eax, dword [esp + 0x60]
jae 0x4a037d
lea eax, [esp + 0x60]
cmp byte [eax], 0
jle 0x4a047a
push dword [ebp + 0x30]
lea ecx, [esp + 0x44]
push edi
call fcn.0041fb60
cmp esi, ebx
jne 0x4a03a7
push 0x30
push dword [ebp + 0x2c]
lea ecx, [esp + 0x48]
call fcn.00404b80
jmp 0x4a03cf
cmp dword [esp + 0x14], ebx
jne 0x4a03be
push 0x30
push dword [ebp + 0x24]
lea ecx, [esp + 0x48]
call fcn.00404b80
mov dword [ebp + 0x24], ebx
push 0x30
push dword [ebp + 0x2c]
sub esi, edi
push esi
lea ecx, [esp + 0x4c]
call fcn.004a0aaa
mov esi, dword [esp + 0x14]
push 0x30
lea ecx, [esp + 0x44]
cmp esi, ebx
jne 0x4a03e7
push dword [ebp + 0x24]
call fcn.00404b80
jmp 0x4a0407
push dword [ebp + 0x28]
sub esi, edi
lea eax, [esi + 1]
push eax
call fcn.004a0aaa
push 0x30
push dword [ebp + 0x24]
lea ecx, [esp + 0x48]
push esi
call fcn.004a0aaa
mov dword [ebp + 0x28], ebx
cmp dword [esp + 0x74], 0x10
mov esi, dword [esp + 0x60]
mov dword [ebp + 0x24], ebx
jae 0x4a0419
lea esi, [esp + 0x60]
lea eax, [esp + 0x18]
push eax
push ebx
lea ecx, [esp + 0x48]
call fcn.0049d2ad
push eax
call fcn.004e22c0
pop ecx
pop ecx
mov edi, eax
jmp 0x4a045e
test al, al
jle 0x4a0464
mov ecx, edi
sub ecx, dword [esp + 0x1c]
movsx eax, al
cmp eax, ecx
jae 0x4a0464
push ebx
sub edi, eax
push 1
push edi
lea ecx, [esp + 0x4c]
call fcn.004a0aaa
lea eax, [esi + 1]
cmp byte [eax], 0
jle 0x4a045e
mov esi, eax
mov al, byte [esi]
cmp al, 0x7f
jne 0x4a0434
push ebx
lea ecx, [esp + 0x44]
call fcn.0049d2ad
mov edi, eax
mov eax, dword [esp + 0x54]
mov dword [ebp + 0x2c], ebx
mov dword [ebp + 0x30], eax
mov ecx, dword [ebp + 0x28]
mov eax, dword [ebp + 0x24]
mov edx, dword [esp + 0x2c]
add eax, ecx
add eax, dword [ebp + 0x2c]
mov ecx, dword [edx + 0x18]
add eax, dword [ebp + 0x30]
cmp ecx, ebx
jle 0x4a049f
cmp ecx, eax
jbe 0x4a049f
sub ecx, eax
mov dword [esp + 0x14], ecx
jmp 0x4a04a3
mov dword [esp + 0x14], ebx
mov eax, dword [edx + 0x10]
mov esi, dword [ebp + 8]
and eax, 0x1c0
cmp eax, 0x40
je 0x4a0510
cmp eax, 0x100
jne 0x4a04e6
cmp dword [esp + 0x1c], ebx
jbe 0x4a04e6
push 1
push edi
push dword [ebp + 0x14]
lea eax, [esp + 0x28]
push dword [ebp + 0x10]
push eax
push esi
call fcn.004a0b44
mov ecx, dword [eax]
add esp, 0x18
mov dword [ebp + 0x10], ecx
mov eax, dword [eax + 4]
inc edi
dec dword [ebp + 0x30]
mov dword [ebp + 0x14], eax
push dword [esp + 0x14]
lea eax, [esp + 0x20]
push dword [ebp + 0x1c]
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push eax
push esi
call fcn.004a09cb
mov ecx, dword [eax]
mov dword [ebp + 0x10], ecx
mov eax, dword [eax + 4]
mov dword [esp + 0x2c], ebx
mov dword [ebp + 0x14], eax
add esp, 0x18
movsx eax, byte [esp + 0x18]
push dword [ebp + 0x30]
push eax
push edi
call fcn.004e21e0
add esp, 0xc
cmp eax, ebx
je 0x4a05d0
push dword [esp + 0x34]
sub eax, edi
inc eax
mov ebx, eax
lea eax, [ebx - 1]
push eax
push edi
push dword [ebp + 0x14]
lea eax, [esp + 0x2c]
push dword [ebp + 0x10]
push eax
push esi
call fcn.004a0b78
mov ecx, dword [eax]
push dword [ebp + 0x24]
mov dword [ebp + 0x10], ecx
mov ecx, dword [eax + 4]
push 0x30
mov dword [ebp + 0x14], ecx
push dword [eax + 4]
push dword [eax]
lea eax, [esp + 0x48]
push eax
push esi
call fcn.004a09cb
mov ecx, dword [eax]
mov dword [ebp + 0x10], ecx
mov eax, dword [eax + 4]
mov ecx, dword [esp + 0x58]
mov dword [ebp + 0x14], eax
mov eax, dword [ecx]
add esp, 0x34
call dword [eax + 4]
push 1
mov byte [esp + 0x28], al
push dword [esp + 0x28]
lea eax, [esp + 0x24]
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push eax
push esi
call fcn.004a09cb
mov ecx, dword [eax]
push dword [ebp + 0x28]
mov dword [ebp + 0x10], ecx
mov ecx, dword [eax + 4]
push 0x30
mov dword [ebp + 0x14], ecx
push dword [eax + 4]
push dword [eax]
lea eax, [esp + 0x4c]
push eax
push esi
call fcn.004a09cb
mov ecx, dword [eax]
sub dword [ebp + 0x30], ebx
mov dword [ebp + 0x10], ecx
mov eax, dword [eax + 4]
add esp, 0x30
add edi, ebx
mov dword [ebp + 0x14], eax
xor ebx, ebx
push dword [ebp + 0x30]
push 0x65
push edi
call fcn.004e21e0
add esp, 0xc
cmp eax, ebx
je 0x4a0673
push dword [esp + 0x34]
sub eax, edi
inc eax
mov ebx, eax
lea eax, [ebx - 1]
push eax
push edi
push dword [ebp + 0x14]
lea eax, [esp + 0x34]
push dword [ebp + 0x10]
push eax
push esi
call fcn.004a0b78
mov ecx, dword [eax]
push dword [ebp + 0x2c]
mov dword [ebp + 0x10], ecx
mov ecx, dword [eax + 4]
push 0x30
mov dword [ebp + 0x14], ecx
push dword [eax + 4]
push dword [eax]
lea eax, [esp + 0x50]
push eax
push esi
call fcn.004a09cb
mov ecx, dword [eax]
and dword [ebp + 0x2c], 0
mov dword [ebp + 0x10], ecx
mov ecx, dword [eax + 4]
mov dword [ebp + 0x14], ecx
mov ecx, dword [esp + 0x60]
add esp, 0x34
test byte [ecx + 0x10], 4
mov ecx, 0x533de4
jne 0x4a064b
mov ecx, 0x533de8
push 1
push ecx
push dword [eax + 4]
push dword [eax]
lea eax, [esp + 0x34]
push eax
push esi
call fcn.004a0b44
mov ecx, dword [eax]
sub dword [ebp + 0x30], ebx
mov dword [ebp + 0x10], ecx
mov eax, dword [eax + 4]
add esp, 0x18
add edi, ebx
mov dword [ebp + 0x14], eax
xor ebx, ebx
push dword [esp + 0x34]
lea eax, [esp + 0x28]
push dword [ebp + 0x30]
push edi
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push eax
push esi
call fcn.004a0b78
mov ecx, dword [eax]
push dword [ebp + 0x2c]
mov dword [ebp + 0x10], ecx
mov ecx, dword [eax + 4]
push 0x30
mov dword [ebp + 0x14], ecx
push dword [eax + 4]
push dword [eax]
lea eax, [esp + 0x60]
push eax
push esi
call fcn.004a09cb
mov ecx, dword [eax]
push dword [esp + 0x48]
mov edx, dword [esp + 0x64]
push dword [ebp + 0x1c]
mov dword [ebp + 0x10], ecx
mov eax, dword [eax + 4]
push eax
push ecx
push dword [esp + 0x74]
mov dword [ebp + 0x14], eax
push esi
mov dword [edx + 0x18], ebx
call fcn.004a09cb
add esp, 0x4c
lea ecx, [esp + 0x40]
call fcn.00401250
lea ecx, [esp + 0x5c]
call fcn.00401250
mov eax, dword [esp + 0x30]
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.004df2ac
mov esp, ebp
pop ebp
ret