Function at 0x404580
Capabilities:
Resolve function by parsing pe exports
Write file on windows

Disassembly:
sub esp, 0x6c
push ebx
push ebp
push esi
push edi
xor edi, edi
push edi
push edi
push edi
push str.DISPLAY
mov dword [esp + 0x24], edi
mov dword [esp + 0x2c], edi
call dword [sym.imp.GDI32.dll_CreateDCW]
mov ebx, dword [sym.imp.GDI32.dll_GetDeviceCaps]
mov ebp, eax
push 0xe
push ebp
call ebx
push 0xc
push ebp
mov esi, eax
call ebx
imul esi, eax
push ebp
call dword [sym.imp.GDI32.dll_DeleteDC]
cmp esi, 1
jg 0x4046a5
mov ebx, 1
mov eax, 1
mov cl, bl
shl eax, cl
add eax, eax
add eax, eax
mov dword [esp + 0x14], eax
mov ecx, dword [esp + 0x80]
lea eax, [esp + 0x38]
push eax
push 0x18
push ecx
call dword [sym.imp.GDI32.dll_GetObjectW]
mov ecx, dword [esp + 0x3c]
mov esi, dword [esp + 0x40]
movzx eax, bx
imul eax, ecx
add eax, 0x1f
mov edx, 1
mov word [esp + 0x5c], dx
cdq
mov word [esp + 0x5e], bx
and edx, 0x1f
add eax, edx
mov ebx, eax
mov eax, dword [esp + 0x14]
sar ebx, 5
imul ebx, esi
add ebx, ebx
mov dword [esp + 0x54], ecx
add ebx, ebx
lea ecx, [ebx + eax + 0x28]
push ecx
push 0x42
mov dword [esp + 0x58], 0x28
mov dword [esp + 0x60], esi
mov dword [esp + 0x68], edi
mov dword [esp + 0x6c], edi
mov dword [esp + 0x70], edi
mov dword [esp + 0x74], edi
mov dword [esp + 0x78], edi
mov dword [esp + 0x7c], edi
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
mov dword [esp + 0x28], eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov edi, eax
mov ecx, 0xa
lea esi, [esp + 0x50]
push 0xf
mov dword [esp + 0x1c], eax
rep movsd dword es:[edi], dword [esi]
call dword [sym.imp.GDI32.dll_GetStockObject]
mov esi, eax
test esi, esi
je 0x4046e6
push 0
call dword [sym.imp.USER32.dll_GetDC]
push 0
mov ebp, eax
push esi
push ebp
call dword [sym.imp.GDI32.dll_SelectPalette]
push ebp
mov esi, eax
call dword [sym.imp.GDI32.dll_RealizePalette]
jmp 0x4046ea
cmp esi, 4
jg 0x4046b4
mov ebx, 4
jmp 0x4045cb
cmp esi, 8
jg 0x4046c3
mov ebx, 8
jmp 0x4045cb
cmp esi, 0x10
jg 0x4046d2
mov ebx, 0x10
jmp 0x4045dc
xor ebx, ebx
cmp esi, 0x18
setg bl
lea ebx, [ebx*8 + 0x18]
jmp 0x4045dc
mov esi, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
mov edi, dword [esp + 0x14]
mov ecx, dword [esp + 0x80]
push 0
push eax
lea edx, [eax + edi + 0x28]
mov eax, dword [esp + 0x48]
push edx
push eax
push 0
push ecx
push ebp
call dword [sym.imp.GDI32.dll_GetDIBits]
test esi, esi
je 0x40472e
push 1
push esi
push ebp
call dword [sym.imp.GDI32.dll_SelectPalette]
push ebp
call dword [sym.imp.GDI32.dll_RealizePalette]
push ebp
push 0
call dword [sym.imp.USER32.dll_ReleaseDC]
mov edx, dword [esp + 0x84]
push 0
push 0x8000080
push 2
push 0
push 0
push 0x40000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x4047bb
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, 0x4d42
xor edx, edx
push edx
mov word [esp + 0x2c], ax
xor ecx, ecx
lea eax, [esp + 0x24]
push eax
mov word [esp + 0x36], cx
push 0xe
lea ecx, [esp + 0x34]
lea ebx, [ebx + edi + 0x36]
push ecx
add edi, 0x36
push esi
mov dword [esp + 0x3e], ebx
mov word [esp + 0x44], dx
mov dword [esp + 0x46], edi
call ebp
mov eax, dword [esp + 0x18]
push 0
lea edx, [esp + 0x24]
push edx
push ebx
push eax
push esi
call ebp
mov edi, dword [esp + 0x24]
push edi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x6c
ret 8