Function at 0x509d20
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x58c6b8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x88
push ebp
push esi
push edi
mov edi, dword [esp + 0xa4]
mov esi, ecx
test edi, edi
mov dword [esp + 0x28], esi
je 0x50a218
mov eax, dword [esi + 0x1c]
push edi
push eax
call dword [sym.imp.USER32.dll_IsChild]
test eax, eax
je 0x50a218
push 0
push 0
push 0x3e9
call fcn.00504ad0
mov edx, dword [esi + 0xdc]
lea ecx, [esp + 0xc]
push 0
push ecx
push edx
mov ecx, eax
call fcn.004ffb70
test eax, eax
je 0x50a218
mov ecx, dword [esp + 0xc]
push 1
push edi
call fcn.00500400
mov ebp, eax
cmp ebp, 0xffffffff
mov dword [esp + 0x20], ebp
je 0x50a218
mov eax, dword [esp + 0xc]
push 0
push 0
push ebp
lea ecx, [eax + 0x14]
call fcn.004ff520
mov ecx, dword [eax]
push ecx
push 0x3ea
call fcn.00504ad0
mov esi, eax
test esi, esi
je 0x50a218
push ebx
mov ebx, dword [esi + 0x14]
and ebx, 0x6000
push edi
neg ebx
sbb ebx, ebx
neg ebx
mov dword [esp + 0x24], ebx
call dword [sym.imp.USER32.dll_GetParent]
mov edx, dword [esp + 0x10]
xor edi, edi
push edi
push ebp
lea ecx, [edx + 0x14]
mov dword [esp + 0x30], eax
call fcn.004ff520
mov ecx, dword [esi + 0x14]
test ch, 0x40
je 0x509e11
mov dword [esp + 0x1c], edi
jmp 0x509e35
mov ecx, dword [esp + 0x10]
push eax
add ecx, 0x14
call fcn.0050a270
mov edx, dword [eax]
lea esi, [eax + edx + 4]
push esi
call fcn.004ecf30
mov eax, dword [eax + esi + 8]
add esp, 4
mov dword [esp + 0x1c], eax
lea ecx, [esp + 0x30]
call fcn.004ec540
mov esi, 0x6fc824
mov dword [esp + 0x30], esi
lea ecx, [esp + 0x58]
mov dword [esp + 0xa0], edi
call fcn.004ec540
mov dword [esp + 0x58], esi
lea ecx, [esp + 0x44]
mov byte [esp + 0xa0], 1
call fcn.004ec540
mov dword [esp + 0x44], esi
mov ecx, dword [esp + 0x10]
mov byte [esp + 0xa0], 2
mov esi, dword [ecx + 0x18]
dec esi
cmp esi, edi
mov dword [esp + 0x18], esi
jle 0x50a04f
mov edx, dword [esp + 0x10]
push 0
push esi
lea ecx, [edx + 0x14]
call fcn.004ff520
mov ebp, eax
mov eax, dword [esp + 0x10]
push esi
lea ecx, [eax + 0x14]
call fcn.004ffd50
cmp eax, 1
jne 0x509eb9
dec esi
mov dword [esp + 0x18], esi
jmp 0x50a043
mov ecx, dword [ebp]
push 0
push ecx
push 0x3ea
call fcn.00504ad0
lea esi, [ebp + 0x18]
mov ebx, eax
push esi
call fcn.004ecf30
add esi, eax
push esi
call fcn.004ecf30
mov edx, dword [esp + 0x18]
add esp, 8
add esi, eax
lea ecx, [edx + 0x14]
push ebp
mov esi, dword [esi]
call fcn.0050a270
mov ecx, dword [eax]
lea edi, [eax + ecx + 4]
push edi
call fcn.004ecf30
mov edx, dword [eax + edi + 4]
add esp, 4
test ebx, ebx
mov dword [esp + 0x14], edx
je 0x50a034
test esi, esi
je 0x50a034
mov eax, dword [esi + 0x1c]
push eax
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x50a034
mov ecx, dword [esi + 0x1c]
push ecx
call dword [sym.imp.USER32.dll_IsWindowVisible]
cmp eax, 1
jne 0x50a034
mov ecx, esi
call fcn.00581be6
cmp eax, 1
jne 0x50a034
mov ebx, dword [ebx + 0x14]
test ebx, 0x18000
jne 0x50a034
test byte [esp + 0x14], 4
je 0x50a034
mov eax, dword [esp + 0xb0]
test eax, eax
je 0x509f8e
test bh, 4
je 0x50a034
mov edx, dword [esi + 0x1c]
push edx
call dword [sym.imp.USER32.dll_GetParent]
cmp eax, dword [esp + 0x28]
jne 0x50a034
mov eax, dword [esp + 0xb4]
test eax, eax
je 0x509fac
mov ecx, dword [esi + 0x1c]
push ecx
push eax
call dword [sym.imp.USER32.dll_IsChild]
test eax, eax
je 0x50a034
mov edx, dword [esp + 0x10]
push ebp
lea ecx, [edx + 0x14]
call fcn.0050a270
mov ecx, dword [eax]
lea edi, [eax + ecx + 4]
push edi
call fcn.004ecf30
mov ebx, dword [eax + edi + 8]
mov eax, dword [esp + 0x44]
shr eax, 2
add esp, 4
dec eax
js 0x509fe9
mov edx, dword [esp + 0x38]
lea ecx, [edx + eax*4]
cmp dword [ecx], ebx
jle 0x509fe9
dec eax
sub ecx, 4
test eax, eax
jge 0x509fdd
mov ecx, dword [esp + 0x18]
inc eax
lea edx, [esp + 0x14]
push 4
lea edi, [eax*4]
mov dword [esp + 0x18], ecx
push edx
push edi
lea ecx, [esp + 0x50]
call fcn.004ecbd0
lea eax, [esp + 0x14]
push 4
push eax
push edi
lea ecx, [esp + 0x64]
mov dword [esp + 0x20], esi
call fcn.004ecbd0
lea ecx, [esp + 0x14]
push 4
push ecx
push edi
lea ecx, [esp + 0x3c]
mov dword [esp + 0x20], ebx
call fcn.004ecbd0
mov eax, dword [esp + 0x18]
mov ebx, dword [esp + 0x20]
dec eax
mov dword [esp + 0x18], eax
mov esi, eax
test esi, esi
jg 0x509e8c
mov ebp, dword [esp + 0x24]
mov eax, dword [esp + 0x54]
mov edi, eax
shr edi, 2
test edi, edi
jle 0x50a1d0
cmp ebx, 1
jne 0x50a0c8
mov eax, dword [esp + 0x40]
mov edx, dword [esp + 0x38]
mov ecx, dword [esp + 0xac]
neg eax
sbb eax, eax
and eax, edx
cmp ecx, ebx
jne 0x50a0a3
xor esi, esi
test edi, edi
jle 0x50a1d0
mov edx, dword [esp + 0x1c]
mov ecx, dword [eax]
cmp ecx, edx
jge 0x50a11a
inc esi
add eax, 4
cmp esi, edi
jl 0x50a088
jmp 0x50a1d0
lea esi, [edi - 1]
test esi, esi
jl 0x50a1d0
lea eax, [eax + esi*4]
mov ecx, dword [esp + 0x1c]
mov edx, dword [eax]
cmp edx, ecx
jl 0x50a11a
dec esi
sub eax, 4
test esi, esi
jge 0x50a0b1
jmp 0x50a1d0
mov ecx, dword [esp + 0x4c]
push ebp
neg eax
sbb eax, eax
push edi
and eax, ecx
mov ebx, eax
push ebx
call fcn.004ecea0
mov esi, eax
add esp, 0xc
cmp esi, 0xffffffff
jne 0x50a0fc
push ebp
push edi
push ebx
call fcn.0050d180
mov esi, eax
add esp, 0xc
cmp esi, 0xffffffff
je 0x50a232
cmp dword [esp + 0xac], 1
jne 0x50a114
cmp dword [ebx + esi*4], ebp
jne 0x50a11a
inc esi
cmp esi, edi
jne 0x50a11a
xor esi, esi
jmp 0x50a123
dec esi
jns 0x50a11a
lea esi, [edi - 1]
cmp esi, 0xffffffff
je 0x50a1d0
mov edx, dword [esp + 0x60]
mov eax, dword [esp + 0xa8]
mov ebp, dword [edx + esi*4]
mov ebx, dword [ebp + 0x1c]
cmp ebx, eax
je 0x50a1d0
cmp dword [esp + 0xb0], 1
jne 0x50a1be
push ebx
call dword [sym.imp.USER32.dll_GetParent]
mov ecx, dword [esp + 0x10]
push eax
call fcn.005005c0
mov eax, dword [ebp + 0x1c]
push 0
push 1
push 0xf1
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x4c]
mov edi, dword [ecx + 0xdc]
mov eax, dword [edx + esi*4]
mov ecx, dword [esp + 0x10]
push eax
add ecx, 0x14
call fcn.004ff570
mov dword [esp + 0x70], eax
xor eax, eax
lea edx, [esp + 0x6c]
push eax
push edx
push 0x7d8
mov dword [esp + 0x78], edi
mov dword [esp + 0x80], eax
mov dword [esp + 0x84], eax
mov dword [esp + 0x9c], eax
mov dword [esp + 0xa0], eax
call fcn.00504ad0
push ebx
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x50a1d0
mov ecx, ebp
call fcn.00581c28
mov esi, 0x6fc740
lea ecx, [esp + 0x44]
mov byte [esp + 0xa0], 1
mov dword [esp + 0x44], esi
call fcn.004ec740
lea ecx, [esp + 0x58]
mov byte [esp + 0xa0], 0
mov dword [esp + 0x58], esi
call fcn.004ec740
lea ecx, [esp + 0x30]
mov dword [esp + 0xa0], 0xffffffff
mov dword [esp + 0x30], esi
call fcn.004ec740
pop ebx
mov ecx, dword [esp + 0x94]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
add esp, 0x94
ret 0x10
cmp dword [esp + 0xac], 1
jne 0x50a117
xor esi, esi
jmp 0x50a123