Function at 0x402290
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 eax
mov dword [esp + 0x18], edi
mov dword [esp + 0x20], edi
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
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 0x4023ab
mov ebx, 1
mov eax, 1
mov cl, bl
shl eax, cl
add eax, eax
add eax, eax
mov dword [esp + 0x14], eax
mov edx, dword [esp + 0x80]
lea ecx, [esp + 0x38]
push ecx
push 0x18
push edx
call dword [sym.imp.GDI32.dll_GetObjectA]
mov ecx, dword [esp + 0x3c]
mov esi, dword [esp + 0x40]
movzx eax, bx
imul eax, ecx
add eax, 0x1f
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 word [esp + 0x64], 1
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 0x4023d3
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 0x4023d7
cmp esi, 4
jg 0x4023ba
mov ebx, 4
jmp 0x4022d4
cmp esi, 8
jg 0x4023c9
mov ebx, 8
jmp 0x4022d4
mov ebx, 0x18
jmp 0x4022e5
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 0x40241b
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_CreateFileA]
mov esi, eax
xor eax, eax
cmp esi, 0xffffffff
je 0x4024a8
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
push eax
mov word [esp + 0x32], ax
mov word [esp + 0x34], ax
lea eax, [esp + 0x24]
push eax
push 0xe
lea ecx, [esp + 0x34]
lea ebx, [ebx + edi + 0x36]
push ecx
add edi, 0x36
push esi
mov word [esp + 0x3c], 0x4d42
mov dword [esp + 0x3e], ebx
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]
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x6c
ret 8