Function at 0x401000
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], 0x80
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 0x40104c
push 0xfffffffffffffffe
pop eax
jmp 0x40129c
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 0x401085
push dword [ebp - 0x44]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
jmp 0x40129c
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 0x4010b2
or eax, 0xffffffff
jmp 0x40129c
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 0x4010d8
mov eax, dword [ebp - 0x18]
movsx eax, byte [eax + 1]
cmp eax, 0x4d
je 0x4010f2
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 0x40129c
mov eax, dword [ebp - 0xc]
sub eax, 0xe
mov dword [ebp - 0xc], eax
and dword [ebp - 0x28], 0
jmp 0x401108
mov eax, dword [ebp - 0x28]
inc eax
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 0xc]
jae 0x401123
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 0x401101
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x38]
cmp dword [eax + 0x10], 0
je 0x40114c
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 0x40129c
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 0x40118f
cmp dword [ebp - 0x4c], 4
je 0x401198
cmp dword [ebp - 0x4c], 8
je 0x4011a1
cmp dword [ebp - 0x4c], 0x18
je 0x4011aa
jmp 0x4011b0
mov dword [ebp - 0x2c], 8
jmp 0x4011ca
mov dword [ebp - 0x2c], 0x40
jmp 0x4011ca
mov dword [ebp - 0x2c], 0x400
jmp 0x4011ca
and dword [ebp - 0x2c], 0
jmp 0x4011ca
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 0x40129c
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 0x401204
mov dword [ebp - 4], 1
mov eax, dword [ebp - 0x38]
movzx eax, word [eax + 0xe]
cmp eax, 8
jne 0x401242
cmp dword [ebp - 4], 0
je 0x401242
push dword [ebp - 0x38]
call fcn.004012a0
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 0x40127d
cmp dword [ebp - 4], 0
je 0x40127d
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