Function at 0x407027
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
call dword [sym.imp.GDI32.dll_GdiFlush]
lea eax, [ebp - 0x3c]
push eax
push 0x18
push dword [ebp + 0x10]
call dword [sym.imp.GDI32.dll_GetObjectA]
test eax, eax
jne 0x407063
push str.Error_calling_GetObject__
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x30
push dword [ebp + 8]
call fcn.0040b551
add esp, 0x10
xor al, al
leave
ret
movzx eax, word [ebp - 0x2a]
movzx ecx, word [ebp - 0x2c]
imul eax, ecx
xor edx, edx
inc edx
push ebx
push edi
cmp eax, edx
jne 0x407084
mov edi, edx
mov ebx, edx
mov ecx, edi
shl ebx, cl
mov dword [ebp - 0xc], ebx
jmp 0x4070af
push 4
pop edi
cmp eax, edi
jbe 0x407079
cmp eax, 8
ja 0x407095
push 8
pop edi
jmp 0x407079
push 0x10
pop edi
cmp eax, edi
jbe 0x4070a8
push 0x18
pop ecx
cmp ecx, eax
sbb edi, edi
and edi, 8
add edi, ecx
and dword [ebp - 0xc], 0
mov ebx, dword [ebp - 0xc]
push esi
lea eax, [ebx*4 + 0x28]
push eax
push edx
call fcn.00454927
mov esi, eax
mov dword [esi], 0x28
mov eax, dword [ebp - 0x38]
mov dword [esi + 4], eax
mov eax, dword [ebp - 0x34]
mov dword [esi + 8], eax
xor eax, eax
inc eax
mov word [esi + 0xc], ax
mov eax, dword [ebp - 0x2a]
imul eax, dword [ebp - 0x2c]
pop ecx
pop ecx
mov word [esi + 0xe], ax
mov dword [esi + 0x20], ebx
cmp edi, 4
je 0x4070fb
xor eax, eax
cmp edi, 8
sete al
mov dword [esi + 0x10], eax
jmp 0x407102
mov dword [esi + 0x10], 2
mov eax, dword [esi + 4]
imul eax, edi
add eax, 0x1f
mov ebx, dword [sym.imp.GDI32.dll_GetDIBits]
shr eax, 3
and eax, 0x1ffffffc
imul eax, dword [esi + 8]
xor edi, edi
push edi
push esi
mov dword [esi + 0x14], eax
movzx eax, word [esi + 8]
push edi
push eax
push edi
push dword [ebp + 0x10]
mov dword [esi + 0x24], edi
push dword [ebp + 0x14]
call ebx
test eax, eax
jne 0x407144
push str.Error_calling_GetDIBits_1_
jmp 0x40729c
push dword [esi + 0x14]
call fcn.0045485d
pop ecx
mov dword [ebp - 0x14], eax
cmp eax, edi
jne 0x40716b
push dword [esi + 0x14]
push str.Out_of_memory_allocating_bitmap___d_bytes_
push 0x30
push dword [ebp + 8]
call fcn.0040b503
jmp 0x4072ad
push edi
push esi
push eax
movzx eax, word [esi + 8]
push eax
push edi
push dword [ebp + 0x10]
push dword [ebp + 0x14]
call ebx
test eax, eax
jne 0x40718a
push str.Error_calling_GetDIBits_2_
jmp 0x40729c
push edi
push 0x80
push 2
push edi
push edi
mov ebx, 0x40000000
push ebx
push dword [ebp + 0xc]
mov dword [ebp - 8], edi
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileA]
call edi
mov dword [ebp - 4], eax
cmp eax, 0xffffffff
jne 0x407216
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x20
jne 0x4071e9
cmp dword [ebp - 8], 8
jae 0x4071e9
push 0xfa
call dword [sym.imp.KERNEL32.dll_Sleep]
inc dword [ebp - 8]
xor eax, eax
push eax
push 0x80
push 2
push eax
push eax
push ebx
push dword [ebp + 0xc]
call edi
mov dword [ebp - 4], eax
cmp eax, 0xffffffff
je 0x4071b0
cmp dword [ebp - 4], 0xffffffff
jne 0x407216
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0040b381
push eax
push dword [ebp + 0xc]
push str.Error_creating_the_output_bitmap_file_n___s:_n_s_n_nPlease_ensure_the_path_exists_and_you_have_permission_to_write_it._n_nYou_can_select_a_different_output_path_for_the_bitmap_using_the_BitmapLocation_menu_item.
push 0x30
push dword [ebp + 8]
call fcn.0040b503
add esp, 0x18
jmp 0x4072b0
mov ecx, dword [ebp - 0xc]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, 0x4d42
mov word [ebp - 0x24], ax
mov eax, dword [esi]
lea eax, [eax + ecx*4 + 0xe]
mov dword [ebp - 0x1a], eax
mov ecx, dword [esi + 0x14]
add ecx, eax
xor eax, eax
mov word [ebp - 0x1e], ax
mov word [ebp - 0x1c], ax
xor ebx, ebx
push ebx
lea eax, [ebp - 0x10]
push eax
push 0xe
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 4]
mov dword [ebp - 0x22], ecx
call edi
test eax, eax
je 0x407283
push ebx
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 0x1a]
add eax, 0xfffffff2
push eax
push esi
push dword [ebp - 4]
call edi
test eax, eax
je 0x407283
push ebx
lea eax, [ebp - 0x10]
push eax
push dword [esi + 0x14]
push dword [ebp - 0x14]
push dword [ebp - 4]
call edi
test eax, eax
jne 0x40728a
push str.Error_during_WriteFile__
jmp 0x40729c
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x4072b4
push str.Error_during_CloseHandle__
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x30
push dword [ebp + 8]
call fcn.0040b551
add esp, 0x10
xor al, al
jmp 0x4072bf
push dword [ebp - 0x14]
call fcn.00450445
pop ecx
mov al, 1
pop esi
pop edi
pop ebx
leave
ret