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

Disassembly:
sub esp, 0x3a4
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x3bc]
mov ebp, dword [esp + 0x3c8]
push str.Windows_Metafile
push ebp
mov eax, dword [edi]
mov dword [esp + 0x18], 0
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x3c8]
mov ecx, dword [eax]
mov dword [edi], 0
mov dword [esp + 0x38], ecx
mov dword [eax], 0
call fcn.004d631b
mov eax, dword [0x5b5574]
add esp, 8
lea edx, [esp + 0x2b4]
push 0x40
push edx
push 0x4e73
push eax
call dword [sym.imp.USER32.dll_LoadStringW]
mov edx, dword [esp + 0x3c4]
lea ecx, [esp + 0x2b4]
push str.Metafile
push ecx
push edx
call fcn.004d5ee1
mov ebx, dword [esp + 0x3c4]
add esp, 0xc
push ebx
call dword [sym.imp.GDI32.dll_GetEnhMetaFileW]
mov esi, eax
test esi, esi
je 0x40b41b
push str.__Enhanced_
push ebp
call fcn.004d62f1
push esi
call fcn.0040b930
push esi
mov dword [edi], eax
call fcn.0040b9a0
mov ecx, dword [esp + 0x3d0]
add esp, 0x10
mov dword [ecx], eax
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3a4
ret
push ebx
call fcn.0040bbd0
add esp, 4
test eax, eax
jne 0x40b44a
mov edx, dword [esp + 0x3c4]
push str.__save_bugs_
push edx
call fcn.004d62f1
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3a4
ret
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x40b4bd
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
mov dword [esp + 0x14], eax
je 0x40b4b6
cmp eax, 0x7fffd800
jae 0x40b4b6
add eax, 0x2800
push eax
call fcn.004d5aaa
mov esi, eax
add esp, 4
test esi, esi
jne 0x40b4ca
mov eax, dword [esp + 0x3c4]
mov ecx, dword [0x5b5574]
push 0x80
push eax
push 0x50a
push ecx
call dword [sym.imp.USER32.dll_LoadStringW]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x3a4
ret
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x14]
push 0
push edx
push eax
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esi], 0x9ac6cdd7
je 0x40b696
push esi
call fcn.004d59c1
push str.__Win_3.x_
push ebp
call fcn.004d62f1
add esp, 0xc
lea ecx, [esp + 0xa8]
push 0x104
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_GetShortPathNameW]
lea edx, [esp + 0xa8]
push edx
call dword [sym.imp.GDI32.dll_GetMetaFileW]
mov ebx, eax
xor ebp, ebp
cmp ebx, ebp
je 0x40b4bd
mov edi, dword [sym.imp.GDI32.dll_GetMetaFileBitsEx]
push ebp
push ebp
push ebx
call edi
cmp eax, ebp
mov dword [esp + 0x14], eax
jne 0x40b556
push ebx
call dword [sym.imp.GDI32.dll_DeleteMetaFile]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x3a4
ret
push eax
call fcn.004d5aaa
mov esi, eax
add esp, 4
cmp esi, ebp
jne 0x40b579
push ebx
call dword [sym.imp.GDI32.dll_DeleteMetaFile]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x3a4
ret
mov eax, dword [esp + 0x14]
push esi
push eax
push ebx
call edi
test eax, eax
jne 0x40b59a
push ebx
call dword [sym.imp.GDI32.dll_DeleteMetaFile]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x3a4
ret
mov dword [esp + 0x20], 8
mov di, word [esi + 0xe]
cmp di, bp
je 0x40b5df
movsx ecx, word [esi + 0xa]
movsx edx, word [esi + 6]
mov eax, ecx
and edi, 0xffff
shl eax, 7
sub eax, ecx
mov ecx, edx
shl ecx, 7
sub ecx, edx
lea eax, [eax + eax*4]
shl eax, 2
lea ecx, [ecx + ecx*4]
xor edx, edx
shl ecx, 2
sub eax, ecx
div edi
mov dword [esp + 0x24], eax
jmp 0x40b5e3
mov dword [esp + 0x24], ebp
mov di, word [esi + 0xe]
cmp di, bp
je 0x40b620
movsx ecx, word [esi + 0xc]
movsx edx, word [esi + 8]
mov eax, ecx
and edi, 0xffff
shl eax, 7
sub eax, ecx
mov ecx, edx
shl ecx, 7
sub ecx, edx
lea eax, [eax + eax*4]
shl eax, 2
lea edx, [ecx + ecx*4]
shl edx, 2
sub eax, edx
xor edx, edx
div edi
mov dword [esp + 0x28], eax
jmp 0x40b624
mov dword [esp + 0x28], ebp
mov eax, dword [esp + 0x38]
mov dword [esp + 0x2c], ebp
cmp eax, ebp
jbe 0x40b634
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x30]
cmp eax, ebp
jbe 0x40b640
mov dword [esp + 0x28], eax
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x20]
push eax
push ebp
push esi
push ecx
call dword [sym.imp.GDI32.dll_SetWinMetaFileBits]
push ebx
mov edi, eax
call dword [sym.imp.GDI32.dll_DeleteMetaFile]
push esi
call fcn.004d59c1
add esp, 4
cmp edi, ebp
je 0x40b689
push edi
call fcn.0040b930
mov edx, dword [esp + 0x3c0]
push edi
mov dword [edx], eax
call fcn.0040b9a0
mov ecx, dword [esp + 0x3c8]
add esp, 8
mov dword [ecx], eax
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3a4
ret
lea edx, [esp + 0xa8]
mov dword [esp + 0xa8], 0x114
push edx
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
mov ax, word [esi + 0xe]
xor ebx, ebx
cmp ax, bx
je 0x40b755
cmp dword [esp + 0xb8], 2
jne 0x40b755
and eax, 0xffff
mov dword [esp + 0x10], eax
fild dword [esp + 0x10]
movsx eax, word [esi + 0xa]
fstp dword [esp + 0x10]
fld dword [0x552708]
fdiv dword [esp + 0x10]
movsx ecx, word [esi + 6]
sub eax, ecx
mov dword [esp + 0x18], eax
fstp dword [esp + 0x10]
fild dword [esp + 0x18]
fstp dword [esp + 0x18]
fld dword [esp + 0x18]
fmul dword [esp + 0x10]
call fcn.004d6118
cdq
xor eax, edx
sub eax, edx
mov edx, dword [esp + 0x3bc]
mov dword [edx], eax
movsx eax, word [esi + 0xc]
movsx ecx, word [esi + 8]
sub eax, ecx
mov dword [esp + 0x18], eax
fild dword [esp + 0x18]
fstp dword [esp + 0x18]
fld dword [esp + 0x18]
fmul dword [esp + 0x10]
call fcn.004d6118
cdq
xor eax, edx
mov dword [esp + 0x10], 1
sub eax, edx
mov edx, dword [esp + 0x3c0]
mov dword [edx], eax
push str.__Aldus_
push ebp
call fcn.004d62f1
mov dword [esp + 0x28], 8
mov di, word [esi + 0xe]
add esp, 8
cmp di, bx
je 0x40b7a0
movsx eax, word [esi + 0xa]
movsx ecx, word [esi + 6]
sub eax, ecx
and edi, 0xffff
cdq
xor eax, edx
sub eax, edx
xor edx, edx
mov ecx, eax
shl ecx, 7
sub ecx, eax
lea eax, [ecx + ecx*4]
shl eax, 2
div edi
mov dword [esp + 0x24], eax
jmp 0x40b7a4
mov dword [esp + 0x24], ebx
mov di, word [esi + 0xe]
cmp di, bx
je 0x40b7d9
movsx eax, word [esi + 0xc]
movsx edx, word [esi + 8]
sub eax, edx
and edi, 0xffff
cdq
xor eax, edx
sub eax, edx
xor edx, edx
mov ecx, eax
shl ecx, 7
sub ecx, eax
lea eax, [ecx + ecx*4]
shl eax, 2
div edi
mov dword [esp + 0x28], eax
jmp 0x40b7dd
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
cmp word [esi + 0xe], 0x48
jae 0x40b7f0
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ebx
mov eax, dword [esp + 0x38]
cmp eax, ebx
jbe 0x40b7fc
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x30]
cmp eax, ebx
jbe 0x40b808
mov dword [esp + 0x28], eax
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x20]
lea ebp, [esi + 0x16]
push eax
push ebx
push ebp
push ecx
call dword [sym.imp.GDI32.dll_SetWinMetaFileBits]
mov ebx, eax
test ebx, ebx
je 0x40b8e5
lea edx, [esp + 0x3c]
mov ecx, 0x1b
xor eax, eax
lea edi, [esp + 0x3c]
push edx
push 0x6c
rep stosd dword es:[edi], eax
push ebx
mov dword [esp + 0x4c], 0x6c
call dword [sym.imp.GDI32.dll_GetEnhMetaFileHeader]
test eax, eax
je 0x40b8e5
mov eax, dword [esp + 0x4c]
mov ecx, dword [esp + 0x44]
mov edi, dword [esp + 0x54]
sub eax, ecx
mov ecx, dword [esp + 0x5c]
sub ecx, edi
cmp eax, 1
ja 0x40b870
mov eax, 1
xor edi, edi
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], edi
mov dword [esp + 0x30], eax
fild qword [esp + 0x18]
mov dword [esp + 0x34], edi
fstp dword [esp + 0x18]
fild qword [esp + 0x30]
fstp dword [esp + 0x30]
fld dword [esp + 0x18]
fdiv dword [esp + 0x30]
fstp dword [esp + 0x30]
fld dword [esp + 0x30]
fcomp dword [0x552704]
fnstsw ax
test ah, 5
jnp 0x40b8c2
fld dword [esp + 0x30]
fcomp dword [0x552700]
fnstsw ax
and eax, 0x4100
jne 0x40b8e5
push ebx
call dword [sym.imp.GDI32.dll_DeleteEnhMetaFile]
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x20]
push eax
push edi
push ebp
push ecx
mov dword [esp + 0x34], edi
mov dword [esp + 0x38], edi
call dword [sym.imp.GDI32.dll_SetWinMetaFileBits]
mov ebx, eax
push esi
call fcn.004d59c1
add esp, 4
test ebx, ebx
je 0x40b91b
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x40b91b
push ebx
call fcn.0040b930
mov edx, dword [esp + 0x3c0]
push ebx
mov dword [edx], eax
call fcn.0040b9a0
mov ecx, dword [esp + 0x3c8]
add esp, 8
mov dword [ecx], eax
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 0x3a4
ret