Function at 0x10058f90
Capabilities:
Check for peb ntglobalflag flag

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x100b7d10
mov eax, dword fs:[0]
push eax
sub esp, 0x70
mov eax, dword [0x100e01f0]
xor eax, esp
mov dword [esp + 0x68], eax
push ebx
push esi
push edi
mov eax, dword [0x100e01f0]
xor eax, esp
push eax
lea eax, [esp + 0x80]
mov dword fs:[0], eax
mov esi, dword [ebp + 0x30]
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x18]
mov ebx, dword [ebp + 0x20]
mov dword [esp + 0x3c], eax
mov dword [esp + 0x34], ecx
test esi, esi
je 0x10058ff3
mov al, byte [ebx]
cmp al, 0x2b
je 0x10058fec
cmp al, 0x2d
jne 0x10058ff3
mov edi, 1
jmp 0x10058ff5
xor edi, edi
mov eax, dword [ecx + 0x14]
and eax, 0x3000
mov dword [esp + 0x14], edi
cmp eax, 0x3000
je 0x1005900f
mov edx, 0x100c7f0c
jmp 0x10059035
lea eax, [edi + 2]
mov edx, 0x100c7f10
cmp eax, esi
ja 0x10059035
cmp byte [ebx + edi], 0x30
jne 0x10059035
mov cl, byte [ebx + edi + 1]
cmp cl, 0x78
je 0x1005902f
cmp cl, 0x58
jne 0x10059035
mov edi, eax
mov dword [esp + 0x14], edi
push edx
push ebx
call fcn.100809a0
mov dword [esp + 0x48], eax
mov eax, 0x2e
mov word [esp + 0x20], ax
call fcn.1008090a
mov eax, dword [eax]
mov al, byte [eax]
mov byte [esp + 0x20], al
lea eax, [esp + 0x20]
push eax
push ebx
call fcn.100809a0
mov ecx, dword [esp + 0x44]
add esp, 0x10
mov dword [esp + 0x28], eax
lea eax, [esp + 0x20]
push eax
call fcn.1004ae10
push eax
mov dword [esp + 0x8c], 0
call fcn.1004acc0
mov dword [esp + 0x8c], 0xffffffff
mov ecx, dword [esp + 0x24]
add esp, 4
mov dword [esp + 0x1c], eax
test ecx, ecx
je 0x100590b3
mov eax, dword [ecx]
call dword [eax + 8]
mov ecx, eax
test ecx, ecx
je 0x100590b3
mov eax, dword [ecx]
push 1
call dword [eax]
mov ecx, dword [esp + 0x1c]
push 0x30
mov eax, dword [ecx]
mov eax, dword [eax + 0x20]
call eax
lea ecx, [esp + 0x2f]
mov byte [esp + 0x38], al
call fcn.10003ad0
push eax
lea ecx, [esp + 0x4c]
call fcn.10003210
push 0
push 0
lea ecx, [esp + 0x50]
call fcn.10003b00
lea ecx, [esp + 0x48]
cmp esi, 0xffffffff
jne 0x100590f2
call fcn.10003550
push 0
push esi
call fcn.10003b90
test al, al
je 0x10059116
push 0
push esi
push 0
lea ecx, [esp + 0x54]
call fcn.1003dc20
push esi
lea ecx, [esp + 0x4c]
call fcn.10003cd0
lea ecx, [esp + 0x48]
mov dword [esp + 0x88], 1
call fcn.10003ca0
mov ecx, dword [esp + 0x1c]
push eax
mov edx, dword [ecx]
lea eax, [esi + ebx]
push eax
push ebx
call dword [edx + 0x1c]
mov ecx, dword [esp + 0x34]
lea eax, [esp + 0x20]
push eax
call fcn.1004ae10
push eax
mov byte [esp + 0x8c], 2
call fcn.1005b120
mov byte [esp + 0x8c], 1
mov ecx, dword [esp + 0x24]
add esp, 4
mov ebx, eax
test ecx, ecx
je 0x1005917b
mov eax, dword [ecx]
call dword [eax + 8]
mov ecx, eax
test ecx, ecx
je 0x1005917b
mov eax, dword [ecx]
push 1
call dword [eax]
lea eax, [esp + 0x60]
push eax
mov ecx, ebx
call fcn.100599f0
mov byte [esp + 0x88], 3
mov eax, dword [ebx]
mov ecx, ebx
mov eax, dword [eax + 0x10]
call eax
mov ecx, dword [esp + 0x40]
mov byte [esp + 0x30], al
mov eax, dword [esp + 0x28]
cmp eax, esi
jne 0x100591bf
push dword [esp + 0x38]
mov eax, dword [ebp + 0x24]
push eax
lea ebx, [ecx + eax]
push ecx
lea ecx, [esp + 0x54]
call fcn.10058340
jmp 0x1005921c
mov esi, dword [esp + 0x38]
mov edi, dword [ebp + 0x24]
push esi
push dword [ebp + 0x2c]
add eax, edi
push ecx
lea ecx, [esp + 0x54]
mov dword [esp + 0x28], eax
call fcn.10058340
mov eax, dword [esp + 0x28]
push esi
push dword [ebp + 0x28]
inc eax
push eax
lea ecx, [esp + 0x54]
call fcn.10058340
mov eax, dword [ebx]
mov ecx, ebx
mov eax, dword [eax + 0xc]
call eax
lea ecx, [esp + 0x48]
mov bl, al
call fcn.10003ca0
mov ecx, dword [esp + 0x28]
push esi
push edi
mov byte [eax + ecx], bl
push ecx
lea ecx, [esp + 0x54]
call fcn.10058340
mov ebx, dword [esp + 0x1c]
mov edi, dword [esp + 0x14]
push 0
lea ecx, [esp + 0x64]
call fcn.1003f930
mov esi, eax
mov al, byte [esi]
cmp al, 0x7f
je 0x100592d3
test al, al
jle 0x100592d3
movsx ecx, al
mov eax, ebx
sub eax, edi
cmp ecx, eax
jae 0x100592d3
sub ebx, ecx
mov ecx, dword [esp + 0x58]
cmp ecx, ebx
jb 0x10059306
or eax, 0xffffffff
sub eax, ecx
cmp eax, 1
jbe 0x100592fd
lea edi, [ecx + 1]
push 0
push edi
lea ecx, [esp + 0x50]
call fcn.10003b90
test al, al
je 0x100592bb
mov eax, dword [esp + 0x58]
sub eax, ebx
push eax
lea ecx, [esp + 0x4c]
call fcn.10003ca0
add eax, ebx
push eax
lea ecx, [esp + 0x50]
call fcn.10003ca0
inc eax
add eax, ebx
push eax
call fcn.10003340
add esp, 0xc
lea ecx, [esp + 0x48]
push dword [esp + 0x30]
push 1
push ebx
call fcn.1003dc20
push edi
lea ecx, [esp + 0x4c]
call fcn.10003cd0
cmp byte [esi + 1], 0
mov edi, dword [esp + 0x14]
lea eax, [esi + 1]
cmovg esi, eax
mov al, byte [esi]
cmp al, 0x7f
jne 0x10059233
lea ecx, [esp + 0x48]
call fcn.100032c0
mov ebx, dword [esp + 0x34]
mov dword [esp + 0x30], eax
cmp dword [ebx + 0x24], 0
jl 0x1005930f
jg 0x100592f2
cmp dword [ebx + 0x20], 0
jbe 0x1005930f
mov edi, dword [ebx + 0x20]
cmp edi, eax
jbe 0x1005930f
sub edi, eax
jmp 0x10059311
lea ecx, [esp + 0x48]
call fcn.10003550
lea ecx, [esp + 0x48]
call fcn.10003320
xor edi, edi
mov eax, dword [ebx + 0x14]
and eax, 0x1c0
cmp eax, 0x40
je 0x10059352
cmp eax, 0x100
je 0x1005940d
push edi
push dword [ebp + 0x1c]
lea eax, [esp + 0x28]
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push eax
push dword [ebp + 8]
call fcn.10059960
mov ecx, eax
add esp, 0x18
mov eax, dword [ecx]
mov dword [ebp + 0x10], eax
mov eax, dword [ecx + 4]
mov dword [ebp + 0x14], eax
xor edi, edi
lea ecx, [esp + 0x48]
call fcn.10003ca0
mov esi, dword [esp + 0x14]
push esi
push eax
push dword [ebp + 0x14]
lea eax, [esp + 0x2c]
push dword [ebp + 0x10]
push eax
push dword [ebp + 8]
call fcn.100598f0
add esp, 0x18
mov ecx, eax
mov eax, dword [ecx]
mov dword [ebp + 0x10], eax
mov eax, dword [ecx + 4]
lea ecx, [esp + 0x48]
mov dword [ebp + 0x14], eax
call fcn.10003ca0
mov ecx, dword [esp + 0x30]
sub ecx, esi
push ecx
add eax, esi
mov esi, dword [ebp + 8]
push eax
push dword [ebp + 0x14]
lea eax, [esp + 0x4c]
push dword [ebp + 0x10]
push eax
push esi
call fcn.100598f0
mov ecx, dword [eax]
push edi
push dword [ebp + 0x1c]
mov edi, dword [esp + 0x5c]
mov dword [ebp + 0x10], ecx
mov eax, dword [eax + 4]
push eax
push ecx
push edi
push esi
mov dword [ebp + 0x14], eax
mov dword [ebx + 0x20], 0
mov dword [ebx + 0x24], 0
call fcn.10059960
add esp, 0x30
lea ecx, [esp + 0x60]
call fcn.100031c0
lea ecx, [esp + 0x48]
call fcn.100031c0
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.1007ab33
mov esp, ebp
pop ebp
ret
lea ecx, [esp + 0x48]
call fcn.10003ca0
mov esi, dword [esp + 0x14]
push esi
push eax
push dword [ebp + 0x14]
lea eax, [esp + 0x2c]
push dword [ebp + 0x10]
push eax
push dword [ebp + 8]
call fcn.100598f0
mov ecx, eax
push edi
mov eax, dword [ecx]
push dword [ebp + 0x1c]
mov dword [ebp + 0x10], eax
mov eax, dword [ecx + 4]
mov dword [ebp + 0x14], eax
push dword [ecx + 4]
lea eax, [esp + 0x44]
push dword [ecx]
push eax
push dword [ebp + 8]
call fcn.10059960
add esp, 0x30
xor edi, edi
jmp 0x10059377