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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c
mov eax, dword [0x5e5620]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
xor edi, edi
mov dword [ebp - 0x34], eax
push edi
push 0x80
push 3
push edi
push 1
push SysReAllocStringLen
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, eax
cmp esi, 0xffffffff
je 0x40892c
push edi
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push eax
push 2
mov dword [ebp - 0x1c], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
mov dword [ebp - 0x2c], eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
push edi
lea ecx, [ebp - 0x4c]
push ecx
push dword [ebp - 0x1c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call ebx
mov esi, dword [ebp - 0x2c]
lea eax, [ebp - 0x28]
and dword [ebp - 0x28], edi
push eax
push edi
push esi
call dword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
test eax, eax
js 0x408914
and dword [ebp - 0x18], edi
lea eax, [ebp - 0x18]
push eax
push 0x5c0710
push edi
push dword [ebp - 0x1c]
push dword [ebp - 0x28]
call dword [sym.imp.OLEAUT32.dll_OleCreatePictureIndirect]
test eax, eax
js 0x408907
mov eax, dword [ebp - 0x18]
lea edx, [ebp - 0x40]
push edx
push eax
mov ecx, dword [eax]
call dword [ecx + 0x18]
mov eax, dword [ebp - 0x18]
lea edx, [ebp - 0x1c]
push edx
push eax
mov ecx, dword [eax]
call dword [ecx + 0x1c]
push edi
call dword [sym.imp.USER32.dll_GetDC]
mov ebx, eax
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x38], eax
lea eax, [ebp - 0x3c]
push eax
push ebx
mov dword [ebp - 0x30], ebx
call fcn.0040862f
pop ecx
pop ecx
push dword [ebp - 0x38]
push dword [ebp - 0x3c]
push ebx
call dword [sym.imp.GDI32.dll_CreateCompatibleBitmap]
mov esi, eax
push ebx
mov dword [ebp - 0x24], esi
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
mov ebx, dword [sym.imp.GDI32.dll_SelectObject]
push esi
push eax
mov dword [ebp - 0x44], eax
call ebx
mov ecx, dword [ebp - 0x1c]
mov edi, eax
mov edx, dword [ebp - 0x18]
xor eax, eax
push eax
neg ecx
push ecx
push dword [ebp - 0x40]
mov esi, dword [edx]
push dword [ebp - 0x1c]
push eax
push dword [ebp - 0x38]
push dword [ebp - 0x3c]
push eax
push eax
push dword [ebp - 0x44]
push edx
call dword [esi + 0x20]
push dword [ebp - 0x24]
push edi
call ebx
push dword [ebp - 0x44]
call dword [sym.imp.GDI32.dll_DeleteObject]
push dword [ebp - 0x30]
push 0
call dword [sym.imp.USER32.dll_ReleaseDC]
mov eax, dword [ebp - 0x18]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
and dword [ebp - 0x18], 0
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [ebp - 0x24]
mov esi, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x28]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
and dword [ebp - 0x28], 0
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
call dword [sym.imp.KERNEL32.dll_GetLastError]
test edi, edi
je 0x40892c
mov eax, edi
jmp 0x4089ed
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocStringLen
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
xor eax, eax
cmp esi, 0xffffffff
je 0x4089ed
lea edi, [ebp - 0x14]
stosd dword es:[edi], eax
push 0
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x20]
push eax
push 0xe
lea eax, [ebp - 0x14]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4089e8
cmp dword [ebp - 0x20], 0xe
jne 0x4089e8
mov eax, 0x4d42
cmp word [ebp - 0x14], ax
jne 0x4089e8
mov eax, dword [ebp - 0xa]
add eax, 0xfffffff2
push eax
mov dword [ebp - 0x24], eax
call fcn.00560bfe
pop ecx
push 0
mov edi, eax
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x24]
push edi
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4089e1
mov eax, dword [ebp - 0x24]
cmp eax, dword [ebp - 0x20]
jne 0x4089e1
cmp dword [edi], 0x28
jne 0x4089e1
push 0
call dword [sym.imp.USER32.dll_GetDC]
xor edx, edx
lea ecx, [ebp - 0x48]
push edx
push edx
push ecx
push edx
push edi
push eax
mov dword [ebp - 0x48], edx
call dword [sym.imp.GDI32.dll_CreateDIBSection]
mov dword [ebp - 0x30], eax
test eax, eax
jne 0x4089fc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
call fcn.00560aa1
pop ecx
push esi
call ebx
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0054d24a
leave
ret
mov eax, dword [edi + 0x14]
lea ecx, [ebp - 0x20]
push 0
push ecx
push eax
push dword [ebp - 0x48]
mov dword [ebp - 0x34], eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4089e1
mov eax, dword [ebp - 0x34]
cmp dword [ebp - 0x20], eax
jne 0x4089e1
push esi
call ebx
push edi
call fcn.00560aa1
mov eax, dword [ebp - 0x30]
pop ecx
jmp 0x4089ed