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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4c87a0
mov eax, dword fs:[0]
push eax
sub esp, 0x80
push ebx
push esi
push edi
mov eax, dword [0x500770]
xor eax, esp
push eax
lea eax, [esp + 0x90]
mov dword fs:[0], eax
mov esi, ecx
mov edi, dword [ebp + 8]
mov eax, dword [edi + 0x18]
push eax
call fcn.00494a4a
mov ebx, dword [sym.imp.USER32.dll_GetSysColor]
push 5
mov dword [esp + 0x30], eax
call ebx
push 0xd
mov dword [esp + 0x24], eax
call ebx
push 8
mov dword [esp + 0x34], eax
call ebx
mov dword [esp + 0x34], eax
call fcn.00491248
xor ecx, ecx
xor ebx, ebx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x40d5fe
push 0x80004005
call fcn.00401ee0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x1c], eax
mov dword [esp + 0x98], ebx
mov eax, dword [edi + 8]
mov ecx, dword [esi + 0x20]
push ebx
push eax
push 0x199
push ecx
call dword [sym.imp.USER32.dll_SendMessageW]
cmp eax, ebx
mov dword [esp + 0x24], eax
je 0x40da04
cmp eax, 0xffffffff
je 0x40da04
mov ecx, dword [edi + 0x10]
mov edx, ecx
and edx, 1
mov dword [esp + 0x18], edx
mov edx, ecx
and edx, 0x10
test cl, 4
mov dword [esp + 0x38], edx
jne 0x40d662
test byte [eax + 0x10], 1
mov dword [esp + 0x14], ebx
je 0x40d66a
mov dword [esp + 0x14], 1
mov ebx, dword [sym.imp.USER32.dll_CopyRect]
add edi, 0x1c
push edi
lea edx, [esp + 0x80]
push edx
call ebx
push edi
lea eax, [esp + 0x60]
push eax
call ebx
push edi
lea ecx, [esp + 0x50]
push ecx
call ebx
push edi
lea edx, [esp + 0x40]
push edx
call ebx
mov ecx, dword [esp + 0x2c]
push 1
call fcn.0049433d
cmp dword [esi + 0x58], 0
je 0x40d6c7
mov eax, dword [esi + 0x5c]
mov ecx, dword [esp + 0x5c]
lea edx, [eax + ecx + 6]
mov eax, dword [esi + 0x60]
mov ecx, dword [esp + 0x60]
mov dword [esp + 0x64], edx
lea edx, [eax + ecx + 4]
mov dword [esp + 0x68], edx
jmp 0x40d6da
push 0
push 0
push 0
push 0
lea eax, [esp + 0x6c]
push eax
call dword [sym.imp.USER32.dll_SetRect]
mov ecx, dword [esp + 0x64]
mov dword [esp + 0x4c], ecx
call fcn.00491248
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40d6fc
push 0x80004005
call fcn.00401ee0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea edi, [eax + 0x10]
mov dword [esp + 0x28], edi
xor ebx, ebx
push ebx
push ebx
mov byte [esp + 0xa0], 1
mov ecx, dword [esi + 0x20]
push 0x18b
push ecx
call dword [sym.imp.USER32.dll_SendMessageW]
test eax, eax
jle 0x40d7c5
nop
mov edx, dword [esi + 0x20]
push 0
push ebx
push 0x18a
push edx
call dword [sym.imp.USER32.dll_SendMessageW]
mov ecx, dword [edi - 8]
mov edx, 1
sub edx, dword [edi - 4]
sub ecx, eax
or ecx, edx
jge 0x40d761
push eax
lea ecx, [esp + 0x2c]
call fcn.00401da0
mov edi, dword [esp + 0x28]
mov eax, dword [esi + 0x20]
push edi
push ebx
push 0x189
push eax
call dword [sym.imp.USER32.dll_SendMessageW]
test edi, edi
jne 0x40d77a
xor eax, eax
jmp 0x40d795
mov eax, edi
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40d780
sub eax, edx
sar eax, 1
js 0x40d8ae
cmp eax, dword [edi - 8]
jg 0x40d8ae
push 0
mov dword [edi - 0xc], eax
push 0
mov word [edi + eax*2], 0
mov ecx, dword [esi + 0x20]
push 0x18b
push ecx
add ebx, 1
call dword [sym.imp.USER32.dll_SendMessageW]
cmp ebx, eax
jl 0x40d730
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 8]
lea edx, [esp + 0x1c]
push edx
push ecx
mov ecx, esi
call fcn.0048fc09
mov edx, dword [esp + 0x4c]
mov ecx, dword [esp + 0x54]
mov eax, dword [esp + 0x50]
mov ebx, dword [esp + 0x2c]
mov dword [esp + 0x3c], edx
mov edx, dword [esp + 0x58]
mov dword [esp + 0x44], ecx
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x48], edx
mov dword [esp + 0x40], eax
mov edx, dword [ecx + 0xc]
mov eax, dword [ebx]
mov eax, dword [eax + 0x68]
or edx, 0x450
push edx
mov edx, dword [esp + 0x20]
lea ecx, [esp + 0x40]
push ecx
push 0xffffffffffffffff
push edx
mov ecx, ebx
call eax
mov eax, dword [esp + 0x58]
sub eax, dword [esp + 0x50]
lea ecx, [esp + 0x3c]
sub eax, dword [esp + 0x48]
add eax, dword [esp + 0x40]
cdq
sub eax, edx
sar eax, 1
push eax
push 0
push ecx
call dword [sym.imp.USER32.dll_OffsetRect]
cmp dword [esi + 0x58], 0
je 0x40d88d
mov ecx, dword [esp + 0x18]
test ecx, ecx
je 0x40d861
cmp byte [esi + 0x54], 0
jne 0x40d861
cmp dword [esp + 0x14], 0
mov eax, dword [esp + 0x30]
je 0x40d865
mov eax, dword [esp + 0x20]
mov edx, dword [esi]
mov edx, dword [edx + 0x154]
push eax
mov eax, dword [esp + 0x18]
push ecx
push eax
lea ecx, [esp + 0x68]
push ecx
mov ecx, dword [ebp + 8]
lea eax, [esp + 0x8c]
push eax
mov eax, dword [ecx + 8]
push ebx
push eax
mov ecx, esi
call edx
cmp dword [esp + 0x14], 0
je 0x40d8b8
mov eax, dword [ebx]
add eax, 0x30
push 0x11
mov dword [esp + 0x38], eax
call dword [sym.imp.USER32.dll_GetSysColor]
push eax
mov eax, dword [esp + 0x38]
mov edx, dword [eax]
jmp 0x40d8de
push 0x80070057
call fcn.00401ee0
cmp dword [esp + 0x18], 0
mov edx, dword [ebx]
mov eax, dword [esp + 0x34]
je 0x40d8da
not eax
and eax, 0xffffff
push eax
mov eax, dword [edx + 0x30]
mov ecx, ebx
call eax
mov eax, dword [esp + 0x30]
jmp 0x40d8e6
mov edx, dword [edx + 0x30]
push eax
mov ecx, ebx
call edx
mov eax, dword [esp + 0x20]
cmp byte [esi + 0x54], 2
mov ecx, dword [esp + 0x14]
mov edx, dword [esi]
mov edx, dword [edx + 0x150]
push eax
mov eax, dword [esp + 0x1c]
push eax
push ecx
lea ecx, [esp + 0x88]
lea eax, [esp + 0x48]
je 0x40d90e
lea eax, [esp + 0x58]
push eax
mov eax, dword [ebp + 8]
push ecx
mov ecx, dword [eax + 8]
push ebx
push ecx
mov ecx, esi
call edx
cmp dword [esi + 0x58], 0
je 0x40d955
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
mov eax, dword [esi]
mov eax, dword [eax + 0x158]
push ecx
mov ecx, dword [esp + 0x28]
push edx
mov edx, dword [ecx + 8]
push edx
lea ecx, [esp + 0x68]
push ecx
mov ecx, dword [ebp + 8]
lea edx, [esp + 0x8c]
push edx
mov edx, dword [ecx + 8]
push ebx
push edx
mov ecx, esi
call eax
mov ecx, dword [esp + 0x40]
mov eax, dword [esp + 0x3c]
mov edx, dword [esp + 0x48]
mov dword [esp + 0x70], ecx
mov ecx, dword [esp + 0x44]
mov dword [esp + 0x6c], eax
add ecx, 4
mov dword [esp + 0x74], ecx
mov ecx, dword [esp + 0x24]
add eax, 4
mov dword [esp + 0x78], edx
mov dword [esp + 0x6c], eax
mov edx, dword [ecx + 0xc]
mov eax, dword [ebx]
mov eax, dword [eax + 0x68]
or edx, 0x50
push edx
mov edx, dword [esp + 0x20]
lea ecx, [esp + 0x70]
push ecx
push 0xffffffffffffffff
push edx
mov ecx, ebx
call eax
cmp dword [esp + 0x38], 0
je 0x40d9e0
cmp dword [esp + 0x14], 0
jne 0x40d9e0
movzx eax, byte [esi + 0x54]
sub eax, 0
je 0x40d9d1
sub eax, 1
je 0x40d9c6
mov edx, dword [ebx + 4]
lea ecx, [esp + 0x3c]
push ecx
push edx
jmp 0x40d9da
mov ecx, dword [ebx + 4]
lea eax, [esp + 0x4c]
push eax
push ecx
jmp 0x40d9da
mov eax, dword [ebx + 4]
lea edx, [esp + 0x7c]
push edx
push eax
call dword [sym.imp.USER32.dll_DrawFocusRect]
add edi, 0xfffffff0
mov byte [esp + 0x98], 0
lea ecx, [edi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40da04
mov ecx, dword [edi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push edi
call edx
mov dword [esp + 0x98], 0xffffffff
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40da2f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x90]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4