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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x538998
mov eax, dword fs:[0]
push eax
sub esp, 0x80
mov eax, dword [0x58bcc0]
xor eax, esp
mov dword [esp + 0x78], eax
push ebx
push esi
push edi
mov eax, dword [0x58bcc0]
xor eax, esp
push eax
lea eax, [esp + 0x90]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0x10]
mov dword [esp + 0x28], eax
mov eax, dword [ebp + 0x14]
movzx edx, al
mov dword [esp + 0x34], ecx
mov ecx, dword [ebp + 0x18]
mov dword [esp + 0x64], edx
movzx ebx, cl
sub ebx, edx
mov edx, eax
shr edx, 8
movzx edx, dl
mov dword [esp + 0x4c], edx
mov edx, ecx
shr edx, 8
mov edi, dword [ebp + 0xc]
shr eax, 0x10
movzx esi, dl
sub esi, dword [esp + 0x4c]
movzx edx, al
shr ecx, 0x10
movzx eax, cl
sub eax, edx
mov dword [esp + 0x54], edx
mov dword [esp + 0x14], eax
cdq
mov ecx, eax
xor ecx, edx
mov eax, esi
sub ecx, edx
cdq
mov dword [esp + 0x1c], esi
mov esi, eax
xor esi, edx
sub esi, edx
mov dword [esp + 0x38], edi
mov dword [esp + 0x20], ebx
mov dword [esp + 0x18], esi
cmp esi, ecx
jg 0x408a26
mov dword [esp + 0x18], ecx
mov eax, ebx
cdq
xor eax, edx
sub eax, edx
cmp eax, dword [esp + 0x18]
jle 0x408a39
mov dword [esp + 0x18], eax
jmp 0x408a45
mov dword [esp + 0x18], esi
cmp esi, ecx
jg 0x408a45
mov dword [esp + 0x18], ecx
mov eax, dword [edi + 8]
sub eax, dword [edi]
cmp eax, dword [esp + 0x18]
jge 0x408a54
mov dword [esp + 0x18], eax
cmp dword [esp + 0x18], 0
jne 0x408a63
mov dword [esp + 0x18], 1
fild dword [esp + 0x18]
mov esi, dword [esp + 0x28]
mov eax, dword [esi]
mov eax, dword [eax + 8]
fstp dword [esp + 0x24]
mov ebx, dword [sym.imp.GDI32.dll_GetDeviceCaps]
fild dword [esp + 0x20]
push 0x26
fld dword [esp + 0x28]
push eax
fld st(0)
fdivp st(2)
fxch st(1)
fstp dword [esp + 0x60]
fild dword [esp + 0x24]
fdiv st(1)
fstp dword [esp + 0x64]
fidivr dword [esp + 0x1c]
fstp dword [esp + 0x58]
call ebx
and eax, 0x100
mov dword [esp + 0x60], eax
jne 0x408adf
cmp dword [esp + 0x18], 1
jle 0x408adf
mov eax, dword [esi]
mov ecx, dword [eax + 8]
push 0xc
push ecx
call ebx
mov esi, dword [esi]
mov edx, dword [esi + 8]
push 0xe
push edx
mov dword [esp + 0x1c], eax
call ebx
imul eax, dword [esp + 0x14]
cmp eax, 8
jge 0x408adf
mov dword [esp + 0x18], 1
mov eax, dword [edi + 8]
sub eax, dword [edi]
mov ecx, dword [edi]
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
mov edx, dword [edi + 4]
mov eax, dword [edi + 8]
mov dword [esp + 0x3c], ecx
fidiv dword [esp + 0x18]
mov ecx, dword [edi + 0xc]
xor esi, esi
mov dword [esp + 0x40], edx
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], ecx
mov dword [esp + 0x30], esi
mov dword [esp + 0x2c], vtable.CBrush.0
fstp dword [esp + 0x24]
mov dword [esp + 0x98], esi
mov dword [esp + 0x20], esi
cmp dword [esp + 0x18], esi
jle 0x408ccc
fld dword [esp + 0x24]
jmp 0x408b3c
mov edi, dword [esp + 0x38]
fild dword [esp + 0x20]
mov ebx, dword [edi]
fstp dword [esp + 0x14]
fld dword [esp + 0x14]
fld st(0)
fmul st(2)
call fcn.00518b80
lea edx, [esi + 1]
mov dword [esp + 0x20], edx
fild dword [esp + 0x20]
add eax, ebx
mov dword [esp + 0x3c], eax
fmul st(2)
call fcn.00518b80
lea edi, [ebx + eax]
mov eax, dword [esp + 0x18]
dec eax
mov dword [esp + 0x44], edi
cmp esi, eax
jne 0x408b86
mov eax, dword [esp + 0x38]
mov edi, dword [eax + 8]
mov dword [esp + 0x44], edi
mov ecx, dword [esp + 0x34]
mov eax, dword [ecx]
cmp edi, eax
jl 0x408cb6
fstp st(1)
cmp dword [esp + 0x3c], eax
jge 0x408ba0
mov dword [esp + 0x3c], eax
mov eax, dword [ecx + 8]
cmp edi, eax
jle 0x408bad
mov edi, eax
mov dword [esp + 0x44], edi
fnstcw word [esp + 0x1c]
movzx eax, word [esp + 0x1c]
fld st(0)
fmul dword [esp + 0x50]
or eax, 0xc00
mov dword [esp + 0x14], eax
fldcw word [esp + 0x14]
fistp dword [esp + 0x14]
mov cl, byte [esp + 0x14]
add cl, byte [esp + 0x54]
fldcw word [esp + 0x1c]
movzx ecx, cl
shl ecx, 8
fnstcw word [esp + 0x1c]
fld st(0)
movzx eax, word [esp + 0x1c]
fmul dword [esp + 0x5c]
or eax, 0xc00
mov dword [esp + 0x14], eax
fldcw word [esp + 0x14]
fistp dword [esp + 0x14]
movzx edx, byte [esp + 0x14]
add dl, byte [esp + 0x4c]
fldcw word [esp + 0x1c]
movzx eax, dl
or ecx, eax
shl ecx, 8
fmul dword [esp + 0x58]
fnstcw word [esp + 0x1c]
movzx eax, word [esp + 0x1c]
or eax, 0xc00
mov dword [esp + 0x14], eax
fldcw word [esp + 0x14]
fistp dword [esp + 0x14]
movzx edx, byte [esp + 0x14]
add dl, byte [esp + 0x64]
fldcw word [esp + 0x1c]
movzx eax, dl
or ecx, eax
cmp dword [esp + 0x60], 0
push ecx
je 0x408c8c
call dword [sym.imp.GDI32.dll_CreateSolidBrush]
push eax
lea ecx, [esp + 0x30]
call fcn.004169a7
mov ebx, dword [esp + 0x28]
lea esi, [esp + 0x3c]
mov ecx, ebx
lea eax, [esp + 0x68]
call fcn.00409730
mov edx, dword [esp + 0x30]
mov ecx, dword [ebx]
push edx
push eax
mov eax, dword [ecx + 4]
push eax
call dword [sym.imp.USER32.dll_FillRect]
lea ecx, [esp + 0x2c]
call fcn.00416a01
jmp 0x408ca7
mov ebx, dword [esp + 0x2c]
lea esi, [esp + 0x40]
mov ecx, ebx
lea eax, [esp + 0x7c]
call fcn.00409730
mov ecx, dword [ebx]
push eax
call fcn.0041f74f
mov ecx, dword [esp + 0x34]
cmp edi, dword [ecx + 8]
jge 0x408ccc
fld dword [esp + 0x24]
jmp 0x408cb8
fstp st(0)
mov esi, dword [esp + 0x20]
mov dword [esp + 0x20], esi
cmp esi, dword [esp + 0x18]
jl 0x408b38
fstp st(0)
mov dword [esp + 0x98], 0xffffffff
lea ecx, [esp + 0x2c]
mov dword [esp + 0x2c], vtable.CBrush.0
call fcn.00406680
mov ecx, dword [esp + 0x90]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x78]
xor ecx, esp
call fcn.00513242
mov esp, ebp
pop ebp
ret 0x14