Function at 0x545cbc
Capabilities:
Print debug messages

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [ebp + 0xc]
mov dword [ebp - 8], eax
push 0
call dword [sym.imp.USER32.dll_GetDC]
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp + 0x10]
xor edx, edx
mov dx, word [ecx + 4]
sar edx, 8
mov byte [ebp - 0x10], dl
mov eax, dword [ebp + 0x10]
xor ecx, ecx
mov cx, word [eax + 6]
sar ecx, 8
mov byte [ebp - 0xf], cl
mov edx, dword [ebp + 0x10]
xor eax, eax
mov ax, word [edx + 8]
sar eax, 8
mov byte [ebp - 0xe], al
mov byte [ebp - 0xd], 0
push 0x26
mov ecx, dword [ebp - 0xc]
push ecx
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
and eax, 0x100
test eax, eax
je 0x545ed3
push 0x68
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x10]
and eax, 0xff
mov ecx, dword [ebp - 0xf]
and ecx, 0xff
shl ecx, 8
or eax, ecx
mov edx, dword [ebp - 0xe]
and edx, 0xff
shl edx, 0x10
or eax, edx
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
push eax
mov ecx, dword [ebp - 8]
mov edx, dword [ecx]
push edx
call dword [sym.imp.GDI32.dll_GetNearestPaletteIndex]
mov dword [ebp - 0x24], eax
lea eax, [ebp - 4]
push eax
push 1
mov ecx, dword [ebp - 0x24]
push ecx
mov edx, dword [ebp - 8]
mov eax, dword [edx]
push eax
call dword [sym.imp.GDI32.dll_GetPaletteEntries]
mov ecx, dword [ebp - 4]
and ecx, 0xff
mov edx, dword [ebp - 3]
and edx, 0xff
shl edx, 8
or ecx, edx
mov eax, dword [ebp - 2]
and eax, 0xff
shl eax, 0x10
or ecx, eax
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0x24]
cmp edx, dword [ecx + 4]
jae 0x545dba
mov eax, dword [ebp - 0x20]
cmp eax, dword [ebp - 0x14]
je 0x545e62
mov ecx, dword [ebp - 8]
mov edx, dword [ecx + 4]
cmp edx, dword [ebp - 0x2c]
jne 0x545e24
mov eax, dword [ebp - 4]
and eax, 0xff
imul eax, eax, 0x101
mov ecx, dword [ebp + 0x10]
mov word [ecx + 4], ax
mov edx, dword [ebp - 3]
and edx, 0xff
imul edx, edx, 0x101
mov eax, dword [ebp + 0x10]
mov word [eax + 6], dx
mov ecx, dword [ebp - 2]
and ecx, 0xff
imul ecx, ecx, 0x101
mov edx, dword [ebp + 0x10]
mov word [edx + 8], cx
mov eax, dword [ebp - 4]
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0x24]
cmp edx, dword [ecx + 4]
jb 0x545e22
push 0x59eb78
call dword [sym.imp.KERNEL32.DLL_OutputDebugStringA]
jmp 0x545e62
mov eax, dword [ebp - 8]
mov ecx, dword [eax + 4]
add ecx, 1
mov edx, dword [ebp - 8]
mov dword [edx + 4], ecx
mov eax, dword [ebp - 8]
mov ecx, dword [eax + 4]
push ecx
mov edx, dword [ebp - 8]
mov eax, dword [edx]
push eax
call dword [sym.imp.GDI32.dll_ResizePalette]
lea ecx, [ebp - 0x10]
push ecx
push 1
mov edx, dword [ebp - 8]
mov eax, dword [edx + 4]
sub eax, 1
push eax
mov ecx, dword [ebp - 8]
mov edx, dword [ecx]
push edx
call dword [sym.imp.GDI32.dll_SetPaletteEntries]
mov eax, dword [ebp - 0x10]
and eax, 0xff
mov ecx, dword [ebp - 0xf]
and ecx, 0xff
shl ecx, 8
or eax, ecx
mov edx, dword [ebp - 0xe]
and edx, 0xff
shl edx, 0x10
or eax, edx
or eax, 0x2000000
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
lea edx, [ebp - 0x1c]
push edx
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax]
push ecx
mov edx, dword [ebp - 8]
add edx, 0xc
push edx
mov eax, dword [ebp - 8]
call dword [eax + 0x3c]
add esp, 0xc
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x1c], 0
je 0x545ebc
mov dword [ebp - 0x28], 1
jmp 0x545ec8
mov ecx, dword [ebp - 0x18]
mov edx, dword [ecx + 0xc]
add edx, 1
mov dword [ebp - 0x28], edx
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x28]
mov dword [eax + 0xc], ecx
jmp 0x545f52
mov edx, dword [ebp - 0x10]
and edx, 0xff
mov eax, dword [ebp - 0xf]
and eax, 0xff
shl eax, 8
or edx, eax
mov ecx, dword [ebp - 0xe]
and ecx, 0xff
shl ecx, 0x10
or edx, ecx
push edx
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.GDI32.dll_GetNearestColor]
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
mov edx, dword [ebp + 0x10]
xor eax, eax
mov al, byte [edx]
imul eax, eax, 0x101
mov ecx, dword [ebp + 0x10]
mov word [ecx + 4], ax
mov edx, dword [ebp + 0x10]
xor eax, eax
mov ax, word [edx]
sar eax, 8
and eax, 0xff
imul eax, eax, 0x101
mov ecx, dword [ebp + 0x10]
mov word [ecx + 6], ax
mov edx, dword [ebp + 0x10]
mov eax, dword [edx]
shr eax, 0x10
and eax, 0xff
imul eax, eax, 0x101
mov ecx, dword [ebp + 0x10]
mov word [ecx + 8], ax
mov edx, dword [ebp - 0xc]
push edx
push 0
call dword [sym.imp.USER32.dll_ReleaseDC]
mov eax, 1
mov esp, ebp
pop ebp
ret