Function at 0x40ea5e
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 0x40eaaa
push 0xfffffffffffffffe
pop eax
jmp 0x40ecfa
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 0x40eae3
push dword [ebp - 0x44]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
jmp 0x40ecfa
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 0x40eb10
or eax, 0xffffffff
jmp 0x40ecfa
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 0x40eb36
mov eax, dword [ebp - 0x18]
movsx eax, byte [eax + 1]
cmp eax, 0x4d
je 0x40eb50
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 0x40ecfa
mov eax, dword [ebp - 0xc]
sub eax, 0xe
mov dword [ebp - 0xc], eax
and dword [ebp - 0x28], 0
jmp 0x40eb66
mov eax, dword [ebp - 0x28]
inc eax
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0xc]
jae 0x40eb81
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 0x40eb5f
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x38]
cmp dword [eax + 0x10], 0
je 0x40ebaa
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 0x40ecfa
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 0x40ebed
cmp dword [ebp - 0x4c], 4
je 0x40ebf6
cmp dword [ebp - 0x4c], 8
je 0x40ebff
cmp dword [ebp - 0x4c], 0x18
je 0x40ec08
jmp 0x40ec0e
mov dword [ebp - 0x2c], 8
jmp 0x40ec28
mov dword [ebp - 0x2c], 0x40
jmp 0x40ec28
mov dword [ebp - 0x2c], 0x400
jmp 0x40ec28
and dword [ebp - 0x2c], 0
jmp 0x40ec28
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 0x40ecfa
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 0x40ec62
mov dword [ebp - 4], 1
mov eax, dword [ebp - 0x38]
movzx eax, word [eax + 0xe]
cmp eax, 8
jne 0x40eca0
cmp dword [ebp - 4], 0
je 0x40eca0
push dword [ebp - 0x38]
call fcn.0040ecfe
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 0x40ecdb
cmp dword [ebp - 4], 0
je 0x40ecdb
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