Function at 0x40ad10
Capabilities:
Get file size

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x472edb
push eax
mov dword fs:[0], esp
sub esp, 0x20
push ebx
push ebp
push esi
mov esi, dword [esp + 0x40]
push edi
mov ebp, ecx
push esi
call fcn.0040ace0
test eax, eax
je 0x40afc8
push 0
push 0x8000000
push 4
push 0
push 1
push 0xc0000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40afc8
test ebx, ebx
je 0x40afc8
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], 0
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
push 0
push esi
push 0
push 4
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
test eax, eax
mov dword [esp + 0x18], eax
je 0x40afc1
push esi
push 0
push 0
push 0xf001f
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov edi, eax
test edi, edi
mov dword [esp + 0x24], edi
je 0x40afaf
push esi
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
mov dword [esp + 0x14], eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ecx, esi
mov esi, edi
mov edx, ecx
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x14]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x14]
xor edi, edi
push edi
push ecx
call dword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
mov edx, dword [esp + 0x14]
push 0x10
mov dword [esp + 0x24], edx
call sub.gdiplus.dll_GdipAlloc
mov esi, eax
mov dword [esp + 0x28], esi
cmp esi, edi
mov dword [esp + 0x38], edi
je 0x40ae4a
mov dword [esi], 0x47b0b8
mov ecx, dword [esp + 0x20]
lea eax, [esp + 0x44]
push eax
mov byte [esp + 0x3c], 1
push ecx
mov dword [esi], 0x47b0b0
mov dword [esp + 0x4c], edi
call sub.gdiplus.dll_GdipCreateBitmapFromStream
mov edx, dword [esp + 0x44]
mov dword [esi + 8], eax
mov dword [esi + 4], edx
mov byte [esp + 0x38], 0
jmp 0x40ae4c
xor esi, esi
mov eax, dword [esp + 0x10]
mov dword [esp + 0x38], 0xffffffff
push eax
mov dword [ebp + 0x24], esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [esp + 0x14]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
mov edx, dword [esp + 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov eax, dword [esp + 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call esi
push ebx
call esi
cmp dword [ebp + 0x24], edi
je 0x40afc8
mov eax, dword [ebp + 0x14]
cmp eax, edi
je 0x40ae9e
push eax
call dword [sym.imp.GDI32.dll_DeleteDC]
push edi
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
mov esi, dword [ebp + 0x24]
mov dword [ebp + 0x14], eax
lea ecx, [esp + 0x44]
mov dword [esp + 0x44], edi
mov edx, dword [esi + 4]
push ecx
push edx
call sub.gdiplus.dll_GdipGetImageWidth
cmp eax, edi
je 0x40aec4
mov dword [esi + 8], eax
mov eax, dword [esp + 0x44]
mov esi, dword [ebp + 0x24]
mov dword [ebp + 0x1c], eax
lea ecx, [esp + 0x44]
mov edx, dword [esi + 4]
push ecx
push edx
mov dword [esp + 0x4c], edi
call sub.gdiplus.dll_GdipGetImageHeight
cmp eax, edi
je 0x40aee7
mov dword [esi + 8], eax
mov ecx, dword [ebp + 0x1c]
mov eax, dword [esp + 0x44]
cmp ecx, edi
mov dword [ebp + 0x20], eax
jle 0x40afc8
cmp eax, edi
jle 0x40afc8
mov eax, dword [ebp + 0x18]
cmp eax, edi
je 0x40af0f
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [ebp + 0x20]
mov ecx, dword [ebp + 0x1c]
mov edx, dword [esp + 0x40]
push eax
push ecx
push edx
mov dword [ebp + 0x18], edi
call dword [sym.imp.GDI32.dll_CreateCompatibleBitmap]
mov ebx, dword [sym.imp.GDI32.dll_SelectObject]
mov dword [ebp + 0x18], eax
push eax
mov eax, dword [ebp + 0x14]
push eax
call ebx
mov dword [esp + 0x40], eax
mov eax, dword [ebp + 0x14]
lea ecx, [esp + 0x44]
mov dword [esp + 0x44], edi
push ecx
push eax
call sub.gdiplus.dll_GdipCreateFromHDC
mov esi, dword [esp + 0x44]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x28], esi
mov eax, dword [ebp + 0x24]
mov ecx, dword [ebp + 0x20]
mov edx, dword [ebp + 0x1c]
cmp eax, edi
mov dword [esp + 0x38], 2
je 0x40af71
mov eax, dword [eax + 4]
jmp 0x40af73
xor eax, eax
push edi
push edi
push edi
push 2
push ecx
push edx
push edi
push edi
push ecx
push edx
push edi
push edi
push eax
push esi
call sub.gdiplus.dll_GdipDrawImageRectRectI
cmp eax, edi
je 0x40af8f
mov dword [esp + 0x2c], eax
mov edx, dword [esp + 0x40]
mov eax, dword [ebp + 0x14]
push edx
push eax
call ebx
push esi
mov dword [esp + 0x3c], 0xffffffff
call sub.gdiplus.dll_GdipDeleteGraphics
mov eax, 1
jmp 0x40afca
mov ecx, dword [esp + 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
call esi
push ebx
call esi
jmp 0x40afc8
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov ecx, dword [esp + 0x30]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x2c
ret 8