Function at 0x40643b
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x84
nop
mov eax, 0
mov dword [ebp - 0x10], eax
mov eax, 0
mov dword [ebp - 0x80], eax
mov eax, 0
push eax
mov eax, 0
push eax
mov eax, 0
push eax
mov eax, 0x4083a8
push eax
call sub.gdi32.dll_CreateDCA
mov dword [ebp - 4], eax
mov eax, 0xc
push eax
mov eax, dword [ebp - 4]
push eax
call sub.gdi32.dll_GetDeviceCaps
mov ecx, 0xe
push ecx
mov ecx, dword [ebp - 4]
push ecx
mov dword [ebp - 0x84], eax
call sub.gdi32.dll_GetDeviceCaps
mov ecx, dword [ebp - 0x84]
imul ecx, eax
mov dword [ebp - 8], ecx
mov eax, dword [ebp - 4]
push eax
call sub.gdi32.dll_DeleteDC
mov eax, dword [ebp - 8]
cmp eax, 1
jg 0x4064c8
mov eax, 1
mov word [ebp - 0xa], ax
jmp 0x406539
mov eax, dword [ebp - 8]
cmp eax, 4
jg 0x4064e2
mov eax, 4
mov word [ebp - 0xa], ax
jmp 0x406539
mov eax, dword [ebp - 8]
cmp eax, 8
jg 0x4064fc
mov eax, 8
mov word [ebp - 0xa], ax
jmp 0x406539
mov eax, dword [ebp - 8]
cmp eax, 0x10
jg 0x406516
mov eax, 0x10
mov word [ebp - 0xa], ax
jmp 0x406539
mov eax, dword [ebp - 8]
cmp eax, 0x18
jg 0x406530
mov eax, 0x18
mov word [ebp - 0xa], ax
jmp 0x406539
mov eax, 0x20
mov word [ebp - 0xa], ax
movzx eax, word [ebp - 0xa]
cmp eax, 8
jg 0x406557
mov eax, 1
movzx ecx, word [ebp - 0xa]
shl eax, cl
shl eax, 2
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x34]
push eax
mov eax, 0x18
push eax
mov eax, dword [ebp + 8]
push eax
call sub.gdi32.dll_GetObjectA
mov eax, 0x28
mov dword [ebp - 0x6c], eax
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x68], eax
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x64], eax
mov eax, 1
mov word [ebp - 0x60], ax
movzx eax, word [ebp - 0xa]
mov word [ebp - 0x5e], ax
mov eax, 0
mov dword [ebp - 0x5c], eax
mov eax, 0
mov dword [ebp - 0x58], eax
mov eax, 0
mov dword [ebp - 0x54], eax
mov eax, 0
mov dword [ebp - 0x50], eax
mov eax, 0
mov dword [ebp - 0x4c], eax
mov eax, 0
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0x30]
movzx ecx, word [ebp - 0xa]
imul eax, ecx
add eax, 0x1f
mov ecx, 0x20
cdq
idiv ecx
shl eax, 2
mov ecx, dword [ebp - 0x2c]
imul eax, ecx
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x10]
add eax, ecx
add eax, 0x28
push eax
mov eax, 0x42
push eax
call sub.kernel32.dll_GlobalAlloc
mov dword [ebp - 0x78], eax
mov eax, dword [ebp - 0x78]
push eax
call sub.kernel32.dll_GlobalLock
mov dword [ebp - 0x70], eax
mov eax, dword [ebp - 0x70]
mov ecx, 0x28
push ecx
lea ecx, [ebp - 0x6c]
push ecx
push eax
call sub.msvcrt.dll_memmove
add esp, 0xc
mov eax, 0xf
push eax
call sub.gdi32.dll_GetStockObject
mov dword [ebp - 0x7c], eax
mov eax, dword [ebp - 0x7c]
cmp eax, 0
je 0x406663
mov eax, 0
push eax
call sub.user32.dll_GetDC
mov dword [ebp - 4], eax
mov eax, 0
push eax
mov eax, dword [ebp - 0x7c]
push eax
mov eax, dword [ebp - 4]
push eax
call sub.gdi32.dll_SelectPalette
mov dword [ebp - 0x80], eax
mov eax, dword [ebp - 4]
push eax
call sub.gdi32.dll_RealizePalette
mov eax, dword [ebp - 0x70]
add eax, 0x28
mov ecx, dword [ebp - 0x10]
add eax, ecx
mov ecx, 0
push ecx
mov ecx, dword [ebp - 0x70]
push ecx
push eax
mov eax, dword [ebp - 0x2c]
push eax
mov eax, 0
push eax
mov eax, dword [ebp + 8]
push eax
mov eax, dword [ebp - 4]
push eax
call sub.gdi32.dll_GetDIBits
mov eax, dword [ebp - 0x80]
cmp eax, 0
je 0x4066c7
mov eax, 1
push eax
mov eax, dword [ebp - 0x80]
push eax
mov eax, dword [ebp - 4]
push eax
call sub.gdi32.dll_SelectPalette
mov eax, dword [ebp - 4]
push eax
call sub.gdi32.dll_RealizePalette
mov eax, dword [ebp - 4]
push eax
mov eax, 0
push eax
call sub.user32.dll_ReleaseDC
mov eax, 0
push eax
mov eax, 0x8000080
push eax
mov eax, 2
push eax
mov eax, 0
push eax
mov eax, 0
push eax
mov eax, 0x40000000
push eax
mov eax, dword [ebp + 0xc]
push eax
call sub.kernel32.dll_CreateFileA
mov dword [ebp - 0x74], eax
mov eax, dword [ebp - 0x74]
cmp eax, 0xffffffff
jne 0x40670d
mov eax, 0
jmp 0x406798
mov eax, 0x4d42
mov word [ebp - 0x42], ax
mov eax, dword [ebp - 0x10]
add eax, 0x36
mov ecx, dword [ebp - 0x14]
add eax, ecx
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x40], eax
mov eax, 0
mov word [ebp - 0x3c], ax
mov eax, 0
mov word [ebp - 0x3a], ax
mov eax, dword [ebp - 0x10]
add eax, 0x36
mov dword [ebp - 0x38], eax
mov eax, 0
push eax
lea eax, [ebp - 0x1c]
push eax
mov eax, 0xe
push eax
lea eax, [ebp - 0x42]
push eax
mov eax, dword [ebp - 0x74]
push eax
call sub.kernel32.dll_WriteFile
mov eax, 0
push eax
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x70]
push eax
mov eax, dword [ebp - 0x74]
push eax
call sub.kernel32.dll_WriteFile
mov eax, dword [ebp - 0x78]
push eax
call sub.kernel32.dll_GlobalUnlock
mov eax, dword [ebp - 0x78]
push eax
call sub.kernel32.dll_GlobalFree
mov eax, dword [ebp - 0x74]
push eax
call sub.kernel32.dll_CloseHandle
leave
ret