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

Disassembly:
sub esp, 0x78
push ebp
push esi
push edi
mov edi, dword [sym.imp.USER32.dll_GetSysColor]
push 0x14
mov esi, eax
call edi
push 5
mov ebp, eax
call edi
cmp ebp, 0xffffff
je 0x40cb78
cmp ebp, eax
jne 0x40cb78
push 0xf
jmp 0x40cb7a
push 0x14
call edi
push 0
mov dword [esp + 0x18], eax
call edi
mov edi, dword [0x4a8444]
mov edx, dword [0x4a8440]
mov ecx, dword [0x4a843c]
mov dword [esp + 0x18], eax
mov eax, dword [ebx + 0x344]
neg eax
sbb eax, eax
and eax, 0x4000
mov dword [esp + 0x40], edi
mov dword [esp + 0x20], eax
mov eax, dword [0x4a8438]
mov dword [esp + 0x3c], edx
add edi, 0x18
push edi
add edx, 0x30
push edx
mov dword [esp + 0x40], ecx
mov dword [esp + 0x3c], eax
add ecx, 0xffffffe8
push ecx
add eax, 0xffffffd0
push eax
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.USER32.dll_SetRect]
mov eax, dword [ebx + 0x340]
test eax, eax
mov edi, dword [sym.imp.USER32.dll_GetSystemMetrics]
jne 0x40cc00
mov eax, dword [ebx + 0x24]
test eax, eax
jge 0x40cc1a
push 0x15
call edi
imul eax, dword [ebx + 0x24]
neg eax
jmp 0x40cc1a
cmp eax, 1
jne 0x40cc18
mov eax, dword [ebx + 0x24]
test eax, eax
jge 0x40cc1a
push 0x14
call edi
imul eax, dword [ebx + 0x24]
neg eax
jmp 0x40cc1a
xor eax, eax
mov edx, dword [esp + 0x34]
add edx, eax
mov eax, dword [ebx + 0x340]
test eax, eax
mov dword [esp + 0x34], edx
jne 0x40cc41
mov eax, dword [ebx + 0x24]
test eax, eax
jge 0x40cc5b
push 0x15
call edi
imul eax, dword [ebx + 0x24]
neg eax
jmp 0x40cc5b
cmp eax, 1
jne 0x40cc59
mov eax, dword [ebx + 0x24]
test eax, eax
jge 0x40cc5b
push 0x14
call edi
imul eax, dword [ebx + 0x24]
neg eax
jmp 0x40cc5b
xor eax, eax
mov edi, dword [esp + 0x3c]
mov ecx, dword [esp + 0x8c]
sub edi, eax
mov dword [esp + 0x3c], edi
mov edi, dword [esp + 0x88]
push ecx
push edi
lea edx, [esp + 0x2c]
push edx
call dword [sym.imp.USER32.dll_PtInRect]
test eax, eax
jne 0x40cc8b
mov eax, dword [0x4a8450]
jmp 0x40ccb3
mov edx, dword [0x4a8448]
mov eax, dword [esp + 0x34]
sub edi, edx
cmp edi, eax
mov dword [esp + 0xc], edi
jge 0x40cca5
mov dword [esp + 0xc], eax
mov edi, eax
mov eax, dword [esp + 0x3c]
sub eax, dword [0x4a8420]
cmp edi, eax
jle 0x40ccb7
mov dword [esp + 0xc], eax
lea ecx, [esp + 0x44]
push ecx
push esi
call dword [sym.imp.USER32.dll_GetWindowRect]
cmp dword [ebx + 0x340], 1
jne 0x40ccec
mov eax, dword [esp + 0x44]
mov edx, dword [esp + 0x48]
mov ecx, dword [esp + 0x50]
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x44], edx
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x50], eax
push esi
call dword [sym.imp.USER32.dll_GetWindowDC]
push 1
mov ebp, eax
push ebx
push ebp
call fcn.0040a270
mov edx, dword [esp + 0x54]
mov edi, eax
mov eax, dword [esp + 0x50]
add esp, 0xc
sub edi, 4
neg edi
sbb edi, edi
neg edx
push edx
neg eax
push eax
lea ecx, [esp + 0x3c]
inc edi
push ecx
mov dword [esp + 0x28], edi
call dword [sym.imp.USER32.dll_OffsetRect]
mov edx, dword [esp + 0x44]
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x34]
sub eax, edx
mov edx, dword [esp + 0x40]
push edx
push eax
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x40]
push eax
push ecx
lea edx, [esp + 0x34]
push edx
call dword [sym.imp.USER32.dll_SetRect]
mov eax, dword [ebx + 0x340]
cmp eax, 1
mov dword [esp + 0x10], eax
jne 0x40cd80
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x30]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], eax
test edi, edi
je 0x40ce03
push 0xfffffffffffffff4
push esi
mov dword [esp + 0x5c], esi
call dword [sym.imp.USER32.dll_GetWindowLongA]
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x28]
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x80], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x68], ecx
mov ecx, dword [esp + 0x30]
push esi
mov dword [esp + 0x60], 0xfffff001
mov dword [esp + 0x64], 0x10001
mov dword [esp + 0x70], edx
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], ecx
mov dword [esp + 0x7c], 2
mov dword [esp + 0x68], ebp
mov dword [esp + 0x80], 0x20
call dword [sym.imp.USER32.dll_GetParent]
mov ecx, dword [esp + 0x58]
lea edx, [esp + 0x54]
push edx
push ecx
push 0x4e
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
jmp 0x40ce1f
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x14]
push edx
push eax
lea edi, [esp + 0x2c]
mov eax, ebp
call fcn.00409ab0
mov edi, dword [esp + 0x24]
add esp, 8
cmp dword [ebx + 0x340], 1
jne 0x40ce48
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x30]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x38]
push eax
mov eax, dword [0x4a8420]
push ecx
mov ecx, dword [esp + 0x14]
push edx
add eax, ecx
push eax
lea edx, [esp + 0x34]
push edx
call dword [sym.imp.USER32.dll_SetRect]
mov eax, dword [ebx + 0x340]
cmp eax, 1
mov dword [esp + 0x10], eax
jne 0x40ce9d
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x30]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], eax
test edi, edi
je 0x40cf20
push 0xfffffffffffffff4
push esi
mov dword [esp + 0x5c], esi
call dword [sym.imp.USER32.dll_GetWindowLongA]
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x28]
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x80], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x68], ecx
mov ecx, dword [esp + 0x30]
push esi
mov dword [esp + 0x60], 0xfffff001
mov dword [esp + 0x64], 0x10001
mov dword [esp + 0x70], edx
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], ecx
mov dword [esp + 0x7c], 3
mov dword [esp + 0x68], ebp
mov dword [esp + 0x80], 0x20
call dword [sym.imp.USER32.dll_GetParent]
mov ecx, dword [esp + 0x58]
lea edx, [esp + 0x54]
push edx
push ecx
push 0x4e
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
jmp 0x40cf3c
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x14]
push edx
push eax
lea edi, [esp + 0x2c]
mov eax, ebp
call fcn.00409ab0
mov edi, dword [esp + 0x24]
add esp, 8
cmp dword [ebx + 0x340], 1
jne 0x40cf65
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x30]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x40]
mov ecx, dword [0x4a8420]
mov edx, dword [esp + 0x38]
push eax
mov eax, dword [esp + 0x10]
add ecx, eax
push ecx
push edx
push eax
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.USER32.dll_SetRect]
mov eax, dword [ebx + 0x340]
cmp eax, 1
mov dword [esp + 0x10], eax
jne 0x40cfb7
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x30]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], eax
test edi, edi
je 0x40d03a
push 0xfffffffffffffff4
push esi
mov dword [esp + 0x5c], esi
call dword [sym.imp.USER32.dll_GetWindowLongA]
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x28]
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x80], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x68], ecx
mov ecx, dword [esp + 0x30]
push esi
mov dword [esp + 0x60], 0xfffff001
mov dword [esp + 0x64], 0x10001
mov dword [esp + 0x70], edx
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], ecx
mov dword [esp + 0x7c], 5
mov dword [esp + 0x68], ebp
mov dword [esp + 0x80], 1
call dword [sym.imp.USER32.dll_GetParent]
mov ecx, dword [esp + 0x58]
lea edx, [esp + 0x54]
push edx
push ecx
push 0x4e
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
jmp 0x40d092
mov eax, dword [ebx + 0x344]
test eax, eax
je 0x40d07f
push 0x10
call dword [sym.imp.USER32.dll_GetSysColor]
mov edi, dword [sym.imp.GDI32.dll_SetBkColor]
push eax
push ebp
call edi
push 0
push 0
push 0x41a3af
lea edx, [esp + 0x30]
push edx
push 2
push 0
push 0
push ebp
mov dword [esp + 0x3c], eax
call dword [sym.imp.GDI32.dll_ExtTextOutA]
mov eax, dword [esp + 0x1c]
push eax
push ebp
call edi
jmp 0x40d092
mov ecx, dword [esp + 0x20]
push ecx
lea edx, [esp + 0x28]
push edx
push ebp
call fcn.00409ba0
add esp, 0xc
cmp dword [ebx + 0x340], 1
jne 0x40d0bb
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x30]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], eax
push ebp
push esi
call dword [sym.imp.USER32.dll_ReleaseDC]
mov eax, dword [ebx + 0x14]
sub eax, dword [ebx + 0x10]
test eax, eax
jle 0x40d0f8
mov ecx, dword [0x4a8420]
mov edx, dword [esp + 0x3c]
mov edi, dword [ebx + 0x18]
sub edx, ecx
mov ecx, dword [esp + 0x34]
sub eax, edi
sub edx, ecx
inc eax
push edx
push eax
mov eax, dword [esp + 0x14]
sub eax, ecx
push eax
call dword [sym.imp.KERNEL32.dll_MulDiv]
mov edi, eax
jmp 0x40d100
mov edi, dword [esp + 0xc]
sub edi, dword [esp + 0x34]
cmp edi, dword [0x41db10]
je 0x40d125
mov ecx, dword [0x4a845c]
movzx eax, di
push 0
shl eax, 0x10
or eax, 5
push eax
push ecx
push esi
mov dword [ebx + 0x20], edi
call dword [sym.imp.USER32.dll_SendMessageA]
push 2
push ebx
push ebp
mov dword [0x41db10], edi
call fcn.0040a270
add esp, 0xc
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x78
ret