Function at 0x4040f0
Capabilities:
Access peb ldr_data

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x40b3c0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x6c
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
mov ecx, dword [edi + 0x50]
mov eax, dword [edi + 0x60]
mov ebx, dword [edi + 0x58]
push ecx
lea ecx, [esp + 0x30]
mov dword [esp + 0x14], eax
call sub.MFC42.DLL_CBrush::CBrush
push 0
push 0
push 5
lea ecx, [esp + 0x30]
mov dword [esp + 0x8c], 0
call sub.MFC42.DLL_CPen::CPen
mov edx, dword [ebp + 0x14]
mov byte [esp + 0x80], 1
mov eax, dword [edx]
mov dword [esp + 0x68], eax
mov ecx, dword [edx + 4]
mov dword [esp + 0x6c], ecx
mov eax, dword [edx + 8]
mov ecx, dword [edx + 0xc]
mov edx, dword [ebp + 0x10]
mov esi, dword [edx]
mov edx, dword [edx + 8]
sub edx, esi
mov dword [esp + 0x14], esi
mov dword [esp + 0xc], edx
mov edx, dword [ebp + 0x10]
fild dword [esp + 0xc]
mov esi, dword [edx + 4]
mov edx, dword [edx + 0xc]
sub edx, esi
mov dword [esp + 0x1c], esi
fstp qword [esp + 0x34]
mov dword [esp + 0xc], edx
mov edx, dword [esp + 0x68]
fild dword [esp + 0xc]
sub eax, edx
fstp qword [esp + 0x3c]
fild dword [esp + 0x14]
fstp qword [esp + 0x4c]
fild dword [esp + 0x1c]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x6c]
sub ecx, eax
lea eax, [ebx*8]
fstp qword [esp + 0x5c]
fild dword [esp + 0x1c]
fld qword [esp + 0x34]
mov dword [esp + 0x1c], ecx
push eax
fdiv st(1)
fst qword [esp + 0x48]
fild dword [esp + 0x20]
fld qword [esp + 0x40]
fdiv st(1)
fst qword [esp + 0x58]
fxch st(1)
fmul st(1)
fstp qword [esp + 0x18]
fstp st(0)
fxch st(1)
fmul st(1)
fstp qword [esp + 0x20]
fstp st(0)
call sub.MFC42.DLL_operatornew
add esp, 4
mov dword [esp + 0xc], eax
test ebx, ebx
jle 0x4042f9
or eax, eax
je 0x404306
mov ecx, dword [esp + 0x10]
test ecx, ecx
jle 0x4042f9
xor esi, esi
or ebx, ebx
jle 0x40429d
fld qword [esp + 0x34]
fsub qword [esp + 0x1c]
fmul qword [0x40c338]
fld qword [esp + 0x3c]
fsub qword [esp + 0x14]
fmul qword [0x40c338]
mov ecx, dword [edi + 0x5c]
mov eax, dword [esp + 0x68]
mov edx, dword [ecx + esi*8]
sub edx, eax
mov dword [esp + 0x1c], edx
fild dword [esp + 0x1c]
fmul qword [esp + 0x44]
fadd st(2)
fadd qword [esp + 0x4c]
call sub.MSVCRT.dll__ftol
mov ecx, dword [esp + 0xc]
mov dword [ecx + esi*8], eax
mov edx, dword [edi + 0x5c]
mov eax, dword [edx + esi*8 + 4]
mov edx, dword [esp + 0x6c]
sub eax, edx
mov dword [esp + 0x1c], eax
fild dword [esp + 0x1c]
fmul qword [esp + 0x54]
fadd st(1)
fadd qword [esp + 0x5c]
call sub.MSVCRT.dll__ftol
mov ecx, dword [esp + 0xc]
inc esi
cmp esi, ebx
mov dword [ecx + esi*8 - 4], eax
jl 0x40423e
fstp st(0)
fstp st(0)
mov esi, dword [ebp + 8]
lea edx, [esp + 0x2c]
push edx
push esi
pop ecx
call sub.MFC42.DLL_CDC::SelectObject_1
push eax
pop ebx
lea eax, [esp + 0x24]
push eax
push esi
pop ecx
call sub.MFC42.DLL_CDC::SelectObject_2
mov ecx, dword [edi + 0x54]
mov dword [esp + 0x1c], eax
push ecx
mov ecx, esi
call sub.MFC42.DLL_CDC::SetPolyFillMode
mov edx, dword [esp + 0x10]
mov edi, dword [edi + 0x64]
mov eax, dword [esp + 0xc]
mov ecx, dword [esi + 4]
push edx
push edi
push eax
push ecx
call dword [sym.imp.GDI32.dll_PolyPolygon]
mov edx, dword [esp + 0x1c]
mov ecx, esi
push edx
call sub.MFC42.DLL_CDC::SelectObject_2
push ebx
push esi
pop ecx
call sub.MFC42.DLL_CDC::SelectObject_1
mov eax, dword [esp + 0xc]
test eax, eax
je 0x404306
push eax
call sub.MFC42.DLL_operatordelete
add esp, 4
mov esi, 0x40c324
mov dword [esp + 0x24], esi
lea ecx, [esp + 0x24]
mov byte [esp + 0x80], 2
call sub.MFC42.DLL_CGdiObject::DeleteObject
mov dword [esp + 0x24], 0x40c310
mov dword [esp + 0x2c], esi
lea ecx, [esp + 0x2c]
mov dword [esp + 0x80], 3
call sub.MFC42.DLL_CGdiObject::DeleteObject
mov ecx, dword [esp + 0x78]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
push ebp
pop esp
pop ebp
ret