Function at 0x51c100
Capabilities:
Access peb ldr_data

Disassembly:
push 0xffffffffffffffff
push 0x5a7158
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x30
push ebp
push edi
mov edi, ecx
xor ebp, ebp
mov ecx, dword [esp + 0x48]
lea eax, [esp + 0x48]
push ebp
push eax
push ecx
lea ecx, [edi + 0x104]
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], ebp
mov dword [esp + 0x1c], ebp
call fcn.00517000
test eax, eax
jne 0x51c16c
push ebp
push 0xcf9f5c
mov ecx, edi
call fcn.0051b380
mov eax, dword [esp + 0xc]
mov edx, dword [esp + 0x10]
pop edi
pop ebp
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
add esp, 0x3c
ret 0x10
mov edx, dword [esp + 0x48]
push ebx
mov ebx, dword [esp + 0x50]
push esi
push ebp
push ebp
push ebx
lea ecx, [edx + 0x14]
call fcn.00516b80
lea ecx, [esp + 0x2c]
mov esi, eax
call fcn.0050e960
push ebx
mov dword [esp + 0x4c], ebp
call fcn.005171b0
add esp, 4
test eax, eax
je 0x51c20f
add esi, 0x18
push esi
call fcn.0050f360
add esi, eax
push esi
call fcn.0050f360
mov ecx, dword [esp + 0x60]
add esp, 8
cmp ecx, 3
lea eax, [esi + eax + 8]
ja case.default.0x51c274
jmp dword [ecx*4 + 0x51c550]
add eax, 4
push eax
call fcn.00517cf0
add esp, 4
mov dword [esp + 0x14], eax
jmp 0x51c516
mov eax, dword [eax]
shr eax, 2
and eax, 1
mov dword [esp + 0x14], eax
jmp 0x51c516
mov eax, dword [eax]
shr eax, 1
and eax, 1
mov dword [esp + 0x14], eax
jmp 0x51c516
mov eax, dword [eax]
not eax
and eax, 1
mov dword [esp + 0x14], eax
jmp 0x51c516
mov eax, dword [esi]
push ebp
push eax
mov ecx, edi
call fcn.0051b4c0
mov ebx, dword [esp + 0x58]
mov ebp, eax
lea edi, [esi + 0x18]
mov edx, dword [ebp + 0x28]
lea ecx, [ebx + ebx*4]
mov esi, edi
lea eax, [edx + ecx*4]
push esi
mov dword [esp + 0x5c], eax
call fcn.0050f360
add esi, eax
push esi
call fcn.0050f360
add esi, eax
add esp, 8
mov esi, dword [esi]
test esi, esi
je 0x51c260
mov ecx, dword [esi + 0x1c]
push ecx
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x51c260
mov eax, 1
jmp 0x51c262
xor eax, eax
cmp ebx, 8
jge 0x51c4c7
cmp ebx, 7
ja case.default.0x51c274
jmp dword [ebx*4 + 0x51c560]
cmp eax, 1
jne 0x51c2d4
mov eax, dword [esi + 0x1c]
lea edx, [esp + 0x1c]
push edx
push eax
call dword [sym.imp.USER32.dll_GetWindowRect]
mov ecx, dword [esi + 0x1c]
push ecx
call dword [sym.imp.USER32.dll_GetParent]
push eax
call fcn.0059cbb7
mov edi, eax
test edi, edi
je 0x51c2bf
mov ecx, esi
call fcn.0059f426
test eax, 0x80000000
jne 0x51c2bf
lea edx, [esp + 0x1c]
mov ecx, edi
push edx
call fcn.005a1d25
mov eax, dword [esp + 0x1c]
test ebx, ebx
je 0x51c2cb
mov eax, dword [esp + 0x20]
mov dword [esp + 0x14], eax
jmp 0x51c516
push edi
call fcn.0050f360
add edi, eax
push edi
call fcn.0050f360
add esp, 8
cmp ebx, 1
lea eax, [edi + eax + 4]
jne 0x51c2f1
add eax, 4
mov eax, dword [eax]
mov dword [esp + 0x14], eax
jmp 0x51c516
cmp eax, 1
jne 0x51c33b
mov ecx, dword [esi + 0x1c]
lea eax, [esp + 0x1c]
push eax
push ecx
call dword [sym.imp.USER32.dll_GetWindowRect]
cmp ebx, 2
jne 0x51c328
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x1c]
sub eax, ecx
mov dword [esp + 0x14], eax
jmp 0x51c516
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x20]
sub eax, ecx
mov dword [esp + 0x14], eax
jmp 0x51c516
push edi
call fcn.0050f360
add edi, eax
push edi
call fcn.0050f360
add esp, 8
cmp ebx, 3
lea eax, [edi + eax + 0xc]
jne 0x51c2f1
add eax, 4
mov eax, dword [eax]
mov dword [esp + 0x14], eax
jmp 0x51c516
push edi
call fcn.0050f360
add edi, eax
push edi
call fcn.0050f360
mov edx, dword [edi + eax + 0x1c]
lea eax, [edi + eax + 0x1c]
mov ecx, dword [eax + edx*4 + 4]
lea eax, [eax + edx*4 + 4]
lea eax, [ecx + eax + 4]
push eax
call fcn.00517cf0
add esp, 0xc
mov dword [esp + 0x14], eax
jmp 0x51c516
cmp eax, 1
jne 0x51c3b8
mov edx, dword [esi + 0x1c]
push edx
call dword [sym.imp.USER32.dll_IsWindowVisible]
xor ecx, ecx
test eax, eax
setne cl
mov eax, ecx
mov dword [esp + 0x14], eax
jmp 0x51c516
push edi
call fcn.0050f360
add edi, eax
push edi
call fcn.0050f360
mov edx, dword [edi + eax + 0x1c]
lea eax, [edi + eax + 0x1c]
mov ecx, dword [eax + edx*4 + 4]
lea eax, [eax + edx*4 + 4]
lea esi, [ecx + eax + 4]
push esi
call fcn.0050f360
mov eax, dword [eax + esi + 4]
add esp, 0xc
and eax, 1
mov dword [esp + 0x14], eax
jmp 0x51c516
cmp eax, 1
jne 0x51c40d
mov ecx, esi
call fcn.0059f584
neg eax
sbb eax, eax
inc eax
mov dword [esp + 0x14], eax
jmp 0x51c516
push edi
call fcn.0050f360
add edi, eax
push edi
call fcn.0050f360
mov edx, dword [edi + eax + 0x1c]
lea eax, [edi + eax + 0x1c]
mov ecx, dword [eax + edx*4 + 4]
lea eax, [eax + edx*4 + 4]
lea esi, [eax + ecx + 4]
push esi
call fcn.0050f360
mov eax, dword [eax + esi + 4]
add esp, 0xc
shr eax, 1
and eax, 1
mov dword [esp + 0x14], eax
jmp 0x51c516
push edi
call fcn.0050f360
add edi, eax
push edi
call fcn.0050f360
mov edx, dword [edi + eax + 0x1c]
lea eax, [edi + eax + 0x1c]
add esp, 8
mov ecx, dword [eax + edx*4 + 4]
lea eax, [eax + edx*4 + 4]
cmp ecx, 4
jb 0x51c4b4
mov dword [esp + 0x3c], 0
mov ecx, dword [eax]
add eax, 4
push ecx
push eax
lea ecx, [esp + 0x34]
call fcn.0050f090
mov esi, dword [esp + 0x3c]
mov eax, dword [esp + 0x34]
neg esi
sbb esi, esi
and esi, eax
mov edx, dword [esi]
push edx
call fcn.005236a0
mov dword [esi], eax
mov eax, dword [esp + 0x40]
push eax
push esi
call fcn.00517d80
add esp, 0xc
mov dword [esp + 0x14], eax
jmp 0x51c516
add eax, 4
push ecx
push eax
call fcn.00517d80
add esp, 8
mov dword [esp + 0x14], eax
jmp 0x51c516
test eax, eax
jne 0x51c4da
mov ecx, dword [esp + 0x10]
push eax
push 0xcf9f48
call fcn.0051b380
push 6
call dword [ebp + 0x2c]
lea edx, [esp + 0x1c]
xor ecx, ecx
add ebx, 0xfffffff8
push edx
mov dword [esp + 0x20], ecx
push ebx
push esi
mov dword [esp + 0x2c], ecx
call eax
mov edx, dword [esp + 0x5c]
lea eax, [esp + 0x14]
lea ecx, [esp + 0x1c]
push eax
mov eax, dword [esp + 0x5c]
push ecx
mov ecx, dword [esp + 0x18]
push edx
push eax
call fcn.0051ca20
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x18]
lea ecx, [esp + 0x2c]
mov esi, eax
mov dword [esp + 0x48], 0xffffffff
mov dword [esp + 0x2c], 0xcd5fa8
call fcn.0050eb60
mov ecx, dword [esp + 0x40]
mov eax, esi
pop esi
mov edx, edi
pop ebx
pop edi
pop ebp
mov dword fs:[0], ecx
add esp, 0x3c
ret 0x10