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

Disassembly:
sub esp, 0x70
push ebx
push esi
push edi
mov edi, dword [esp + 0x80]
mov eax, dword [edi + 8]
push 0x18
push eax
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
xor edx, edx
cmp eax, 0xffffffff
jne 0x416399
mov dword [esp + 0x94], edx
jmp 0x4163a8
mov eax, dword [esp + 0x94]
test eax, eax
jne 0x416473
mov esi, dword [0x475214]
cmp esi, edx
je 0x416473
mov ecx, dword [esp + 0x84]
mov eax, dword [ecx + 4]
mov dword [esp + 0x60], eax
mov eax, dword [ecx]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x88]
xor ebx, ebx
mov bh, al
mov word [esp + 0x6a], dx
mov word [esp + 0x7a], dx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], 1
mov word [esp + 0x64], bx
xor ebx, ebx
mov bh, ah
shr eax, 0x10
mov word [esp + 0x66], bx
xor ebx, ebx
mov bh, al
mov eax, dword [ecx + 0xc]
mov ecx, dword [ecx + 8]
mov dword [esp + 0x6c], ecx
xor ecx, ecx
mov dword [esp + 0x70], eax
mov eax, dword [esp + 0x8c]
mov ch, al
mov word [esp + 0x68], bx
mov word [esp + 0x74], cx
xor ecx, ecx
mov ch, ah
shr eax, 0x10
mov word [esp + 0x76], cx
xor ecx, ecx
mov ch, al
cmp dword [esp + 0x90], edx
lea eax, [esp + 0x5c]
mov word [esp + 0x78], cx
mov ecx, dword [edi + 4]
je 0x41645d
push edx
push 1
lea edx, [esp + 0x24]
push edx
push 2
push eax
push ecx
call esi
pop edi
pop esi
pop ebx
add esp, 0x70
ret
push 1
push 1
lea edx, [esp + 0x24]
push edx
push 2
push eax
push ecx
call esi
pop edi
pop esi
pop ebx
add esp, 0x70
ret
mov eax, dword [esp + 0x88]
mov ebx, dword [esp + 0x8c]
mov esi, dword [esp + 0x84]
shr eax, 0x10
mov byte [esp + 0xe], al
mov eax, ebx
shr eax, 0x10
mov byte [esp + 0xf], al
cmp dword [esp + 0x90], edx
push ebp
je 0x4164a9
mov ebp, dword [esi + 8]
sub ebp, dword [esi]
jmp 0x4164b5
mov eax, dword [esi + 0xc]
sub eax, dword [esi + 4]
mov dword [esp + 0x14], eax
mov ebp, eax
cmp dword [esp + 0x98], edx
push ebx
je 0x4164d4
mov edx, dword [edi + 8]
push edx
call dword [sym.imp.GDI32.dll_GetNearestColor]
push eax
push esi
mov ecx, edi
call fcn.00454a5f
jmp 0x4164fe
lea ecx, [esp + 0x24]
call fcn.00448c6f
mov eax, dword [esp + 0x24]
mov ecx, dword [edi + 4]
push eax
push esi
push ecx
call dword [sym.imp.USER32.dll_FillRect]
lea ecx, [esp + 0x20]
mov dword [esp + 0x20], vtable.CGdiObject.0
call fcn.00448ade
sub ebp, 2
mov dword [esp + 0x14], ebp
mov edi, 0
js 0x416694
mov edx, dword [esp + 0x8c]
movzx ecx, dl
movzx eax, bl
sub eax, ecx
movzx edx, dh
movzx ecx, bh
sub ecx, edx
movzx edx, byte [esp + 0x12]
mov dword [esp + 0x1c], ecx
movzx ecx, byte [esp + 0x13]
sub ecx, edx
mov dword [esp + 0x18], eax
mov dword [esp + 0x20], ecx
jmp 0x416550
mov ebp, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
lea esp, [esp]
push ebp
push edi
push eax
call dword [sym.imp.KERNEL32.dll_MulDiv]
mov cl, byte [esp + 0x8c]
push ebp
mov ebx, eax
mov eax, dword [esp + 0x20]
push edi
push eax
add bl, cl
call dword [sym.imp.KERNEL32.dll_MulDiv]
mov dl, byte [esp + 0x8d]
mov ecx, dword [esp + 0x20]
push ebp
push edi
add al, dl
push ecx
mov byte [esp + 0x1f], al
call dword [sym.imp.KERNEL32.dll_MulDiv]
mov dl, byte [esp + 0x12]
mov ecx, dword [esp + 0x94]
add al, dl
test ecx, ecx
mov edx, 2
je 0x4165d3
mov ebp, dword [esi + 4]
mov ecx, dword [esi + 0xc]
sub ecx, ebp
mov dword [esp + 0x28], edx
mov edx, dword [esi]
mov dword [esp + 0x2c], ecx
mov ecx, dword [esp + 0x28]
add edx, edi
add ecx, edx
mov dword [esp + 0x58], ecx
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x40], edx
mov edx, dword [esp + 0x58]
add ecx, ebp
mov dword [esp + 0x44], ebp
jmp 0x4165fb
mov ebp, dword [esi]
mov ecx, dword [esi + 8]
sub ecx, ebp
mov dword [esp + 0x3c], edx
mov edx, dword [esi + 4]
add ecx, ebp
mov dword [esp + 0x68], ecx
mov ecx, dword [esp + 0x3c]
add edx, edi
add ecx, edx
mov dword [esp + 0x44], edx
mov edx, dword [esp + 0x68]
mov dword [esp + 0x40], ebp
mov dword [esp + 0x4c], ecx
mov ecx, dword [esp + 0x98]
test ecx, ecx
mov dword [esp + 0x48], edx
je 0x41663f
xor ecx, ecx
mov ch, al
movzx edx, bl
mov ebx, dword [esp + 0x84]
mov eax, dword [ebx + 8]
mov cl, byte [esp + 0x13]
shl ecx, 8
or ecx, edx
push ecx
push eax
call dword [sym.imp.GDI32.dll_GetNearestColor]
push eax
lea ecx, [esp + 0x44]
push ecx
mov ecx, ebx
call fcn.00454a5f
jmp 0x416685
xor edx, edx
mov dh, al
movzx eax, bl
lea ecx, [esp + 0x30]
mov dl, byte [esp + 0x13]
shl edx, 8
or edx, eax
push edx
call fcn.00448c6f
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x84]
push ecx
mov ecx, dword [eax + 4]
lea edx, [esp + 0x44]
push edx
push ecx
call dword [sym.imp.USER32.dll_FillRect]
lea ecx, [esp + 0x30]
mov dword [esp + 0x30], vtable.CGdiObject.0
call fcn.00448ade
mov eax, dword [esp + 0x14]
add edi, 2
cmp edi, eax
jle 0x416541
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x70
ret