Function at 0x40a560
Capabilities:
Log keystrokes via polling
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4637b6
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x6e0
push ebx
mov ebx, dword [ebp + 8]
cmp ebx, 0x105
push esi
push edi
mov edi, dword [ebp + 0x10]
mov esi, ecx
ja 0x40ae4d
cmp ebx, 0x104
jae 0x40ae04
lea eax, [ebx - 5]
cmp eax, 0xfc
ja case.0x40ae7d.275
movzx eax, byte [eax + 0x40b39c]
jmp dword [eax*4 + 0x40b36c]
push 0
mov ecx, esi
call fcn.00408dd0
mov ecx, dword [esi + 0x240]
mov edx, dword [ecx]
call dword [edx + 0x10]
jmp 0x40aaee
mov ecx, dword [esi + 0x238]
lea eax, [esp + 0x70]
push eax
push ecx
call dword [sym.imp.USER32.dll_BeginPaint]
mov edi, eax
test edi, edi
jne 0x40a62b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x46b0e8
lea ecx, [esp + 0x3e4]
call fcn.00443bf0
push 0x47c164
lea edx, [esp + 0x2dc]
mov esi, eax
mov ecx, 0x41
lea edi, [esp + 0x2dc]
push edx
rep movsd dword es:[edi], dword [esi]
call fcn.0044777e
mov eax, dword [esp + 0x78]
mov ecx, dword [esp + 0x7c]
mov edx, dword [esp + 0x80]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x84]
mov dword [esp + 0x24], ecx
lea ecx, [esp + 0x20]
mov dword [esp + 0x28], edx
mov dword [esp + 0x2c], eax
call fcn.00408420
test al, al
jne 0x40a959
mov eax, dword [esi + 0x80]
push eax
push edi
lea ecx, [esp + 0x48]
call fcn.004088e0
mov ecx, dword [esi + 0x200]
mov eax, dword [ecx + 0x3c]
test eax, eax
mov dword [esp + 0x6f4], 0
je 0x40a945
mov al, byte [esi + 0x88]
test al, al
je 0x40a6a5
mov byte [esi + 0x88], 0
call fcn.0041b970
mov ecx, dword [esi + 0x200]
mov edx, dword [ecx + 0x3c]
push edx
push edi
lea ecx, [esp + 0x3c]
call fcn.0041a660
mov ecx, dword [esi + 0x200]
lea eax, [esp + 0xb0]
push eax
mov byte [esp + 0x6f8], 1
lea ebx, [esi + 0xa4]
call fcn.004084a0
push eax
lea ecx, [esp + 0x14]
push ecx
mov ecx, ebx
call fcn.00409690
lea edx, [esp + 0x10]
push edx
lea ecx, [esp + 0x24]
call fcn.00408440
test al, al
jne 0x40a7e3
push str.draw_border
push 0x487e38
call fcn.004014b0
add esp, 8
push 4
call dword [sym.imp.GDI32.dll_GetStockObject]
mov edx, dword [esi + 0x21c]
mov ecx, dword [esp + 0x10]
mov ebx, eax
mov eax, dword [esi + 0x224]
sub eax, edx
push eax
push ecx
push 0
push 0
lea edx, [esp + 0x5c]
push edx
call dword [sym.imp.USER32.dll_SetRect]
push ebx
lea eax, [esp + 0x50]
push eax
push edi
call dword [sym.imp.USER32.dll_FillRect]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
push ecx
push edx
push 0
push eax
lea ecx, [esp + 0x5c]
push ecx
call dword [sym.imp.USER32.dll_SetRect]
push ebx
lea edx, [esp + 0x50]
push edx
push edi
call dword [sym.imp.USER32.dll_FillRect]
mov edx, dword [esi + 0x21c]
mov eax, dword [esi + 0x224]
mov ecx, dword [esi + 0x220]
sub eax, edx
mov edx, dword [esp + 0x18]
push eax
sub ecx, dword [esi + 0x218]
push ecx
push 0
push edx
lea eax, [esp + 0x5c]
push eax
call dword [sym.imp.USER32.dll_SetRect]
push ebx
lea ecx, [esp + 0x50]
push ecx
push edi
call dword [sym.imp.USER32.dll_FillRect]
mov ecx, dword [esi + 0x21c]
mov edx, dword [esi + 0x224]
mov eax, dword [esp + 0x18]
sub edx, ecx
mov ecx, dword [esp + 0x1c]
push edx
mov edx, dword [esp + 0x14]
push eax
push ecx
push edx
lea eax, [esp + 0x5c]
push eax
call dword [sym.imp.USER32.dll_SetRect]
push ebx
lea ecx, [esp + 0x50]
push ecx
push edi
call dword [sym.imp.USER32.dll_FillRect]
lea edx, [esp + 0x20]
push edx
lea eax, [esp + 0x14]
push eax
mov ecx, esi
call fcn.00408a40
lea ebx, [esi + 0xa4]
mov ecx, ebx
call fcn.00408a00
test al, al
je 0x40a8c3
push 4
push edi
call dword [sym.imp.GDI32.dll_SetStretchBltMode]
push 0
push 0
push 0
push edi
call dword [sym.imp.GDI32.dll_SetBrushOrgEx]
lea ecx, [esp + 0x4c]
push ecx
mov ecx, dword [esi + 0x200]
call fcn.004084a0
lea edx, [esp + 0x4c]
push edx
lea eax, [esp + 0x24]
push eax
mov ecx, ebx
call fcn.00409690
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x58]
mov edx, dword [esp + 0x54]
push 0xcc0020
sub ecx, eax
push ecx
mov ecx, dword [esp + 0x54]
sub edx, ecx
push edx
mov edx, dword [esp + 0x34]
push eax
mov eax, dword [esp + 0x48]
push ecx
mov ecx, dword [esp + 0x40]
push eax
mov eax, dword [esp + 0x3c]
sub ecx, eax
push ecx
mov ecx, dword [esp + 0x3c]
sub edx, ecx
push edx
push eax
push ecx
push edi
call dword [sym.imp.GDI32.dll_StretchBlt]
test eax, eax
jne 0x40a934
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x46b0bc
lea ecx, [esp + 0x4e8]
call fcn.00443bf0
mov esi, eax
push 0x47c164
lea eax, [esp + 0x1d8]
mov ecx, 0x41
lea edi, [esp + 0x1d8]
push eax
rep movsd dword es:[edi], dword [esi]
call fcn.0044777e
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x38]
push 0xcc0020
push ecx
mov ecx, dword [esp + 0x28]
push edx
mov edx, dword [esp + 0x30]
push eax
mov eax, dword [esp + 0x3c]
sub eax, edx
push eax
mov eax, dword [esp + 0x3c]
sub eax, ecx
push eax
push edx
push ecx
push edi
call dword [sym.imp.GDI32.dll_BitBlt]
test eax, eax
jne 0x40a934
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x46b0a0
lea ecx, [esp + 0x5ec]
call fcn.00443bf0
mov esi, eax
mov ecx, 0x41
lea edi, [esp + 0xd0]
rep movsd dword es:[edi], dword [esi]
push 0x47c164
lea ecx, [esp + 0xd4]
push ecx
call fcn.0044777e
lea ecx, [esp + 0x34]
mov byte [esp + 0x6f4], 0
call fcn.0041a730
lea ecx, [esp + 0x40]
mov dword [esp + 0x6f4], 0xffffffff
call fcn.00408920
mov eax, dword [esi + 0x238]
lea edx, [esp + 0x70]
push edx
push eax
call dword [sym.imp.USER32.dll_EndPaint]
mov ecx, dword [esi + 0x240]
mov edx, dword [ecx]
call dword [edx + 0x14]
xor eax, eax
mov ecx, dword [esp + 0x6ec]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [ebp + 0xc]
mov eax, dword [esi + 0x238]
push edi
push ecx
push ebx
push eax
call dword [sym.imp.USER32.dll_DefWindowProcA]
mov dword [esi + 0xb0], eax
jmp 0x40aaee
mov edx, dword [edi + 0x18]
mov dword [esi + 0x104], edx
mov eax, dword [edi + 0x1c]
mov dword [esi + 0x108], eax
mov ecx, dword [edi + 0x18]
mov dword [esi + 0xa8], ecx
mov edx, dword [edi + 0x1c]
mov eax, 0x7fff
mov dword [esi + 0xac], edx
mov dword [edi + 0x24], eax
mov dword [edi + 0x20], eax
jmp 0x40aaee
test byte [edi + 0x18], 1
jne case.0x40ae7d.275
mov eax, dword [esi + 0x238]
push 0xfffffffffffffff0
push eax
call dword [sym.imp.USER32.dll_GetWindowLongA]
mov ecx, dword [esi + 0xdc]
mov edx, dword [esi + 0xd8]
push ecx
push edx
push 0
mov edi, eax
push 0
lea eax, [esp + 0x30]
push eax
and edi, 0xffcfffff
call dword [sym.imp.USER32.dll_SetRect]
push 0
push edi
lea ecx, [esp + 0x28]
push ecx
call dword [sym.imp.USER32.dll_AdjustWindowRect]
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
mov ebx, dword [esp + 0x2c]
mov dword [esp + 0x10], edx
lea edx, [esp + 0x4c]
mov dword [esp + 0x14], eax
mov eax, dword [esi + 0x238]
push edx
push eax
mov dword [esp + 0x20], ecx
call dword [sym.imp.USER32.dll_GetWindowRect]
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x50]
mov ecx, ebx
sub ecx, edx
mov edx, dword [esp + 0x58]
sub edx, eax
cmp edx, ecx
jge 0x40aa7d
push 2
call dword [sym.imp.USER32.dll_GetSystemMetrics]
add dword [esp + 0x18], eax
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x4c]
sub eax, ecx
mov ecx, dword [esp + 0x54]
sub ecx, edx
cmp ecx, eax
mov dword [esp + 0x40], eax
jge 0x40aaa3
push 0x15
call dword [sym.imp.USER32.dll_GetSystemMetrics]
add ebx, eax
mov edx, dword [esi + 0x238]
push 0xfffffffffffffff0
push edx
call dword [sym.imp.USER32.dll_GetWindowLongA]
test eax, 0x1000000
jne 0x40ab78
mov al, byte [esi + 0xa0]
test al, al
jne 0x40ab78
mov al, byte [esi + 0xb5]
test al, al
je 0x40ab1a
mov eax, dword [ebp + 0x10]
push edi
lea ecx, [esi + 0xa4]
push eax
mov byte [ecx], 0
call fcn.00410210
mov ebx, dword [ebp + 8]
mov edi, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
mov edx, dword [esi + 0x238]
push edi
push ecx
push ebx
push edx
call fcn.0041b6d0
add esp, 0x10
mov ecx, dword [esp + 0x6ec]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [esi + 0x104]
cmp dword [esp + 0x40], eax
jge 0x40ab2e
mov ecx, dword [esp + 0x10]
add eax, ecx
jmp 0x40ab32
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
mov ecx, dword [esi + 0x108]
mov edi, ebx
sub edi, edx
cmp edi, ecx
jge 0x40ab47
lea ebx, [ecx + edx]
sub eax, dword [esp + 0x10]
mov ecx, dword [ebp + 0x10]
cmp dword [ecx + 0x10], eax
jle 0x40ab5d
mov dword [ecx + 0x10], eax
mov eax, dword [esp + 0x4c]
mov dword [ecx + 8], eax
mov eax, dword [ecx + 0x14]
sub ebx, edx
cmp eax, ebx
jle case.0x40ae7d.275
mov eax, dword [ebp + 0x10]
mov ecx, dword [esp + 0x50]
mov dword [eax + 0x14], ebx
mov dword [eax + 0xc], ecx
jmp case.0x40ae7d.275
mov al, byte [esi + 0xb5]
test al, al
je case.0x40ae7d.275
mov byte [esi + 0xa4], 1
jmp case.0x40ae7d.275
xor eax, eax
lea edx, [esp + 0x10]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
push edx
lea eax, [esp + 0x38]
lea edi, [esi + 0xa4]
push eax
mov ecx, edi
call fcn.004095c0
mov edx, dword [esi + 0x238]
lea ecx, [esp + 0x20]
push ecx
push edx
call dword [sym.imp.USER32.dll_GetWindowRect]
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x28]
lea ebx, [esi + 0x208]
mov dword [ebx], eax
mov eax, dword [esp + 0x2c]
mov dword [ebx + 4], ecx
mov ecx, dword [esi + 0x238]
mov dword [ebx + 8], edx
mov dword [ebx + 0xc], eax
lea eax, [esp + 0x20]
push eax
push ecx
call dword [sym.imp.USER32.dll_GetClientRect]
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x28]
lea ebx, [esi + 0x218]
mov dword [ebx], eax
mov dword [ebx + 4], ecx
mov dword [ebx + 8], edx
mov edx, dword [esp + 0x2c]
mov dword [ebx + 0xc], edx
sub esp, 0x10
mov ebx, esp
mov dword [ebx], eax
mov eax, dword [esp + 0x38]
mov dword [ebx + 4], ecx
mov dword [ebx + 8], eax
mov ecx, edi
mov dword [ebx + 0xc], edx
call fcn.004089c0
mov ecx, esi
call fcn.00409070
lea edx, [esp + 0x10]
push edx
lea eax, [esp + 0x6c]
xor ebx, ebx
push eax
mov ecx, edi
mov dword [esp + 0x18], ebx
mov dword [esp + 0x1c], ebx
call fcn.004095c0
push eax
lea ecx, [esp + 0x38]
call fcn.00408320
test al, al
je 0x40ac72
mov al, byte [esi + 0xb5]
test al, al
je case.0x40ae7d.275
mov ecx, dword [esi + 0x238]
push 1
push ebx
push ecx
call dword [sym.imp.USER32.dll_InvalidateRect]
jmp case.0x40ae7d.275
cmp di, 1
jne case.0x40ae7d.275
mov al, byte [esi + 0x1a6]
test al, al
mov eax, dword [0x487e48]
jne 0x40aca5
mov eax, dword [0x487e4c]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
jmp 0x40b350
xor edx, edx
mov dl, byte [esi + 0x7c]
mov ecx, esi
mov byte [esi + 0x204], 1
push edx
call fcn.00408340
mov al, byte [esi + 0x7d]
test al, al
je case.0x40ae7d.275
mov ecx, esi
call fcn.004092b0
jmp 0x40aaee
xor eax, eax
mov al, byte [esi + 0x7c]
mov ecx, esi
mov byte [esi + 0x204], 0
push eax
call fcn.00408340
mov ecx, esi
call fcn.00409e50
mov ecx, dword [esi + 0x240]
push ecx
lea ecx, [esi + 8]
call fcn.00416370
jmp 0x40aaee
mov al, byte [esi + 0x23c]
test al, al
je 0x40ae04
movzx edx, al
cmp dword [ebp + 0xc], edx
jne 0x40ae04
mov edi, dword [sym.imp.USER32.dll_GetAsyncKeyState]
push 0x11
call edi
xor ebx, ebx
mov bx, ax
push 0x12
shr ebx, 0xf
and bl, 1
call edi
push 0x10
shr eax, 0xf
and al, 1
mov byte [esp + 0x37], al
call edi
shr eax, 0xf
and al, 1
test bl, bl
jne 0x40ae01
mov cl, byte [esp + 0x33]
test cl, cl
jne 0x40ae01
test al, al
jne 0x40ae01
cmp dword [ebp + 8], 0x100
jne 0x40adbf
mov ecx, esi
call fcn.00408ed0
mov ecx, dword [esi + 0x240]
mov eax, dword [ecx]
call dword [eax + 0x24]
lea ecx, [esp + 0x40]
push ecx
call dword [sym.imp.USER32.dll_GetCursorPos]
mov edx, dword [esp + 0x44]
mov eax, dword [esp + 0x40]
push 0
mov byte [esi + 0x1a6], bl
mov esi, dword [esi + 0x238]
push esi
push 0
push edx
push eax
push 0x14
push 0
push esi
call dword [sym.imp.USER32.dll_GetSystemMenu]
push eax
call dword [sym.imp.USER32.dll_TrackPopupMenu]
xor eax, eax
mov ecx, dword [esp + 0x6ec]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [esi + 0x238]
push ecx
push str.WM_CLOSE__x
push 0x487e38
call fcn.004014b0
mov ecx, dword [esi + 0x240]
mov edx, dword [ecx]
add esp, 0xc
call dword [edx + 0x1c]
jmp 0x40aaee
mov ebx, dword [ebp + 8]
cmp ebx, 0x100
je 0x40ae18
cmp ebx, 0x104
je 0x40ae18
xor al, al
jmp 0x40ae1c
xor eax, eax
mov al, 1
mov ecx, dword [ebp + 0xc]
mov edx, dword [esi + 0x240]
push eax
mov eax, dword [ebp + 0x10]
push eax
push ecx
push edx
lea ecx, [esi + 8]
call fcn.00416910
xor eax, eax
mov ecx, dword [esp + 0x6ec]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp ebx, 0x208
ja 0x40b09e
cmp ebx, 0x207
jae case.0x40ae7d.512
lea eax, [ebx - 0x111]
cmp eax, 0xf4
ja case.0x40ae7d.275
movzx eax, byte [eax + 0x40b4b0]
jmp dword [eax*4 + 0x40b49c]
cmp ebx, 0x115
jne 0x40aea0
mov edi, dword [esi + 0x22c]
mov eax, dword [esi + 0x224]
mov ecx, dword [esi + 0x21c]
jmp 0x40aeb2
mov edi, dword [esi + 0x228]
mov eax, dword [esi + 0x220]
mov ecx, dword [esi + 0x218]
mov edx, dword [ebp + 0xc]
sub eax, ecx
movzx ecx, dx
cmp ecx, 8
ja case.0x40aebf.6
jmp dword [ecx*4 + 0x40b5a8]
sub edi, eax
jmp case.0x40aebf.8
add edi, eax
jmp case.0x40aebf.8
sub edi, 5
jmp case.0x40aebf.8
add edi, 5
jmp case.0x40aebf.8
mov edi, edx
shr edi, 0x10
jmp case.0x40aebf.8
push str.received_unknown_scroll_message
push 0x487e38
call fcn.00401480
add esp, 8
cmp ebx, 0x114
jne 0x40af0e
mov ecx, dword [esi + 0x22c]
lea edx, [esp + 0x10]
mov dword [esp + 0x10], edi
mov dword [esp + 0x14], ecx
push edx
jmp 0x40af21
mov eax, dword [esi + 0x228]
lea ecx, [esp + 0x10]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edi
push ecx
mov ecx, esi
call fcn.00408b50
mov ecx, dword [esi + 0x238]
xor eax, eax
cmp ebx, 0x115
sete al
push 1
lea edx, [esp + 0x50]
push edx
mov dword [esp + 0x54], 0x1c
mov dword [esp + 0x58], 4
mov dword [esp + 0x68], edi
push eax
push ecx
call dword [sym.imp.USER32.dll_SetScrollInfo]
jmp 0x40aaeb
mov ecx, dword [esi + 0x240]
mov eax, dword [ebp + 0xc]
mov edx, dword [ecx]
push edi
push eax
call dword [edx + 0x18]
test al, al
jne case.0x40ae7d.275
mov eax, dword [ebp + 0xc]
and eax, 0xfff0
sub eax, 0xf020
je 0x40b051
sub eax, 0x10
je 0x40b051
sub eax, 0xf0
jne case.0x40ae7d.275
mov ecx, dword [esi + 0x238]
push 0xfffffffffffffff0
push ecx
call dword [sym.imp.USER32.dll_GetWindowLongA]
test eax, 0x20000000
je 0x40aff7
mov edx, dword [ebp + 0xc]
mov eax, dword [esi + 0x238]
push edi
push edx
push ebx
push eax
call fcn.0041b6d0
mov al, byte [esi + 0xa1]
add esp, 0x10
test al, al
je 0x40b038
push 1
mov ecx, esi
call fcn.00409790
xor eax, eax
mov ecx, dword [esp + 0x6ec]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov al, byte [esi + 0xa0]
test al, al
je 0x40b023
push 0
mov ecx, esi
call fcn.00409790
xor eax, eax
mov ecx, dword [esp + 0x6ec]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [ebp + 0xc]
mov edx, dword [esi + 0x238]
push edi
push ecx
push ebx
push edx
call fcn.0041b6d0
add esp, 0x10
xor eax, eax
mov ecx, dword [esp + 0x6ec]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov al, byte [esi + 0xa0]
push 0
mov ecx, esi
mov byte [esi + 0xa1], al
call fcn.00409790
jmp 0x40aaee
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 0xc]
mov eax, dword [esi + 0x238]
push ecx
push edx
push 0x112
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
xor eax, eax
mov ecx, dword [esp + 0x6ec]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp ebx, 0x30f
ja 0x40b292
je 0x40b2d4
cmp ebx, 0x20a
je case.0x40ae7d.512
cmp ebx, 0x2a3
jne case.0x40ae7d.275
mov ecx, esi
mov byte [esi + 0x1a5], 0
call fcn.00409e50
xor eax, eax
mov ecx, dword [esp + 0x6ec]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov al, byte [esi + 0x204]
test al, al
je 0x40b286
mov al, byte [esi + 0x1a5]
test al, al
jne 0x40b12f
mov ecx, dword [esi + 0x238]
lea edx, [esp + 0x4c]
push edx
mov dword [esp + 0x50], 0x10
mov dword [esp + 0x54], 2
mov dword [esp + 0x58], ecx
call dword [sym.imp.COMCTL32.dll__TrackMouseEvent]
mov byte [esi + 0x1a5], 1
mov ecx, dword [ebp + 0xc]
xor eax, eax
test cl, 1
mov dword [esp + 0x40], eax
je 0x40b146
mov eax, 1
mov dword [esp + 0x40], eax
test cl, 0x10
je 0x40b152
or eax, 2
mov dword [esp + 0x40], eax
test cl, 2
je 0x40b15e
or eax, 4
mov dword [esp + 0x40], eax
cmp ebx, 0x20a
jne 0x40b17a
shr ecx, 0x10
push eax
movsx eax, cx
push eax
mov ecx, esi
call fcn.004084c0
jmp 0x40aaee
mov edi, dword [ebp + 0x10]
mov ecx, dword [esi + 0x240]
mov edx, dword [ecx]
movzx ebx, di
shr edi, 0x10
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], edi
call dword [edx + 0x20]
mov cl, byte [eax + 5]
test cl, cl
je 0x40b1b0
mov eax, dword [esp + 0x40]
push eax
push edi
push ebx
mov ecx, esi
call fcn.0040a470
jmp case.0x40ae7d.275
lea ecx, [esp + 0x10]
push ecx
lea edx, [esp + 0x38]
push edx
lea ecx, [esi + 0xa4]
call fcn.004096e0
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0xc4]
push ecx
mov ecx, dword [esi + 0x200]
call fcn.004084a0
mov ecx, eax
call fcn.00408470
test al, al
mov byte [esi + 0x1a6], al
jne 0x40b1fa
mov ecx, esi
call fcn.00409e50
jmp case.0x40ae7d.275
mov eax, dword [esi + 0x1a0]
test eax, eax
je 0x40b244
lea edi, [esi + 0x1a8]
push edi
lea ecx, [esp + 0x38]
call fcn.00408320
test al, al
jne 0x40b244
mov ecx, esi
call fcn.00409ca0
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x38]
mov ecx, esi
mov dword [edi], edx
mov dword [edi + 4], eax
call fcn.00409ce0
mov al, byte [esi + 0x1a7]
test al, al
je 0x40b244
mov ecx, esi
call fcn.00408590
lea ecx, [esp + 0x10]
push ecx
mov ecx, esi
call fcn.00408cf0
test al, al
jne case.0x40ae7d.275
mov eax, dword [esp + 0x40]
mov edx, dword [esi + 0x10c]
push 0
push eax
lea ecx, [esi + 0x10c]
lea eax, [esp + 0x3c]
push eax
call dword [edx + 8]
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x38]
mov dword [esi + 0x38], ecx
mov dword [esi + 0x3c], edx
jmp case.0x40ae7d.275
mov ecx, esi
call fcn.00409e50
jmp 0x40aaee
cmp ebx, 0x311
jne case.0x40ae7d.275
push str.WM_PALETTECHANGED
push 0x487e38
call fcn.004014b0
mov eax, dword [ebp + 0xc]
mov ecx, dword [esi + 0x238]
add esp, 8
cmp eax, ecx
jne 0x40b2d4
push str.ignoring
push 0x487e38
call fcn.004014b0
add esp, 8
jmp 0x40aaee
push str.re_selecting_palette
push 0x487e38
call fcn.004014b0
mov eax, dword [esi + 0x238]
add esp, 8
push eax
lea ecx, [esp + 0x38]
call fcn.0041a4d0
mov ecx, dword [esi + 0x80]
mov edx, dword [esp + 0x38]
push ecx
push edx
lea ecx, [esp + 0x18]
call fcn.004088e0
mov al, byte [esp + 0x18]
test al, al
je 0x40b331
mov eax, dword [esi + 0x238]
push 0
push 0
push eax
call dword [sym.imp.USER32.dll_InvalidateRect]
mov ecx, dword [esi + 0x238]
push ecx
call dword [sym.imp.USER32.dll_UpdateWindow]
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40b347
mov edx, dword [esp + 0x14]
push 1
push eax
push edx
call dword [sym.imp.GDI32.dll_SelectPalette]
lea ecx, [esp + 0x34]
call fcn.0041a570
mov ecx, dword [esp + 0x6ec]
pop edi
pop esi
mov eax, 1
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret 0xc