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

Disassembly:
sub esp, 0x40
mov ecx, dword [esp + 0x58]
mov edx, dword [esp + 0x50]
sub ecx, edx
push ebx
mov ebx, dword [esp + 0x64]
mov eax, ecx
push ebp
push esi
mov esi, dword [ebx + 8]
push edi
cdq
idiv esi
mov edi, dword [ebx + 0x20]
add edi, 2
imul edi, esi
mov dword [esp + 0x14], eax
mov eax, ecx
cdq
idiv edi
mov ecx, dword [ebx + 0x18]
mov dword [esp + 0x18], eax
mov eax, dword [ebx + 0x14]
mov edx, dword [ecx + eax*4 - 4]
push edx
call fcn.0049717e
mov dword [esp + 0x14], eax
mov eax, dword [ebx + 0x18]
mov ecx, dword [eax]
push ecx
call fcn.0049717e
mov ecx, dword [esp + 0x60]
add esp, 8
cmp ecx, 2
mov dword [esp + 0x1c], eax
jne 0x40feb5
mov ecx, dword [esp + 0x5c]
mov esi, dword [esp + 0x54]
mov edi, dword [sym.imp.GDI32.dll_SelectObject]
cmp ecx, 5
jg 0x40f919
mov ecx, dword [ebx + 0x20]
xor ebp, ebp
test ecx, ecx
mov dword [esp + 0x68], ebp
jle 0x40f919
fild dword [esp + 0x6c]
mov edx, dword [esp + 0x6c]
mov ecx, dword [esp + 0x64]
sub edx, ecx
mov ecx, dword [esp + 0x60]
fstp qword [esp + 0x48]
fild dword [esp + 0x10]
mov dword [esp + 0x70], edx
mov edx, dword [esp + 0x10]
sub eax, edx
mov dword [esp + 0x20], 0x4d5924
fstp qword [esp + 0x30]
fild dword [esp + 0x70]
mov dword [esp + 0x70], eax
mov eax, dword [esp + 0x14]
cdq
fstp qword [esp + 0x38]
fild dword [esp + 0x70]
sub eax, edx
sar eax, 1
fstp qword [esp + 0x40]
mov dword [esp + 0x24], eax
add eax, ecx
mov dword [esp + 0x28], eax
mov edx, dword [esp + 0x20]
mov eax, dword [edx]
push eax
push 0
push 0
call dword [sym.imp.GDI32.dll_CreatePen]
push eax
push esi
call edi
mov ecx, dword [esp + 0x74]
mov dword [esp + 0x58], eax
lea eax, [ebp*8]
push 0
add eax, dword [ecx]
fld qword [eax]
fsub qword [esp + 0x34]
fmul qword [esp + 0x3c]
fdiv qword [esp + 0x44]
fsubr qword [esp + 0x4c]
call fcn.00496fa4
mov edx, dword [esp + 0x2c]
push eax
push edx
push esi
call dword [sym.imp.GDI32.dll_MoveToEx]
mov ecx, dword [ebx + 8]
mov eax, 1
cmp ecx, eax
mov dword [esp + 0x70], eax
jle 0x40f8ef
mov eax, dword [esp + 0x74]
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x14]
add eax, 4
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x60]
lea ebp, [ecx + edx]
add ebp, eax
mov ecx, dword [esp + 0x54]
mov eax, dword [esp + 0x68]
shl eax, 3
add eax, dword [ecx]
fld qword [eax]
fsub qword [esp + 0x30]
fmul qword [esp + 0x38]
fdiv qword [esp + 0x40]
fsubr qword [esp + 0x48]
call fcn.00496fa4
push eax
push ebp
push esi
call dword [sym.imp.GDI32.dll_LineTo]
mov ecx, dword [esp + 0x54]
mov eax, dword [esp + 0x70]
mov edx, dword [esp + 0x14]
add ecx, 4
mov dword [esp + 0x54], ecx
mov ecx, dword [ebx + 8]
inc eax
add ebp, edx
cmp eax, ecx
mov dword [esp + 0x70], eax
jl 0x40f89d
mov ebp, dword [esp + 0x68]
mov edx, dword [esp + 0x58]
push edx
push esi
call edi
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov ecx, dword [esp + 0x20]
mov eax, dword [ebx + 0x20]
inc ebp
add ecx, 4
cmp ebp, eax
mov dword [esp + 0x68], ebp
mov dword [esp + 0x20], ecx
jl 0x40f825
mov eax, dword [esp + 0x5c]
cmp eax, 5
je 0x40f92b
cmp eax, 6
jne 0x40fa95
mov edx, dword [ebx + 8]
xor ecx, ecx
cmp edx, ecx
mov dword [esp + 0x68], ecx
jle 0x40fa95
mov eax, dword [esp + 0x74]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x14]
mov ecx, dword [ebx + 0x20]
mov dword [esp + 0x70], 0
test ecx, ecx
jle 0x40fa64
mov ebp, dword [esp + 0x24]
mov ecx, dword [esp + 0x60]
cdq
fild dword [esp + 0x6c]
sub eax, edx
sar eax, 1
fstp qword [esp + 0x48]
add eax, ebp
mov ebp, 0x4d5924
fild dword [esp + 0x10]
add eax, ecx
mov ecx, dword [esp + 0x6c]
fstp qword [esp + 0x30]
lea edx, [eax + 2]
mov dword [esp + 0x28], edx
mov edx, dword [esp + 0x64]
sub ecx, edx
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x58], ecx
mov ecx, dword [esp + 0x10]
fild dword [esp + 0x58]
sub edx, ecx
add eax, 0xfffffffe
mov dword [esp + 0x58], edx
mov dword [esp + 0x2c], eax
fstp qword [esp + 0x38]
fild dword [esp + 0x58]
fstp qword [esp + 0x40]
mov eax, dword [ebp]
push eax
push 0
push 0
call dword [sym.imp.GDI32.dll_CreatePen]
push eax
push esi
call edi
mov ecx, dword [ebp]
mov dword [esp + 0x58], eax
push ecx
call dword [sym.imp.GDI32.dll_CreateSolidBrush]
push eax
push esi
call edi
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x70]
mov dword [esp + 0x54], eax
mov eax, dword [edx]
fld qword [eax + ecx*8]
fsub qword [esp + 0x30]
fmul qword [esp + 0x38]
fdiv qword [esp + 0x40]
fsubr qword [esp + 0x48]
fld st(0)
fadd qword [0x4bd0c0]
call fcn.00496fa4
fsub qword [0x4bd0c0]
mov edx, dword [esp + 0x28]
push eax
push edx
call fcn.00496fa4
push eax
mov eax, dword [esp + 0x38]
push eax
push esi
call dword [sym.imp.GDI32.dll_Rectangle]
mov ecx, dword [esp + 0x58]
push ecx
push esi
call edi
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov edx, dword [esp + 0x54]
push edx
push esi
call edi
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [esp + 0x70]
mov ecx, dword [ebx + 0x20]
inc eax
add ebp, 4
cmp eax, ecx
mov dword [esp + 0x70], eax
jl 0x40f9bf
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x68]
mov ebp, dword [esp + 0x24]
mov edx, dword [ebx + 8]
add eax, 4
inc ecx
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x14]
add ebp, eax
cmp ecx, edx
mov dword [esp + 0x68], ecx
mov dword [esp + 0x24], ebp
jl 0x40f94c
mov eax, dword [esp + 0x5c]
cmp eax, 7
jne 0x40feb5
mov eax, dword [ebx + 0x20]
mov dword [esp + 0x68], 0
inc eax
cdq
sub eax, edx
sar eax, 1
test eax, eax
jle 0x40fc10
fild dword [esp + 0x6c]
mov eax, dword [esp + 0x6c]
mov ecx, dword [esp + 0x64]
sub eax, ecx
mov ecx, dword [esp + 0x1c]
fstp qword [esp + 0x48]
fild dword [esp + 0x10]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x18]
sub ecx, eax
fstp qword [esp + 0x30]
fild dword [esp + 0x5c]
mov eax, dword [esp + 0x60]
mov dword [esp + 0x5c], ecx
add edx, eax
mov dword [esp + 0x24], 0x4d5924
fstp qword [esp + 0x38]
fild dword [esp + 0x5c]
mov dword [esp + 0x5c], edx
fstp qword [esp + 0x40]
mov ecx, dword [esp + 0x24]
mov edx, dword [ecx]
push edx
push 0
push 0
call dword [sym.imp.GDI32.dll_CreatePen]
push eax
push esi
call edi
mov ecx, dword [esp + 0x74]
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x68]
push 0
mov edx, dword [ecx]
shl eax, 3
add eax, edx
fld qword [eax]
fsub qword [esp + 0x34]
fmul qword [esp + 0x3c]
fdiv qword [esp + 0x44]
fsubr qword [esp + 0x4c]
call fcn.00496fa4
mov edx, dword [esp + 0x60]
push eax
push edx
push esi
call dword [sym.imp.GDI32.dll_MoveToEx]
mov eax, dword [ebx + 8]
mov ebp, 1
cmp eax, ebp
jle 0x40fbce
mov eax, dword [esp + 0x74]
mov ecx, dword [esp + 0x5c]
mov edx, dword [esp + 0x14]
add eax, 4
add ecx, edx
mov dword [esp + 0x70], eax
mov dword [esp + 0x54], ecx
mov ecx, dword [esp + 0x70]
mov eax, dword [esp + 0x68]
shl eax, 3
add eax, dword [ecx]
fld qword [eax]
fsub qword [esp + 0x30]
fmul qword [esp + 0x38]
fdiv qword [esp + 0x40]
fsubr qword [esp + 0x48]
call fcn.00496fa4
mov edx, dword [esp + 0x54]
push eax
push edx
push esi
call dword [sym.imp.GDI32.dll_LineTo]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x54]
mov edx, dword [esp + 0x70]
add ecx, eax
mov eax, dword [ebx + 8]
inc ebp
add edx, 4
cmp ebp, eax
mov dword [esp + 0x70], edx
mov dword [esp + 0x54], ecx
jl 0x40fb7c
mov ecx, dword [esp + 0x58]
push ecx
push esi
call edi
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x5c]
mov ecx, dword [esp + 0x68]
mov ebp, dword [esp + 0x24]
add eax, edx
inc ecx
mov dword [esp + 0x5c], eax
mov eax, dword [ebx + 0x20]
add ebp, 4
inc eax
cdq
sub eax, edx
mov dword [esp + 0x68], ecx
sar eax, 1
cmp ecx, eax
mov dword [esp + 0x24], ebp
jl 0x40fb09
mov ecx, dword [ebx + 8]
xor eax, eax
cmp ecx, eax
mov dword [esp + 0x68], eax
jle 0x40feb5
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x60]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x74]
mov dword [esp + 0x5c], eax
lea eax, [ecx + edx - 2]
mov dword [esp + 0x28], eax
mov eax, dword [ebx + 0x20]
mov dword [esp + 0x70], 0
inc eax
cdq
sub eax, edx
sar eax, 1
test eax, eax
jle 0x40fd58
fild dword [esp + 0x6c]
mov ecx, dword [esp + 0x6c]
mov edx, dword [esp + 0x64]
mov eax, dword [esp + 0x10]
sub ecx, edx
fstp qword [esp + 0x48]
fild dword [esp + 0x10]
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x74], ecx
sub edx, eax
mov ebp, dword [esp + 0x28]
fstp qword [esp + 0x30]
fild dword [esp + 0x74]
mov dword [esp + 0x74], edx
fstp qword [esp + 0x38]
fild dword [esp + 0x74]
mov dword [esp + 0x74], 0x4d5924
fstp qword [esp + 0x40]
mov eax, dword [esp + 0x74]
mov ecx, dword [eax]
push ecx
push 0
push 0
call dword [sym.imp.GDI32.dll_CreatePen]
push eax
push esi
call edi
mov edx, dword [esp + 0x74]
mov dword [esp + 0x58], eax
mov eax, dword [edx]
push eax
call dword [sym.imp.GDI32.dll_CreateSolidBrush]
push eax
push esi
call edi
mov ecx, dword [esp + 0x5c]
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x70]
mov edx, dword [ecx]
fld qword [edx + eax*8]
fsub qword [esp + 0x30]
fmul qword [esp + 0x38]
fdiv qword [esp + 0x40]
fsubr qword [esp + 0x48]
fld st(0)
fadd qword [0x4bd0c0]
call fcn.00496fa4
fsub qword [0x4bd0c0]
lea ecx, [ebp + 4]
push eax
push ecx
call fcn.00496fa4
push eax
push ebp
push esi
call dword [sym.imp.GDI32.dll_Rectangle]
mov edx, dword [esp + 0x58]
push edx
push esi
call edi
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [esp + 0x54]
push eax
push esi
call edi
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [esp + 0x74]
mov ecx, dword [esp + 0x70]
mov edx, dword [esp + 0x18]
add eax, 4
mov dword [esp + 0x74], eax
mov eax, dword [ebx + 0x20]
inc ecx
add ebp, edx
inc eax
mov dword [esp + 0x70], ecx
cdq
sub eax, edx
sar eax, 1
cmp ecx, eax
jl 0x40fc9e
mov ecx, dword [ebx + 0x20]
lea eax, [ecx + 1]
cdq
sub eax, edx
mov ebp, eax
sar ebp, 1
cmp ebp, ecx
jge 0x40fe7e
fild dword [esp + 0x6c]
mov ecx, dword [esp + 0x6c]
mov edx, dword [esp + 0x64]
mov eax, dword [esp + 0x10]
sub ecx, edx
fstp qword [esp + 0x48]
fild dword [esp + 0x10]
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x74], ecx
sub edx, eax
lea eax, [ebp*4 + 0x4d5924]
fstp qword [esp + 0x30]
fild dword [esp + 0x74]
mov dword [esp + 0x74], edx
mov edx, dword [esp + 0x18]
mov dword [esp + 0x24], eax
lea eax, [ebp + 1]
imul eax, edx
fstp qword [esp + 0x38]
fild dword [esp + 0x74]
fstp qword [esp + 0x40]
mov ecx, dword [esp + 0x20]
add eax, ecx
mov ecx, dword [esp + 0x60]
add eax, ecx
mov dword [esp + 0x70], eax
lea eax, [ebp + 2]
imul eax, edx
add eax, dword [esp + 0x20]
add eax, ecx
mov dword [esp + 0x74], eax
push 7
call dword [sym.imp.GDI32.dll_GetStockObject]
push eax
push esi
call edi
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x58], eax
mov edx, dword [ecx]
push edx
call dword [sym.imp.GDI32.dll_CreateSolidBrush]
push eax
push esi
call edi
mov edx, dword [esp + 0x5c]
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x6c]
mov ecx, dword [esp + 0x74]
push eax
mov eax, dword [edx]
push ecx
fld qword [eax + ebp*8]
fsub qword [esp + 0x38]
fmul qword [esp + 0x40]
fdiv qword [esp + 0x48]
fsubr qword [esp + 0x50]
call fcn.00496fa4
mov ecx, dword [esp + 0x78]
push eax
push ecx
push esi
call dword [sym.imp.GDI32.dll_Rectangle]
mov edx, dword [esp + 0x54]
push edx
push esi
call edi
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [esp + 0x58]
push eax
push esi
call edi
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x74]
mov edx, dword [esp + 0x70]
add ecx, eax
mov dword [esp + 0x74], ecx
mov ecx, dword [esp + 0x24]
add edx, eax
mov eax, dword [ebx + 0x20]
inc ebp
add ecx, 4
cmp ebp, eax
mov dword [esp + 0x70], edx
mov dword [esp + 0x24], ecx
jl 0x40fdde
mov eax, dword [esp + 0x5c]
mov ebp, dword [esp + 0x20]
mov edx, dword [esp + 0x28]
mov ecx, dword [esp + 0x68]
add eax, 4
inc ecx
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x14]
add ebp, eax
add edx, eax
mov eax, dword [ebx + 8]
mov dword [esp + 0x68], ecx
cmp ecx, eax
mov dword [esp + 0x20], ebp
mov dword [esp + 0x28], edx
jl 0x40fc3d
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret