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

Disassembly:
sub esp, 0x18
push ebx
mov eax, dword [esp + 0x24]
push ebp
push esi
push edi
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0x10], edi
je 0x4057e2
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x405597
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
mov eax, 0x80004005
pop ebx
add esp, 0x18
ret
push ebp
push 2
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x20], ebx
jne 0x4055be
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
mov eax, 0x80004005
pop ebx
add esp, 0x18
ret
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov esi, eax
test esi, esi
je 0x4057d4
lea ecx, [esp + 0x24]
push 0
push ecx
push ebp
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov ax, word [esi]
cmp ax, 0x5045
jne 0x405686
push 0x18
push 4
push 4
push 4
push 4
push 4
push 4
push 4
push 2
push 0x2020
call fcn.004059e0
add esp, 0x28
test eax, eax
jne 0x4057d4
mov edx, dword [esi + 6]
lea ebp, [esi + 6]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edi, eax
mov eax, dword [esi + 2]
push 0
push ebp
push edi
lea ecx, [esi + 0xe]
push eax
push ecx
call fcn.00405a80
mov edx, dword [esi + 0xa]
mov eax, dword [edi + 8]
add esp, 0x14
add edx, edi
mov ecx, dword [esp + 0x2c]
push 0
push edi
push edx
push eax
push 0
push 0
push 0
push eax
mov eax, dword [edi + 4]
push eax
push 0
push 0
push ecx
call dword [sym.imp.GDI32.dll_SetDIBitsToDevice]
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalFree]
push edi
call esi
push ebx
call esi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x18
ret
cmp ax, 0x4d42
jne 0x4056d0
mov ecx, dword [esi + 0x1e]
lea eax, [esi + 0xe]
cmp ecx, 2
je 0x4057a8
cmp ecx, 1
je 0x4057a8
mov edx, dword [esi + 0xa]
mov ecx, dword [eax + 8]
push 0
add edx, esi
push eax
mov eax, dword [eax + 4]
push edx
push ecx
push 0
push 0
push 0
push ecx
mov ecx, dword [esp + 0x4c]
push eax
push 0
push 0
push ecx
call dword [sym.imp.GDI32.dll_SetDIBitsToDevice]
jmp 0x4057a8
lea edx, [esp + 0x14]
push edx
push 1
push ebx
call dword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x30]
push eax
push 0x40b2f0
push 1
push ebp
push ecx
call dword [sym.imp.OLEAUT32.dll_OleLoadPicture]
test eax, eax
jl 0x4057d4
mov eax, dword [esp + 0x30]
lea ecx, [esp + 0x18]
push ecx
push eax
mov edx, dword [eax]
call dword [edx + 0x18]
mov eax, dword [esp + 0x30]
lea ecx, [esp + 0x1c]
push ecx
push eax
mov edx, dword [eax]
call dword [edx + 0x1c]
mov edi, dword [esp + 0x2c]
mov ebx, dword [sym.imp.GDI32.dll_GetDeviceCaps]
push 0x58
push edi
call ebx
push 0x5a
push edi
mov esi, eax
call ebx
mov ebx, dword [esp + 0x18]
mov ecx, eax
imul esi, ebx
add esi, 0x4f6
mov eax, 0x6734d007
imul esi
mov esi, dword [esp + 0x1c]
push 0
imul ecx, esi
sar edx, 0xa
mov eax, edx
add ecx, 0x4f6
shr eax, 0x1f
add edx, eax
mov eax, 0x6734d007
mov ebp, edx
imul ecx
mov eax, dword [esp + 0x34]
sar edx, 0xa
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
mov ecx, dword [eax]
mov eax, esi
neg eax
push eax
push ebx
push esi
push 0
push edx
mov edx, dword [esp + 0x48]
push ebp
push 0
push 0
push edi
push edx
call dword [ecx + 0x20]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x30]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
mov ebx, dword [esp + 0x20]
mov edi, dword [esp + 0x10]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [esp + 0x2c]
xor eax, eax
test edi, edi
setl al
dec eax
pop edi
and eax, 0x7fffbffb
pop esi
pop ebp
add eax, 0x80004005
pop ebx
add esp, 0x18
ret
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
pop ebp
mov eax, 0x80004005
pop ebx
add esp, 0x18
ret