Function at 0x506eb0
Capabilities:
Check for peb ntglobalflag flag

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x56e188
mov eax, dword fs:[0]
push eax
sub esp, 0x70
mov eax, dword [0x5bda40]
xor eax, esp
mov dword [esp + 0x68], eax
push ebx
push esi
push edi
mov eax, dword [0x5bda40]
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]
lea edx, [esp + 0x3c]
push edx
mov dword [esp + 0x3c], eax
mov dword [esp + 0x20], ecx
call fcn.0040a4a0
push eax
mov dword [esp + 0x8c], 0
call fcn.00507d30
mov ebx, eax
add esp, 4
lea ecx, [esp + 0x3c]
mov dword [esp + 0x28], ebx
mov dword [esp + 0x88], 0xffffffff
call fcn.00409b10
lea eax, [esp + 0x5c]
push eax
mov ecx, ebx
call fcn.00507a00
mov esi, 1
mov dword [esp + 0x88], esi
mov edx, dword [ebx]
mov eax, dword [edx + 8]
mov ecx, ebx
call eax
lea ecx, [esp + 0x40]
mov byte [esp + 0x30], al
call fcn.00410380
mov byte [esp + 0x88], 2
mov al, byte [edi]
cmp al, 0x2b
je 0x506f7b
mov dword [esp + 0x20], 0
cmp al, 0x2d
jne 0x506f7f
mov dword [esp + 0x20], esi
call fcn.0053c4b7
mov ecx, dword [eax]
mov ebx, dword [ebp + 0x30]
mov dl, byte [ecx]
push ebx
push 0x65
push edi
mov byte [esp + 0x24], dl
mov byte [esp + 0x25], 0x65
mov byte [esp + 0x26], 0
call fcn.0053ade0
add esp, 0xc
mov esi, eax
movsx eax, byte [esp + 0x18]
push ebx
push eax
push edi
call fcn.0053ade0
add esp, 0xc
mov dword [esp + 0x14], eax
test eax, eax
jne 0x506fc2
mov dword [ebp + 0x2c], eax
lea ecx, [esp + 0x5c]
call fcn.00402050
cmp byte [eax], 0x7f
je 0x5070f4
lea ecx, [esp + 0x5c]
call fcn.00402050
cmp byte [eax], 0
jle 0x5070f4
push ebx
push edi
lea ecx, [esp + 0x48]
call fcn.00446040
test esi, esi
jne 0x50700a
mov ecx, dword [ebp + 0x2c]
push 0x30
push ecx
lea ecx, [esp + 0x48]
call fcn.004127f0
mov ebx, dword [esp + 0x14]
jmp 0x507036
mov ebx, dword [esp + 0x14]
test ebx, ebx
jne 0x507024
mov edx, dword [ebp + 0x24]
push 0x30
push edx
lea ecx, [esp + 0x48]
call fcn.004127f0
mov dword [ebp + 0x24], ebx
mov eax, dword [ebp + 0x2c]
push 0x30
push eax
sub esi, edi
push esi
lea ecx, [esp + 0x4c]
call fcn.00445700
push 0x30
test ebx, ebx
jne 0x50704b
mov ecx, dword [ebp + 0x24]
push ecx
lea ecx, [esp + 0x48]
call fcn.004127f0
jmp 0x507075
mov edx, dword [ebp + 0x28]
sub ebx, edi
push edx
lea eax, [ebx + 1]
push eax
lea ecx, [esp + 0x4c]
call fcn.00445700
mov ecx, dword [ebp + 0x24]
push 0x30
push ecx
push ebx
lea ecx, [esp + 0x4c]
call fcn.00445700
mov dword [ebp + 0x28], 0
lea ecx, [esp + 0x5c]
mov dword [ebp + 0x24], 0
call fcn.00402050
lea ecx, [esp + 0x40]
mov ebx, eax
call fcn.00402300
lea edx, [esp + 0x18]
push edx
push eax
call fcn.0053c4e0
mov edi, eax
mov al, byte [ebx]
add esp, 8
cmp al, 0x7f
je 0x5070d4
test al, al
jle 0x5070d4
mov ecx, edi
sub ecx, dword [esp + 0x20]
movsx eax, al
cmp eax, ecx
jae 0x5070d4
push 0
sub edi, eax
push 1
push edi
lea ecx, [esp + 0x4c]
call fcn.00445700
cmp byte [ebx + 1], 0
jle 0x5070ce
inc ebx
mov al, byte [ebx]
cmp al, 0x7f
jne 0x5070a6
lea ecx, [esp + 0x40]
call fcn.00402300
lea ecx, [esp + 0x40]
mov edi, eax
mov dword [ebp + 0x2c], 0
call fcn.0042bf40
mov dword [ebp + 0x30], eax
mov ebx, eax
mov edx, dword [ebp + 0x24]
mov eax, dword [ebp + 0x28]
mov ecx, dword [esp + 0x1c]
lea esi, [edx + eax]
add esi, dword [ebp + 0x2c]
add esi, ebx
call fcn.0043aea0
test eax, eax
jle 0x50712d
mov ecx, dword [esp + 0x1c]
call fcn.0043aea0
cmp eax, esi
jbe 0x50712d
mov ecx, dword [esp + 0x1c]
call fcn.0043aea0
sub eax, esi
mov dword [esp + 0x14], eax
jmp 0x507135
mov dword [esp + 0x14], 0
mov ecx, dword [esp + 0x1c]
call fcn.004143c0
mov esi, dword [ebp + 8]
and eax, 0x1c0
cmp eax, 0x40
je 0x5071e1
cmp eax, 0x100
je 0x50717f
mov ecx, dword [esp + 0x14]
mov edx, dword [ebp + 0x1c]
mov eax, dword [ebp + 0x14]
push ecx
mov ecx, dword [ebp + 0x10]
push edx
push eax
push ecx
lea edx, [esp + 0x30]
push edx
push esi
call fcn.005077a0
mov ecx, dword [eax]
mov dword [ebp + 0x10], ecx
mov edx, dword [eax + 4]
mov dword [ebp + 0x14], edx
jmp 0x5071d6
cmp dword [esp + 0x20], 0
jbe 0x5071af
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x10]
push 1
push edi
push eax
push ecx
lea edx, [esp + 0x30]
push edx
push esi
call fcn.00507730
mov ecx, dword [eax]
add esp, 0x18
mov dword [ebp + 0x10], ecx
mov edx, dword [eax + 4]
inc edi
dec ebx
mov dword [ebp + 0x14], edx
mov dword [ebp + 0x30], ebx
mov eax, dword [esp + 0x14]
mov ecx, dword [ebp + 0x1c]
mov edx, dword [ebp + 0x14]
push eax
mov eax, dword [ebp + 0x10]
push ecx
push edx
push eax
lea ecx, [esp + 0x30]
push ecx
push esi
call fcn.005077a0
mov edx, dword [eax]
mov dword [ebp + 0x10], edx
mov eax, dword [eax + 4]
mov dword [ebp + 0x14], eax
mov dword [esp + 0x2c], 0
add esp, 0x18
movsx ecx, byte [esp + 0x18]
push ebx
push ecx
push edi
call fcn.0053ade0
add esp, 0xc
test eax, eax
je 0x5072b1
mov edx, dword [esp + 0x30]
mov ecx, dword [ebp + 0x14]
sub eax, edi
inc eax
push edx
mov edx, dword [ebp + 0x10]
mov ebx, eax
lea eax, [ebx - 1]
push eax
push edi
push ecx
push edx
lea eax, [esp + 0x34]
push eax
push esi
call fcn.00507910
mov ecx, dword [eax]
mov dword [ebp + 0x10], ecx
mov edx, dword [eax + 4]
mov ecx, dword [ebp + 0x24]
add esp, 0x1c
push ecx
mov dword [ebp + 0x14], edx
mov edx, dword [eax + 4]
mov eax, dword [eax]
push 0x30
push edx
push eax
lea ecx, [esp + 0x30]
push ecx
push esi
call fcn.005077a0
mov edx, dword [eax]
mov ecx, dword [esp + 0x40]
mov dword [ebp + 0x10], edx
mov eax, dword [eax + 4]
mov dword [ebp + 0x14], eax
mov edx, dword [ecx]
mov eax, dword [edx + 4]
add esp, 0x18
call eax
mov edx, dword [ebp + 0x14]
push 1
mov byte [esp + 0x2c], al
mov ecx, dword [esp + 0x2c]
mov eax, dword [ebp + 0x10]
push ecx
push edx
push eax
lea ecx, [esp + 0x30]
push ecx
push esi
call fcn.005077a0
mov edx, dword [eax]
mov dword [ebp + 0x10], edx
mov ecx, dword [eax + 4]
mov edx, dword [ebp + 0x28]
push edx
mov dword [ebp + 0x14], ecx
mov ecx, dword [eax + 4]
mov edx, dword [eax]
push 0x30
push ecx
push edx
lea eax, [esp + 0x50]
push eax
push esi
call fcn.005077a0
mov ecx, dword [eax]
add edi, ebx
add esp, 0x30
sub dword [ebp + 0x30], ebx
mov ebx, dword [ebp + 0x30]
mov dword [ebp + 0x10], ecx
mov edx, dword [eax + 4]
mov dword [ebp + 0x14], edx
push ebx
push 0x65
push edi
call fcn.0053ade0
add esp, 0xc
test eax, eax
je 0x507365
mov edx, dword [ebp + 0x14]
sub eax, edi
inc eax
mov ebx, eax
mov eax, dword [esp + 0x30]
push eax
mov eax, dword [ebp + 0x10]
lea ecx, [ebx - 1]
push ecx
push edi
push edx
push eax
lea ecx, [esp + 0x3c]
push ecx
push esi
call fcn.00507910
mov edx, dword [eax]
add esp, 0x1c
mov dword [ebp + 0x10], edx
mov ecx, dword [eax + 4]
mov edx, dword [ebp + 0x2c]
push edx
mov dword [ebp + 0x14], ecx
mov ecx, dword [eax + 4]
mov edx, dword [eax]
push 0x30
push ecx
push edx
lea eax, [esp + 0x38]
push eax
push esi
call fcn.005077a0
mov ecx, dword [eax]
mov dword [ebp + 0x10], ecx
mov edx, dword [eax + 4]
mov ecx, dword [esp + 0x34]
add esp, 0x18
mov dword [ebp + 0x14], edx
mov dword [ebp + 0x2c], 0
call fcn.004143c0
test al, 4
mov eax, 0x5a3be8
jne 0x507339
mov eax, 0x5a3bec
mov ecx, dword [ebp + 0x10]
push 1
push eax
mov eax, dword [ebp + 0x14]
push eax
push ecx
lea edx, [esp + 0x38]
push edx
push esi
call fcn.00507730
mov ecx, dword [eax]
add edi, ebx
add esp, 0x18
sub dword [ebp + 0x30], ebx
mov ebx, dword [ebp + 0x30]
mov dword [ebp + 0x10], ecx
mov edx, dword [eax + 4]
mov dword [ebp + 0x14], edx
mov eax, dword [esp + 0x30]
mov ecx, dword [ebp + 0x14]
mov edx, dword [ebp + 0x10]
push eax
push ebx
push edi
push ecx
push edx
lea eax, [esp + 0x3c]
push eax
push esi
call fcn.00507910
mov ecx, dword [eax]
mov dword [ebp + 0x10], ecx
mov edx, dword [eax + 4]
mov ecx, dword [ebp + 0x2c]
add esp, 0x1c
push ecx
mov dword [ebp + 0x14], edx
mov edx, dword [eax + 4]
mov eax, dword [eax]
push 0x30
push edx
push eax
lea ecx, [esp + 0x40]
push ecx
push esi
call fcn.005077a0
mov edx, dword [eax]
mov ecx, dword [esp + 0x34]
add esp, 0x18
mov dword [ebp + 0x10], edx
mov eax, dword [eax + 4]
push 0
mov dword [ebp + 0x14], eax
call fcn.0043aec0
mov ecx, dword [esp + 0x14]
mov edx, dword [ebp + 0x1c]
mov eax, dword [ebp + 0x14]
mov edi, dword [esp + 0x38]
push ecx
mov ecx, dword [ebp + 0x10]
push edx
push eax
push ecx
push edi
push esi
call fcn.005077a0
add esp, 0x18
lea ecx, [esp + 0x40]
call fcn.00402030
lea ecx, [esp + 0x5c]
call fcn.00402030
mov eax, edi
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.00538a54
mov esp, ebp
pop ebp
ret