Function at 0x562b60
Capabilities:
Print debug messages

Disassembly:
sub esp, 0x18
push ebx
push esi
push edi
push 0
call dword [sym.imp.USER32.dll_GetDC]
mov edi, dword [esp + 0x30]
mov ebx, dword [sym.imp.GDI32.dll_GetDeviceCaps]
mov esi, eax
xor eax, eax
mov al, byte [edi + 5]
xor ecx, ecx
mov cl, byte [edi + 7]
xor edx, edx
mov dl, byte [edi + 9]
push 0x26
push esi
mov dword [esp + 0x18], esi
mov byte [esp + 0x1c], al
mov byte [esp + 0x1d], cl
mov byte [esp + 0x1e], dl
mov byte [esp + 0x1f], 0
call ebx
test ah, 1
je 0x562d0a
push ebp
push 0x68
push esi
call ebx
mov esi, dword [esp + 0x1a]
mov ecx, dword [esp + 0x18]
mov ebx, dword [esp + 0x30]
mov edx, dword [ebx]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x19]
and esi, 0xff
shl esi, 8
and eax, 0xff
or esi, eax
and ecx, 0xff
shl esi, 8
or esi, ecx
push esi
push edx
call dword [sym.imp.GDI32.dll_GetNearestPaletteIndex]
mov ecx, dword [ebx]
mov ebp, eax
lea eax, [esp + 0x20]
push eax
push 1
push ebp
push ecx
call dword [sym.imp.GDI32.dll_GetPaletteEntries]
mov eax, dword [ebx + 4]
cmp ebp, eax
mov ecx, dword [esp + 0x21]
jae 0x562c35
mov edx, dword [esp + 0x22]
and edx, 0xff
shl edx, 8
and ecx, 0xff
or edx, ecx
mov ecx, dword [esp + 0x20]
shl edx, 8
and ecx, 0xff
or edx, ecx
cmp esi, edx
je 0x562ca8
mov ecx, dword [esp + 0x21]
cmp eax, dword [esp + 0x34]
jne 0x562c85
mov edx, dword [esp + 0x20]
xor ax, ax
mov al, dl
mov dword [esp + 0x18], edx
mov esi, eax
shl esi, 8
add esi, eax
xor ax, ax
mov al, cl
mov word [edi + 4], si
mov esi, eax
shl esi, 8
add esi, eax
xor ax, ax
mov al, ch
mov word [edi + 6], si
mov ecx, eax
shl ecx, 8
add ecx, eax
mov word [edi + 8], cx
cmp ebp, dword [ebx + 4]
jb 0x562ca8
push str.XAllocColor:_Colormap_is_bigger_than_we_thought
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
jmp 0x562ca8
mov edx, dword [ebx]
inc eax
push eax
push edx
mov dword [ebx + 4], eax
call dword [sym.imp.GDI32.dll_ResizePalette]
mov ecx, dword [ebx + 4]
mov edx, dword [ebx]
lea eax, [esp + 0x18]
push eax
push 1
dec ecx
push ecx
push edx
call dword [sym.imp.GDI32.dll_SetPaletteEntries]
mov eax, dword [esp + 0x1a]
mov ecx, dword [esp + 0x19]
and eax, 0xff
or eax, 0x200
shl eax, 8
and ecx, 0xff
or eax, ecx
mov ecx, dword [esp + 0x18]
shl eax, 8
and ecx, 0xff
or eax, ecx
lea edx, [esp + 0x10]
push edx
push eax
mov dword [edi], eax
lea eax, [ebx + 0xc]
push eax
call dword [ebx + 0x3c]
mov ecx, dword [esp + 0x1c]
add esp, 0xc
test ecx, ecx
pop ebp
je 0x562cfd
mov esi, dword [esp + 0x10]
mov ecx, 1
mov dword [eax + 0xc], ecx
jmp 0x562d70
mov ecx, dword [eax + 0xc]
mov esi, dword [esp + 0x10]
inc ecx
mov dword [eax + 0xc], ecx
jmp 0x562d70
mov ecx, dword [esp + 0x16]
mov edx, dword [esp + 0x15]
mov eax, dword [esp + 0x14]
and ecx, 0xff
shl ecx, 8
and edx, 0xff
or ecx, edx
shl ecx, 8
and eax, 0xff
or ecx, eax
push ecx
push esi
call dword [sym.imp.GDI32.dll_GetNearestColor]
movzx cx, al
mov dword [edi], eax
shr eax, 0x10
movzx ax, al
mov edx, ecx
shl edx, 8
add edx, ecx
xor ecx, ecx
mov cl, byte [edi + 1]
movzx cx, cl
mov word [edi + 4], dx
mov edx, ecx
shl edx, 8
add edx, ecx
mov ecx, eax
shl ecx, 8
add ecx, eax
mov word [edi + 6], dx
mov word [edi + 8], cx
push esi
push 0
call dword [sym.imp.USER32.dll_ReleaseDC]
pop edi
pop esi
mov eax, 1
pop ebx
add esp, 0x18
ret