Function at 0x5115a0
Capabilities:
Check for peb ntglobalflag flag
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x5b1158
mov eax, dword fs:[0]
push eax
sub esp, 0x70
mov eax, dword [0x615370]
xor eax, esp
mov dword [esp + 0x68], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x615370]
xor eax, esp
push eax
lea eax, [esp + 0x84]
mov dword fs:[0], eax
mov eax, dword [esp + 0x94]
mov ecx, dword [0x5e2204]
mov dx, word [0x5e2208]
mov ebp, dword [esp + 0x98]
mov dword [esp + 0x74], ecx
mov ecx, dword [eax + 0x18]
mov word [esp + 0x78], dx
mov edx, dword [eax]
xor esi, esi
mov dword [esp + 0x28], eax
mov dword [esp + 0x38], ebp
mov edi, ebp
mov dword [esp + 0x30], ecx
mov dword [esp + 0x2c], edx
test ebp, ebp
je 0x511b2f
jmp 0x511624
mov ebp, dword [esp + 0x38]
mov ebx, dword [esp + 0x9c]
cmp esi, ebx
jae 0x511b2f
lea eax, [esp + 0x74]
push eax
push edi
mov dword [esp + 0x3c], 0
call fcn.0058913b
add esp, 8
mov dword [esp + 0x24], eax
test eax, eax
jne 0x51182a
mov dword [esp + 0x24], edi
mov dword [esp + 0x34], 1
mov eax, edi
mov ebp, eax
sub ebp, edi
sar ebp, 1
jne 0x51166f
mov ebp, ebx
sub ebp, esi
cmp ebp, 1
jl 0x511b2f
xor ecx, ecx
lea eax, [ebp + 1]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00587d67
add esp, 4
push ebp
mov esi, eax
push edi
push esi
call fcn.0058aef6
add esp, 0xc
lea ecx, [esp + 0x14]
xor eax, eax
push ecx
mov ecx, esi
mov word [esi + ebp*2], ax
call fcn.00406c20
push esi
mov dword [esp + 0x90], 0
call fcn.00588add
add esp, 4
lea ebx, [esp + 0x14]
call fcn.004317d0
call fcn.00431750
mov eax, dword [esp + 0x14]
test eax, eax
je 0x511a23
mov ecx, eax
lea esi, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
test dx, dx
jne 0x5116e6
sub ecx, esi
sar ecx, 1
cmp ecx, 3
jb 0x511840
mov ecx, eax
lea esi, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
test dx, dx
jne 0x511703
sub ecx, esi
sar ecx, 1
cmp word [eax], 0x5b
jne 0x511840
cmp word [eax + ecx*2 - 2], 0x5d
jne 0x511840
lea edx, [esp + 0x18]
lea ecx, [eax + 2]
push edx
call fcn.00406c20
mov byte [esp + 0x8c], 1
mov eax, dword [esp + 0x18]
mov eax, dword [eax - 0xc]
lea edx, [esp + 0x18]
lea ecx, [eax - 1]
push edx
mov eax, 1
call fcn.0045dc10
lea ebx, [esp + 0x18]
call fcn.004317d0
call fcn.00431750
mov edi, dword [esp + 0x28]
mov eax, ebx
push eax
lea ecx, [esp + 0x60]
push ecx
mov esi, edi
call fcn.00511f60
mov ecx, dword [eax]
mov esi, dword [eax + 4]
mov ebx, dword [edi + 0x18]
mov eax, dword [edi]
test ecx, ecx
je 0x511789
cmp ecx, eax
je 0x51178e
call fcn.00588c45
cmp esi, ebx
jne 0x5117f8
lea edx, [esp + 0x3c]
push edx
call fcn.004d9400
push edi
lea ebx, [esp + 0x1c]
mov byte [esp + 0x90], 2
call fcn.00511e10
mov esi, eax
lea eax, [esp + 0x3c]
cmp esi, eax
je 0x5117da
mov eax, dword [esi + 0x18]
mov ecx, dword [esi]
mov edx, dword [eax]
push eax
push ecx
push edx
push ecx
lea ecx, [esp + 0x7c]
push ecx
mov eax, esi
call fcn.0048f180
lea ebx, [esp + 0x3c]
mov eax, esi
call fcn.0050fed0
lea esi, [esp + 0x3c]
mov byte [esp + 0x8c], 3
call fcn.0048f060
mov edx, dword [esp + 0x3c]
push edx
call fcn.005851f0
add esp, 4
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x68]
push ecx
mov esi, edi
call fcn.00511f60
mov edx, dword [eax]
mov eax, dword [eax + 4]
mov dword [esp + 0x30], eax
mov byte [esp + 0x8c], 0
mov eax, dword [esp + 0x18]
mov dword [esp + 0x2c], edx
add eax, 0xfffffff0
jmp 0x511aa7
cmp eax, edi
jne 0x511663
lea edi, [eax + 4]
mov esi, edi
sub esi, ebp
sar esi, 1
jmp 0x511b01
mov ecx, eax
lea esi, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
test dx, dx
jne 0x511845
sub ecx, esi
sar ecx, 1
cmp ecx, 2
jb 0x511a23
xor esi, esi
cmp word [eax], si
je 0x511a23
push 0x3d
push eax
call fcn.0058a1ca
add esp, 8
test eax, eax
je 0x511881
add eax, 2
inc esi
cmp word [eax], 0
jne 0x511868
mov eax, dword [esp + 0x14]
cmp esi, 1
jne 0x511a23
add eax, 0xfffffff0
call fcn.00406580
lea esi, [eax + 0x10]
mov dword [esp + 0x1c], esi
mov byte [esp + 0x8c], 4
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
call fcn.00406580
add eax, 0x10
mov dword [esp + 0x20], eax
mov byte [esp + 0x8c], 5
cmp dword [esi - 0xc], 0
jle 0x5119ca
push 0x3d
push esi
call fcn.0058a1ca
add esp, 8
test eax, eax
je 0x5119ca
sub eax, esi
sar eax, 1
mov edi, eax
cmp edi, 0xffffffff
je 0x5119ca
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, edi
or eax, ecx
jge 0x51190c
mov ecx, edi
lea eax, [esp + 0x1c]
call fcn.00406a80
mov esi, dword [esp + 0x1c]
test edi, edi
jl 0x511b12
cmp edi, dword [esi - 8]
jg 0x511b12
xor ecx, ecx
mov eax, esi
mov dword [esi - 0xc], edi
mov word [esi + edi*2], cx
lea edx, [eax + 2]
jmp 0x511930
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x511930
sub eax, edx
sar eax, 1
mov ebx, eax
push esi
lea eax, [esp + 0x20]
call fcn.00406b40
lea edx, [esp + 0x20]
lea eax, [edi + 1]
push edx
xor ecx, ecx
call fcn.0045dc10
lea ebx, [esp + 0x1c]
call fcn.004317d0
call fcn.00431750
lea ebx, [esp + 0x20]
call fcn.004317d0
call fcn.00431750
mov eax, dword [esp + 0x28]
mov esi, dword [esp + 0x2c]
mov edi, dword [eax + 0x18]
mov eax, dword [eax]
test esi, esi
je 0x51198b
cmp esi, eax
je 0x511990
call fcn.00588c45
mov ebx, dword [esp + 0x30]
cmp ebx, edi
je 0x5119c6
test esi, esi
jne 0x511a1f
call fcn.00588c45
cmp ebx, dword [esi + 0x18]
jne 0x5119af
call fcn.00588c45
lea edi, [ebx + 0x10]
lea ebx, [esp + 0x1c]
call fcn.0040e000
mov edi, eax
lea eax, [esp + 0x20]
call fcn.00406500
mov esi, dword [esp + 0x1c]
mov byte [esp + 0x8c], 4
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x5119f2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
add esi, 0xfffffff0
mov byte [esp + 0x8c], 0
lea ecx, [esi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x511ac0
mov ecx, dword [esi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push esi
call edx
jmp 0x511ac0
mov esi, dword [esi]
jmp 0x5119a5
call fcn.00511530
test eax, eax
je 0x511ac0
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
call fcn.00406580
lea ebp, [eax + 0x10]
mov dword [esp + 0x20], ebp
mov eax, dword [esp + 0x28]
mov byte [esp + 0x8c], 6
mov esi, dword [esp + 0x2c]
mov edi, dword [eax + 0x18]
mov eax, dword [eax]
test esi, esi
je 0x511a60
cmp esi, eax
je 0x511a65
call fcn.00588c45
mov ebx, dword [esp + 0x30]
cmp ebx, edi
je 0x511a9c
test esi, esi
jne 0x511b0b
call fcn.00588c45
cmp ebx, dword [esi + 0x18]
jne 0x511a84
call fcn.00588c45
lea edi, [ebx + 0x10]
lea ebx, [esp + 0x20]
call fcn.0040e000
push 0x5caac0
xor ebx, ebx
call fcn.00406b40
mov byte [esp + 0x8c], 0
lea eax, [ebp - 0x10]
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x511ac0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x8c], 0xffffffff
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
or edx, 0xffffffff
cmp dword [esp + 0x34], 0
lea ecx, [eax + 0xc]
jne 0x511b1c
mov edi, dword [esp + 0x24]
add edi, 4
mov esi, edi
sub esi, dword [esp + 0x38]
sar esi, 1
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x511b01
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test edi, edi
jne 0x511620
jmp 0x511b2f
mov esi, dword [esi]
jmp 0x511a7a
push 0x80070057
call fcn.00406af0
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x511b2f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
mov ecx, dword [esp + 0x84]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x68]
xor ecx, esp
call fcn.005886fc
add esp, 0x7c
ret 0xc