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

Disassembly:
sub esp, 0x9c
push ebp
push edi
push esi
push ebx
mov ebp, dword [esp + 0xb4]
mov ecx, dword [ebp + 0x14]
cmp ecx, 0x1006
je 0x40e598
jle 0x40e57a
cmp ecx, 0x1007
je 0x40e5dd
cmp ecx, 0x1008
je 0x40e618
mov eax, dword [0x423c74]
mov dword [esp + 0x34], 3
mov dword [esp + 0x30], 1
mov dword [esp + 0x18], eax
jmp 0x40e633
mov edx, dword [0x422dac]
mov dword [esp + 0x18], edx
cmp dword [0x42692c], 0
je 0x40e5cb
mov eax, dword [0x426924]
mov dword [esp + 0x34], 5
cmp dword [0x426928], eax
jne 0x40e5d3
mov eax, dword [0x42323c]
mov dword [esp + 0x34], eax
jmp 0x40e5d3
mov dword [esp + 0x34], 6
mov dword [esp + 0x30], 1
jmp 0x40e633
mov edx, dword [0x422dac]
mov dword [esp + 0x34], 4
mov dword [esp + 0x18], edx
cmp dword [0x42692c], 0
je 0x40e60e
mov eax, dword [0x426924]
cmp dword [0x426928], eax
jne 0x40e60e
mov eax, dword [0x42323c]
mov dword [esp + 0x34], eax
mov dword [esp + 0x30], 0
jmp 0x40e633
mov edx, dword [0x41c444]
mov eax, dword [0x42500c]
mov dword [esp + 0x30], 0
mov dword [esp + 0x18], edx
mov dword [esp + 0x34], eax
cmp dword [esp + 0x18], 0
je 0x40ecbc
lea edx, [esp + 0x6c]
mov dword [esp + 0x14], edx
push edx
mov eax, dword [esp + 0xb4]
push eax
call sub.user32.dll_BeginPaint
mov edx, dword [0x41e2ac]
mov dword [esp + 0x3c], eax
push edx
mov eax, dword [esp + 0x40]
push eax
call sub.gdi32.dll_SelectObject
lea edx, [esp + 0x5c]
mov dword [esp + 0x14], edx
push edx
mov eax, dword [esp + 0xb4]
push eax
call sub.user32.dll_GetClientRect
mov edx, dword [esp + 0x64]
mov dword [esp + 0x54], edx
mov eax, dword [esp + 0x34]
mov edx, dword [esp + 0x18]
movsx ebx, word [edx + eax*2]
mov dword [esp + 0x2c], 2
test ebx, ebx
jle 0x40e704
cmp dword [esp + 0x30], 0
je 0x40e704
cmp dword [ebp + 0x14], 0x1005
sete al
xor edx, edx
mov dl, al
mov edi, edx
add edi, edx
mov edx, ebx
lea eax, [edi - 4]
sub edx, eax
mov eax, dword [esp + 0x18]
movsx esi, word [eax + edx*2]
lea ecx, [ebx + esi*2]
test esi, esi
jle 0x40e6e0
add edi, 0xfffffffb
mov dword [esp + 0x14], edi
sub ecx, edi
mov dword [esp + 0x14], ecx
lea ecx, [eax + ecx*2]
jmp 0x40e6ee
sub ecx, edi
mov edx, dword [esp + 0x18]
mov dword [esp + 0x14], ecx
lea ecx, [edx + ecx*2 + 0xc]
movsx ecx, byte [ecx + 1]
cmp ecx, 3
je 0x40e6fc
cmp ecx, 5
jne 0x40e704
mov dword [esp + 0x2c], 3
cmp dword [ebp + 0x2c], 0
jge 0x40e748
mov esi, dword [0x42476c]
mov ecx, esi
sub ecx, dword [ebp + 0x30]
jns 0x40e719
xor ecx, ecx
mov dword [ebp + 0x2c], ecx
mov eax, dword [ebp + 0x30]
mov edx, esi
shr eax, 0x1f
mov ecx, dword [0x423c50]
add eax, dword [ebp + 0x30]
sub edx, ecx
mov esi, eax
sar esi, 1
cmp edx, esi
jl 0x40e748
mov eax, ecx
sub eax, esi
lea ecx, [eax - 1]
test ecx, ecx
jge 0x40e745
xor ecx, ecx
mov dword [ebp + 0x2c], ecx
mov dword [ebp + 0x34], 0
test ebx, ebx
jle 0x40e79a
mov esi, dword [ebp + 0x2c]
mov ecx, dword [ebp + 0x34]
cmp ecx, esi
jge 0x40e79a
add ebx, dword [esp + 0x30]
mov eax, dword [esp + 0x18]
mov dword [esp + 0x34], ebx
movsx ebx, word [eax + ebx*2]
cmp dword [esp + 0x30], 0
je 0x40e793
test ebx, ebx
jle 0x40e793
test ecx, ecx
jne 0x40e783
cmp dword [esp + 0x2c], 2
jne 0x40e793
add ebx, dword [esp + 0x30]
mov edx, dword [esp + 0x18]
mov dword [esp + 0x34], ebx
movsx ebx, word [edx + ebx*2]
inc dword [ebp + 0x34]
test ebx, ebx
jg 0x40e756
mov dword [esp + 0x1c], 0
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x24], 0xffffffff
mov dword [esp + 0x28], eax
cmp dword [esp + 0x68], eax
jle 0x40ec55
cmp dword [esp + 0x24], 0
jg 0x40e7d4
cmp dword [ebp + 0x14], 0x1005
jne 0x40e7dc
cmp dword [0x424770], ebx
jge 0x40e7dc
mov dword [esp + 0x24], 0
mov ecx, dword [ebp + 0x34]
lea edx, [ecx + 1]
mov dword [ebp + 0x34], edx
mov dword [esp + 0x20], 0
mov eax, dword [esp + 0x28]
mov edi, edx
add eax, dword [ebp + 0x20]
cmp dword [esp + 0x78], eax
jge 0x40e812
mov edx, dword [esp + 0x28]
cmp dword [esp + 0x80], edx
setg al
xor edx, edx
mov dl, al
mov dword [esp + 0x20], edx
mov dword [esp + 0x48], 0x41c400
cmp dword [esp + 0x20], 0
je 0x40e9b3
cmp dword [ebp + 0x14], 0x1006
jne 0x40e836
mov edi, ecx
add edi, dword [0x423c50]
mov dword [esp + 0x48], 0x41c401
cmp edi, 0x63
jle 0x40e881
mov eax, 0x51eb851f
imul edi
mov ecx, edx
mov eax, edi
sar ecx, 5
sar eax, 0x1f
sub ecx, eax
mov eax, 0x66666667
imul ecx
mov esi, edx
mov eax, ecx
sar esi, 2
sar eax, 0x1f
mov dword [esp + 0x14], esi
mov edx, esi
sub edx, eax
mov dword [esp + 0x14], edx
lea eax, [edx + edx*4]
mov edx, eax
add edx, eax
sub ecx, edx
add cl, 0x30
jmp 0x40e883
mov cl, 0x20
mov esi, dword [esp + 0x48]
lea eax, [esi + 1]
mov byte [0x41c400], cl
mov dword [esp + 0x48], eax
cmp edi, 9
jle 0x40e8cf
mov eax, 0x66666667
imul edi
mov ecx, edx
mov eax, edi
sar ecx, 2
sar eax, 0x1f
sub ecx, eax
mov eax, 0x66666667
imul ecx
mov eax, ecx
sar edx, 2
sar eax, 0x1f
sub edx, eax
mov dword [esp + 0x14], edx
lea edx, [edx + edx*4]
mov eax, edx
add eax, edx
sub ecx, eax
add cl, 0x30
jmp 0x40e8d1
mov cl, 0x20
mov eax, 0x66666667
mov byte [esi], cl
imul edi
mov ecx, edx
mov eax, edi
sar ecx, 2
sar eax, 0x1f
mov dword [esp + 0x14], ecx
mov edx, ecx
sub edx, eax
mov dword [esp + 0x14], edx
lea eax, [edx + edx*4]
mov edx, eax
add edx, eax
mov eax, edi
sub eax, edx
mov dword [esp + 0x10], eax
mov dl, byte [esp + 0x10]
add dl, 0x30
mov eax, dword [esp + 0x48]
mov byte [eax], dl
inc dword [esp + 0x48]
test ebx, ebx
jle 0x40e96c
cmp dword [ebp + 0x34], 1
jg 0x40e927
cmp dword [ebp + 0x2c], 0
jg 0x40e927
cmp dword [esp + 0x2c], 3
je 0x40e96c
cmp dword [ebp + 0x14], 0x1005
jne 0x40e94d
cmp dword [esp + 0x24], 0
jge 0x40e94d
cmp dword [0x424770], ebx
jg 0x40e94d
mov edx, dword [esp + 0x48]
sub edx, 0x41c400
mov dword [esp + 0x24], edx
mov eax, dword [esp + 0x34]
push eax
push ebx
lea edx, [esp + 0x50]
mov dword [esp + 0x1c], edx
mov eax, edx
push eax
mov edx, dword [ebp + 0x14]
push edx
call fcn.0040cae4
add esp, 0x10
jmp 0x40e983
push str.___...
mov eax, dword [esp + 0x4c]
push eax
call sub.crtdll.dll_strcpy
add dword [esp + 0x50], 7
add esp, 8
cmp dword [0x42692c], 0
je 0x40e9b3
mov eax, dword [0x426924]
cmp dword [0x426928], eax
jne 0x40e9b3
cmp dword [ebp + 0x14], 0x1007
jne 0x40e9b3
mov eax, dword [0x423c6c]
inc eax
cmp eax, edi
jne 0x40e9b3
mov byte [0x41c403], 0x2e
cmp dword [esp + 0x30], 0
jne 0x40e9d2
test ebx, ebx
jg 0x40ea7f
dec dword [ebp + 0x34]
mov dword [esp + 0x48], 0x41c400
jmp 0x40ea7f
test ebx, ebx
jle 0x40ea4a
cmp dword [ebp + 0x34], 1
jg 0x40e9e9
cmp dword [ebp + 0x2c], 0
jg 0x40e9e9
cmp dword [esp + 0x2c], 3
je 0x40e9f6
inc ebx
mov eax, dword [esp + 0x18]
mov dword [esp + 0x34], ebx
movsx ebx, word [eax + ebx*2]
test ebx, ebx
jle 0x40ea77
cmp dword [esp + 0x20], 0
je 0x40ec2c
cmp dword [ebp + 0x14], 0x1005
jne 0x40ea2b
cmp dword [esp + 0x24], 0
jge 0x40ea2b
cmp dword [0x424770], ebx
jg 0x40ea2b
mov edx, dword [esp + 0x48]
sub edx, 0x41c400
mov dword [esp + 0x24], edx
mov eax, dword [esp + 0x34]
push eax
push ebx
lea edx, [esp + 0x50]
mov dword [esp + 0x1c], edx
mov eax, edx
push eax
mov edx, dword [ebp + 0x14]
push edx
call fcn.0040cae4
add esp, 0x10
jmp 0x40ea7f
cmp dword [esp + 0x20], 0
je 0x40ea65
cmp dword [ebp + 0x34], 1
jg 0x40ea60
cmp dword [0x426924], 2
jne 0x40ea65
add dword [esp + 0x48], 0xfffffff9
cmp dword [esp + 0x1c], 0
je 0x40ea77
dec dword [ebp + 0x34]
mov dword [esp + 0x48], 0x41c400
mov dword [esp + 0x1c], 1
cmp dword [esp + 0x20], 0
je 0x40ec2c
mov ecx, dword [esp + 0x48]
mov esi, ecx
sub esi, 0x41c400
cmp dword [0x41dcf4], 0
je 0x40ead9
lea eax, [ecx - 1]
mov ecx, eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x14], ecx
cmp ecx, 0x41c400
jb 0x40ead9
mov ecx, dword [esp + 0x48]
cmp byte [ecx], 0x30
jne 0x40eac0
mov byte [ecx], 0x4f
mov edx, dword [esp + 0x48]
mov dword [esp + 0x14], edx
dec edx
mov eax, dword [esp + 0x14]
mov dword [esp + 0x48], edx
dec eax
cmp eax, 0x41c400
jae 0x40eab4
mov edx, dword [0x41dcc4]
mov eax, dword [0x4267f4]
mov dword [esp + 0x38], edx
cmp dword [ebp + 0x14], eax
jne 0x40eb40
cmp dword [ebp + 0x28], edi
jne 0x40eb40
push 0xd
call sub.user32.dll_GetSysColor
mov ecx, eax
push ecx
mov edx, dword [esp + 0x40]
push edx
call sub.gdi32.dll_SetBkColor
push 0xe
call sub.user32.dll_GetSysColor
mov ecx, eax
push ecx
mov eax, dword [esp + 0x40]
push eax
call sub.gdi32.dll_SetTextColor
push esi
push 0x41c400
mov edx, dword [esp + 0x30]
push edx
push 0
mov eax, dword [esp + 0x4c]
push eax
call sub.gdi32.dll_TextOutA
mov edx, dword [0x41da48]
mov dword [esp + 0x38], edx
jmp 0x40ebe2
push 5
call sub.user32.dll_GetSysColor
mov ecx, eax
push ecx
mov eax, dword [esp + 0x40]
push eax
call sub.gdi32.dll_SetBkColor
push 8
call sub.user32.dll_GetSysColor
mov ecx, eax
push ecx
mov edx, dword [esp + 0x40]
push edx
call sub.gdi32.dll_SetTextColor
push esi
push 0x41c400
mov eax, dword [esp + 0x30]
push eax
push 0
mov edx, dword [esp + 0x4c]
push edx
call sub.gdi32.dll_TextOutA
cmp dword [esp + 0x24], 0
jl 0x40ebe2
push 0xc0c0c0
mov eax, dword [esp + 0x40]
push eax
call sub.gdi32.dll_SetTextColor
lea edx, [esp + 0x40]
mov dword [esp + 0x14], edx
push edx
mov eax, dword [esp + 0x28]
push eax
push 0x41c400
mov edx, dword [esp + 0x48]
push edx
call sub.gdi32.dll_GetTextExtentPoint32A
mov eax, esi
sub eax, dword [esp + 0x24]
mov dword [esp + 0x14], eax
push eax
mov edx, dword [esp + 0x28]
add edx, 0x41c400
mov dword [esp + 0x18], edx
mov eax, edx
push eax
mov edx, dword [esp + 0x30]
push edx
mov eax, dword [esp + 0x4c]
push eax
mov edx, dword [esp + 0x4c]
push edx
call sub.gdi32.dll_TextOutA
lea eax, [esp + 0x40]
mov dword [esp + 0x14], eax
push eax
push esi
push 0x41c400
mov edx, dword [esp + 0x48]
push edx
call sub.gdi32.dll_GetTextExtentPoint32A
mov eax, dword [esp + 0x28]
mov dword [esp + 0x50], eax
add eax, dword [ebp + 0x20]
mov edx, dword [esp + 0x40]
mov dword [esp + 0x58], eax
mov dword [esp + 0x4c], edx
mov eax, dword [esp + 0x38]
push eax
lea edx, [esp + 0x50]
mov dword [esp + 0x18], edx
mov eax, edx
push eax
mov edx, dword [esp + 0x44]
push edx
call sub.user32.dll_FillRect
test ebx, ebx
jle 0x40ec40
add ebx, dword [esp + 0x30]
mov eax, dword [esp + 0x18]
mov dword [esp + 0x34], ebx
movsx ebx, word [eax + ebx*2]
mov edx, dword [ebp + 0x20]
add dword [esp + 0x28], edx
mov eax, dword [esp + 0x28]
cmp dword [esp + 0x68], eax
jg 0x40e7bc
cmp dword [esp + 0x30], 0
je 0x40eca2
cmp dword [esp + 0x1c], 0
jne 0x40eca2
inc dword [ebp + 0x34]
add ebx, dword [esp + 0x30]
mov edx, dword [esp + 0x18]
mov dword [esp + 0x14], ebx
movsx ebx, word [edx + ebx*2]
jmp 0x40eca2
inc dword [ebp + 0x34]
add ebx, dword [esp + 0x30]
mov eax, dword [esp + 0x18]
mov dword [esp + 0x14], ebx
movsx ebx, word [eax + ebx*2]
cmp dword [esp + 0x30], 0
je 0x40eca2
test ebx, ebx
jle 0x40eca6
add ebx, dword [esp + 0x30]
mov dword [esp + 0x14], ebx
movsx ebx, word [eax + ebx*2]
test ebx, ebx
jg 0x40ec78
lea edx, [esp + 0x6c]
mov dword [esp + 0x14], edx
push edx
mov eax, dword [esp + 0xb4]
push eax
call sub.user32.dll_EndPaint
pop ebx
pop esi
pop edi
pop ebp
add esp, 0x9c
ret