Function at 0x40ea72
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c
mov dword [ebp - 0x20], 1
mov dword [ebp - 0x14], 0x80000000
mov dword [ebp - 0x48], 3
mov dword [ebp - 0x10], pe_nt_image_headers32
push 0
push dword [ebp - 0x10]
push dword [ebp - 0x48]
push 0
push dword [ebp - 0x20]
push dword [ebp - 0x14]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x44], eax
cmp dword [ebp - 0x44], 0xffffffff
jne 0x40eabe
push 0xfffffffffffffffe
pop eax
jmp 0x40ed0e
lea eax, [ebp - 0x40]
push eax
push dword [ebp - 0x44]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
add eax, 0xa
push eax
push 0x42
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jne 0x40eaf7
push dword [ebp - 0x44]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
jmp 0x40ed0e
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov dword [ebp - 0x18], eax
push 0
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0xc]
push dword [ebp - 0x18]
push dword [ebp - 0x44]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40eb24
or eax, 0xffffffff
jmp 0x40ed0e
push dword [ebp - 0x44]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x18]
movsx eax, byte [eax]
cmp eax, 0x42
jne 0x40eb4a
mov eax, dword [ebp - 0x18]
movsx eax, byte [eax + 1]
cmp eax, 0x4d
je 0x40eb64
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push 0xfffffffffffffff8
pop eax
jmp 0x40ed0e
mov eax, dword [ebp - 0xc]
sub eax, 0xe
mov dword [ebp - 0xc], eax
and dword [ebp - 0x28], 0
jmp 0x40eb7a
mov eax, dword [ebp - 0x28]
inc eax
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0xc]
jae 0x40eb95
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x18]
add ecx, dword [ebp - 0x28]
mov cl, byte [ecx + 0xe]
mov byte [eax], cl
jmp 0x40eb73
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x38]
cmp dword [eax + 0x10], 0
je 0x40ebbe
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push 0xfffffffffffffff0
pop eax
jmp 0x40ed0e
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x38]
mov ecx, dword [ecx + 4]
mov dword [eax + 8], ecx
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x38]
mov ecx, dword [ecx + 8]
mov dword [eax + 0xc], ecx
mov eax, dword [ebp + 0xc]
and dword [eax + 4], 0
mov eax, dword [ebp - 0x38]
movzx eax, word [eax + 0xe]
mov dword [ebp - 0x4c], eax
cmp dword [ebp - 0x4c], 1
je 0x40ec01
cmp dword [ebp - 0x4c], 4
je 0x40ec0a
cmp dword [ebp - 0x4c], 8
je 0x40ec13
cmp dword [ebp - 0x4c], 0x18
je 0x40ec1c
jmp 0x40ec22
mov dword [ebp - 0x2c], 8
jmp 0x40ec3c
mov dword [ebp - 0x2c], 0x40
jmp 0x40ec3c
mov dword [ebp - 0x2c], 0x400
jmp 0x40ec3c
and dword [ebp - 0x2c], 0
jmp 0x40ec3c
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push 0xfffffffffffffff8
pop eax
jmp 0x40ed0e
mov eax, dword [ebp - 0x38]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
add eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x38]
add eax, dword [ecx]
mov dword [ebp - 8], eax
push 0
call dword [sym.imp.USER32.dll_GetDC]
mov dword [ebp - 0x34], eax
and dword [ebp - 4], 0
push 0xc
push dword [ebp - 0x34]
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
cmp eax, 8
jne 0x40ec76
mov dword [ebp - 4], 1
mov eax, dword [ebp - 0x38]
movzx eax, word [eax + 0xe]
cmp eax, 8
jne 0x40ecb4
cmp dword [ebp - 4], 0
je 0x40ecb4
push dword [ebp - 0x38]
call fcn.0040ed12
pop ecx
mov ecx, dword [ebp + 0xc]
mov dword [ecx + 4], eax
push 0
mov eax, dword [ebp + 0xc]
push dword [eax + 4]
push dword [ebp - 0x34]
call dword [sym.imp.GDI32.dll_SelectPalette]
mov dword [ebp - 0x24], eax
push dword [ebp - 0x34]
call dword [sym.imp.GDI32.dll_RealizePalette]
push 0
push dword [ebp - 0x38]
push dword [ebp - 8]
push 4
push dword [ebp - 0x38]
push dword [ebp - 0x34]
call dword [sym.imp.GDI32.dll_CreateDIBitmap]
mov ecx, dword [ebp + 0xc]
mov dword [ecx], eax
mov eax, dword [ebp - 0x38]
movzx eax, word [eax + 0xe]
cmp eax, 8
jne 0x40ecef
cmp dword [ebp - 4], 0
je 0x40ecef
push 0
push dword [ebp - 0x24]
push dword [ebp - 0x34]
call dword [sym.imp.GDI32.dll_SelectPalette]
push dword [ebp - 0x34]
push 0
call dword [sym.imp.USER32.dll_ReleaseDC]
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
leave
ret 8