Function at 0x473438
Capabilities:
Print debug messages

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x3c
mov esi, dword [esp + 0x54]
mov ebx, dword [esp + 0x58]
mov dword [esp], 0
call sub.USER32.dll_GetDC
push edi
mov ebp, eax
movzx eax, byte [ebx + 5]
mov byte [esp + 0x28], al
movzx eax, byte [ebx + 7]
mov byte [esp + 0x29], al
movzx eax, byte [ebx + 9]
mov byte [esp + 0x2a], al
mov byte [esp + 0x2b], 0
mov dword [esp + 4], 0x26
mov dword [esp], ebp
call sub.GDI32.dll_GetDeviceCaps
sub esp, 8
test ah, 1
je 0x4735bc
mov dword [esp + 4], 0x68
mov dword [esp], ebp
call sub.GDI32.dll_GetDeviceCaps
sub esp, 8
mov dword [esp + 0x18], eax
movzx edi, byte [esp + 0x29]
shl edi, 8
movzx eax, byte [esp + 0x2a]
shl eax, 0x10
or edi, eax
movzx eax, byte [esp + 0x28]
or edi, eax
mov dword [esp + 4], edi
mov eax, dword [esi]
mov dword [esp], eax
call sub.GDI32.dll_GetNearestPaletteIndex
sub esp, 8
mov dword [esp + 0x14], eax
lea eax, [esp + 0x2c]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov eax, dword [esp + 0x14]
mov dword [esp + 4], eax
mov eax, dword [esi]
mov dword [esp], eax
call sub.GDI32.dll_GetPaletteEntries
sub esp, 0x10
mov dl, byte [esp + 0x2c]
mov byte [esp + 0x1d], dl
movzx eax, byte [esp + 0x2d]
mov byte [esp + 0x1e], al
mov dl, byte [esp + 0x2e]
mov byte [esp + 0x1f], dl
mov edx, dword [esi + 4]
cmp dword [esp + 0x14], edx
jb 0x473638
cmp dword [esp + 0x18], edx
jne 0x47365e
movzx eax, byte [esp + 0x1d]
mov edx, eax
shl edx, 8
add eax, edx
mov word [ebx + 4], ax
movzx eax, byte [esp + 0x1e]
mov edx, eax
shl edx, 8
add eax, edx
mov word [ebx + 6], ax
movzx eax, byte [esp + 0x1f]
mov edx, eax
shl edx, 8
add eax, edx
mov word [ebx + 8], ax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x14]
cmp dword [esp + 0x18], eax
jbe 0x4736a0
movzx eax, byte [esp + 0x28]
or eax, 0x2000000
movzx edx, byte [esp + 0x29]
shl edx, 8
or eax, edx
movzx edx, byte [esp + 0x2a]
shl edx, 0x10
or eax, edx
mov dword [ebx], eax
lea edx, [esp + 0x24]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
lea eax, [esi + 0xc]
mov dword [esp], eax
call dword [esi + 0x3c]
mov edx, dword [esp + 0x24]
test edx, edx
jne 0x4736b4
mov edx, dword [eax + 0xc]
inc edx
mov dword [eax + 0xc], edx
jmp 0x473616
movzx eax, byte [esp + 0x29]
shl eax, 8
movzx edx, byte [esp + 0x2a]
shl edx, 0x10
or eax, edx
movzx edx, byte [esp + 0x28]
or eax, edx
mov dword [esp + 4], eax
mov dword [esp], ebp
call sub.GDI32.dll_GetNearestColor
sub esp, 8
mov dword [ebx], eax
movzx edx, al
mov ecx, edx
shl ecx, 8
add edx, ecx
mov word [ebx + 4], dx
mov edx, eax
shr dx, 8
mov ecx, edx
shl ecx, 8
add edx, ecx
mov word [ebx + 6], dx
shr eax, 0x10
movzx eax, al
mov edx, eax
shl edx, 8
add eax, edx
mov word [ebx + 8], ax
mov dword [esp + 4], ebp
mov dword [esp], 0
call sub.USER32.dll_ReleaseDC
sub esp, 8
mov eax, 1
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
shl eax, 8
movzx ecx, byte [esp + 0x1f]
shl ecx, 0x10
or eax, ecx
movzx ecx, byte [esp + 0x1d]
or eax, ecx
cmp edi, eax
je 0x47356f
cmp dword [esp + 0x18], edx
je 0x473529
inc edx
mov dword [esi + 4], edx
mov dword [esp + 4], edx
mov eax, dword [esi]
mov dword [esp], eax
call sub.GDI32.dll_ResizePalette
sub esp, 8
lea eax, [esp + 0x28]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov eax, dword [esi + 4]
dec eax
mov dword [esp + 4], eax
mov eax, dword [esi]
mov dword [esp], eax
call sub.GDI32.dll_SetPaletteEntries
sub esp, 0x10
jmp 0x47356f
mov dword [esp], str.XAllocColor:_Colormap_is_bigger_than_we_thought
call sub.KERNEL32.dll_OutputDebugStringA
push ecx
jmp 0x47356f
mov edx, 1
jmp 0x4735b4