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

Disassembly:
sub esp, 0x4c
mov ecx, dword [esp + 0x5c]
push ebx
mov ebx, dword [esp + 0x6c]
push ebp
push esi
mov esi, dword [esp + 0x60]
sub ecx, esi
push edi
mov edi, dword [ebx + 8]
mov eax, ecx
cdq
idiv edi
mov ebp, dword [ebx + 0x20]
add ebp, 2
imul ebp, edi
mov dword [esp + 0x28], eax
mov eax, ecx
cdq
idiv ebp
mov ecx, dword [ebx + 0x18]
mov edi, eax
mov eax, dword [ebx + 0x14]
mov dword [esp + 0x10], edi
mov edx, dword [ecx + eax*4 - 4]
push edx
call fcn.0049717e
mov dword [esp + 0x70], eax
mov eax, dword [ebx + 0x18]
mov ecx, dword [eax]
push ecx
call fcn.0049717e
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x7c]
add esp, 8
cmp eax, 1
jne 0x40ec1e
mov eax, dword [ebx + 8]
mov dword [esp + 0x74], 0
test eax, eax
jle 0x40ed9b
mov edx, dword [esp + 0x7c]
lea eax, [edi + esi]
mov esi, dword [esp + 0x60]
mov edi, dword [sym.imp.GDI32.dll_SelectObject]
mov dword [esp + 0x64], edx
mov dword [esp + 0x24], eax
mov ecx, dword [ebx + 0x20]
xor ebp, ebp
test ecx, ecx
jle 0x40ebe9
fild dword [esp + 0x70]
mov ecx, dword [esp + 0x70]
mov edx, dword [esp + 0x68]
sub ecx, edx
mov edx, dword [esp + 0x14]
fstp qword [esp + 0x3c]
fild dword [esp + 0x6c]
mov dword [esp + 0x7c], ecx
mov ecx, dword [esp + 0x6c]
sub edx, ecx
mov ebx, eax
fstp qword [esp + 0x1c]
fild dword [esp + 0x7c]
mov dword [esp + 0x7c], edx
fstp qword [esp + 0x2c]
fild dword [esp + 0x7c]
mov dword [esp + 0x7c], 0x4d5924
fstp qword [esp + 0x34]
mov eax, dword [esp + 0x64]
mov ecx, dword [eax]
fld qword [ecx + ebp*8]
fsub qword [esp + 0x1c]
fmul qword [esp + 0x2c]
fdiv qword [esp + 0x34]
fsubr qword [esp + 0x3c]
call fcn.00496fa4
mov edx, dword [esp + 0x7c]
mov dword [esp + 0x58], eax
mov eax, dword [edx]
push eax
call dword [sym.imp.GDI32.dll_CreateSolidBrush]
push eax
push esi
call edi
push 7
mov dword [esp + 0x64], eax
call dword [sym.imp.GDI32.dll_GetStockObject]
push eax
push esi
call edi
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x70]
mov dword [esp + 0x18], eax
push ecx
lea eax, [ebx + edx]
push eax
mov eax, dword [esp + 0x60]
push eax
push ebx
push esi
call dword [sym.imp.GDI32.dll_Rectangle]
mov ecx, dword [esp + 0x60]
push ecx
push esi
call edi
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov edx, dword [esp + 0x18]
push edx
push esi
call edi
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x7c]
add ebx, eax
mov eax, dword [esp + 0x78]
inc ebp
add edx, 4
mov ecx, dword [eax + 0x20]
mov dword [esp + 0x7c], edx
cmp ebp, ecx
jl 0x40eb47
mov ebx, eax
mov eax, dword [esp + 0x64]
mov ecx, dword [esp + 0x74]
mov ebp, dword [esp + 0x28]
mov edx, dword [ebx + 8]
add eax, 4
inc ecx
mov dword [esp + 0x64], eax
mov eax, dword [esp + 0x24]
add eax, ebp
cmp ecx, edx
mov dword [esp + 0x74], ecx
mov dword [esp + 0x24], eax
jl 0x40eaf4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
cmp eax, 2
jne 0x40ed9b
mov ecx, dword [ebx + 8]
xor eax, eax
cmp ecx, eax
mov dword [esp + 0x74], eax
jle 0x40ed9b
mov edx, dword [esp + 0x7c]
mov ebp, dword [sym.imp.GDI32.dll_SelectObject]
add edi, esi
mov dword [esp + 0x1c], eax
mov dword [esp + 0x7c], edi
mov edi, dword [esp + 0x60]
mov dword [esp + 0x24], edx
jmp 0x40ec5e
mov esi, dword [esp + 0x64]
mov ebx, dword [esp + 0x78]
mov ecx, dword [ebx + 0x20]
mov ebx, dword [esp + 0x1c]
lea eax, [ecx + 1]
imul eax, dword [esp + 0x10]
add eax, ebx
add eax, esi
xor esi, esi
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x70]
test ecx, ecx
mov dword [esp + 0x50], eax
mov ebx, eax
jle 0x40ed64
jmp 0x40ec8f
mov eax, dword [esp + 0x70]
mov ecx, dword [edx]
test esi, esi
jne 0x40ecbd
fild dword [esp + 0x6c]
mov edx, dword [esp + 0x14]
fsubr qword [ecx]
sub eax, dword [esp + 0x68]
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x6c]
fild dword [esp + 0x60]
sub edx, eax
fmulp st(1)
mov dword [esp + 0x60], edx
fild dword [esp + 0x60]
jmp 0x40ece0
mov edx, dword [esp + 0x68]
sub eax, edx
mov edx, dword [esp + 0x14]
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x6c]
fild dword [esp + 0x60]
sub edx, eax
mov dword [esp + 0x60], edx
fmul qword [ecx + esi*8]
fild dword [esp + 0x60]
fdivp st(1)
call fcn.00496fa4
sub ebx, eax
mov eax, dword [esi*4 + 0x4d5924]
push eax
call dword [sym.imp.GDI32.dll_CreateSolidBrush]
push eax
push edi
call ebp
mov ecx, dword [esi*4 + 0x4d5924]
mov dword [esp + 0x60], eax
push ecx
push 0
push 0
call dword [sym.imp.GDI32.dll_CreatePen]
push eax
push edi
call ebp
mov edx, dword [esp + 0x50]
mov ecx, dword [esp + 0x7c]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x40]
push edx
push eax
push ebx
push ecx
push edi
call dword [sym.imp.GDI32.dll_Rectangle]
mov edx, dword [esp + 0x60]
mov dword [esp + 0x50], ebx
push edx
push edi
call ebp
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [esp + 0x18]
push eax
push edi
call ebp
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov ecx, dword [esp + 0x78]
mov edx, dword [esp + 0x24]
inc esi
cmp esi, dword [ecx + 0x20]
jl 0x40ec8b
mov ecx, dword [esp + 0x28]
mov ebx, dword [esp + 0x1c]
mov esi, dword [esp + 0x7c]
mov eax, dword [esp + 0x74]
add ebx, ecx
add esi, ecx
mov ecx, dword [esp + 0x78]
mov dword [esp + 0x7c], esi
inc eax
add edx, 4
mov esi, dword [ecx + 8]
mov dword [esp + 0x74], eax
cmp eax, esi
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x24], edx
jl 0x40ec56
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret