Function at 0x509b80
Capabilities:
Access peb ldr_data

Disassembly:
push 0xffffffffffffffff
push 0x51e9dc
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x2a0
push esi
push edi
xor edi, edi
mov dword [esp + 0x38], edi
mov dword [esp + 0x3c], edi
mov dword [esp + 0x40], edi
mov dword [esp + 0x2b0], edi
mov dword [esp + 8], edi
mov dword [esp + 0xc], edi
mov dword [esp + 0x10], edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], edi
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], edi
mov esi, dword [esp + 0x2b8]
push edi
mov byte [esp + 0x2b4], 3
mov eax, dword [esi + 0x1024]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
sete al
test al, al
je 0x509d16
mov eax, dword [esp + 0x2c]
xor esi, esi
cmp eax, edi
mov byte [esp + 0x2b0], 2
jbe 0x509c31
cmp esi, eax
jae 0x509c2c
mov ecx, dword [esp + 0x28]
mov ecx, dword [ecx + esi*4]
cmp ecx, edi
je 0x509c2c
push 1
call fcn.0050b730
mov eax, dword [esp + 0x2c]
inc esi
cmp esi, eax
jb 0x509c16
mov edx, dword [esp + 0x28]
push edx
call fcn.0050e97b
mov eax, dword [esp + 0x20]
add esp, 4
xor esi, esi
cmp eax, edi
mov byte [esp + 0x2b0], 1
jbe 0x509c6f
cmp esi, eax
jae 0x509c6a
mov ecx, dword [esp + 0x18]
mov ecx, dword [ecx + esi*4]
cmp ecx, edi
je 0x509c6a
push 1
call fcn.0050b730
mov eax, dword [esp + 0x1c]
inc esi
cmp esi, eax
jb 0x509c54
mov edx, dword [esp + 0x18]
push edx
call fcn.0050e97b
mov eax, dword [esp + 0x10]
add esp, 4
xor esi, esi
cmp eax, edi
mov byte [esp + 0x2b0], 0
jbe 0x509cae
push esi
lea ecx, [esp + 0xc]
call fcn.0050b390
cmp eax, edi
je 0x509ca5
push 1
mov ecx, eax
call fcn.0050b730
mov eax, dword [esp + 0xc]
inc esi
cmp esi, eax
jb 0x509c8e
mov eax, dword [esp + 8]
push eax
call fcn.0050e97b
mov eax, dword [esp + 0x40]
add esp, 4
xor esi, esi
cmp eax, edi
mov dword [esp + 0x2b0], 0xffffffff
jbe 0x509cf0
push esi
lea ecx, [esp + 0x3c]
call fcn.0050b390
cmp eax, edi
je 0x509ce7
push 1
mov ecx, eax
call fcn.0050b730
mov eax, dword [esp + 0x3c]
inc esi
cmp esi, eax
jb 0x509cd0
mov ecx, dword [esp + 0x38]
push ecx
call fcn.0050e97b
add esp, 4
xor al, al
pop edi
pop esi
mov ecx, dword [esp + 0x2a0]
mov dword fs:[0], ecx
add esp, 0x2ac
ret
mov ecx, dword [esi]
lea edx, [esp + 0x60]
lea eax, [esp + 0x50]
push edx
push eax
push ecx
call fcn.0050d4f0
add esp, 0xc
test al, al
je 0x509d3d
test byte [esp + 0x80], 0x10
jne 0x509e54
xor ecx, ecx
push edi
xor eax, eax
push 0x524114
push ecx
push eax
lea edx, [esp + 0x58]
lea eax, [esi + 0x1048]
push edx
push eax
push 6
lea ecx, [esi + 0x101c]
mov dword [esp + 0x64], edi
mov dword [esp + 0x68], edi
call fcn.00504ca0
mov eax, dword [esp + 0x2c]
xor esi, esi
cmp eax, edi
mov byte [esp + 0x2b0], 2
jbe 0x509d9c
push esi
lea ecx, [esp + 0x2c]
call fcn.0050b390
cmp eax, edi
je 0x509d93
push 1
mov ecx, eax
call fcn.0050b730
mov eax, dword [esp + 0x2c]
inc esi
cmp esi, eax
jb 0x509d7c
mov ecx, dword [esp + 0x28]
push ecx
call fcn.0050e97b
mov eax, dword [esp + 0x20]
add esp, 4
xor esi, esi
cmp eax, edi
mov byte [esp + 0x2b0], 1
jbe 0x509ddb
push esi
lea ecx, [esp + 0x1c]
call fcn.0050b390
cmp eax, edi
je 0x509dd2
push 1
mov ecx, eax
call fcn.0050b730
mov eax, dword [esp + 0x1c]
inc esi
cmp esi, eax
jb 0x509dbb
mov edx, dword [esp + 0x18]
push edx
call fcn.0050e97b
mov eax, dword [esp + 0x10]
add esp, 4
xor esi, esi
cmp eax, edi
mov byte [esp + 0x2b0], 0
jbe 0x509e1a
push esi
lea ecx, [esp + 0xc]
call fcn.0050b390
cmp eax, edi
je 0x509e11
push 1
mov ecx, eax
call fcn.0050b730
mov eax, dword [esp + 0xc]
inc esi
cmp esi, eax
jb 0x509dfa
mov eax, dword [esp + 8]
push eax
call fcn.0050e97b
add esp, 4
lea ecx, [esp + 0x38]
mov dword [esp + 0x2b0], 0xffffffff
call fcn.0050b200
pop edi
xor al, al
pop esi
mov ecx, dword [esp + 0x2a0]
mov dword fs:[0], ecx
add esp, 0x2ac
ret
lea ecx, [esp + 0x28]
push ebx
lea edx, [esp + 0x3c]
push ecx
lea eax, [esp + 0x20]
push edx
lea ecx, [esp + 0x14]
push eax
lea edx, [esp + 0x70]
push ecx
lea eax, [esp + 0x64]
push edx
push eax
push esi
call fcn.00509210
lea ecx, [esp + 0x70]
mov bl, al
push ecx
call fcn.0050d570
add esi, 0x101c
add esp, 0x20
lea edi, [esi + 0x14]
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 0x5240f4
mov ecx, esi
call fcn.004fb950
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea ecx, [esp + 0x2c]
mov byte [esp + 0x2b4], 2
call fcn.0050b200
lea ecx, [esp + 0x1c]
mov byte [esp + 0x2b4], 1
call fcn.0050b200
lea ecx, [esp + 0xc]
mov byte [esp + 0x2b4], 0
call fcn.0050b200
lea ecx, [esp + 0x3c]
mov dword [esp + 0x2b4], 0xffffffff
call fcn.0050b200
mov ecx, dword [esp + 0x2ac]
mov al, bl
pop ebx
pop edi
pop esi
mov dword fs:[0], ecx
add esp, 0x2ac
ret