Function at 0x405d80
Capabilities:
Check if file exists
Get file attributes
Get file size
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x8c4
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x85c], 0xffffffff
mov dword [ebp - 0x40], 0
mov dword [ebp - 8], 0
mov dword [ebp - 0x14], 8
mov dword [ebp - 0x454], 0x100000
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x30], 0
push 0x400
push 0
lea eax, [ebp - 0x858]
push eax
call fcn.004078c0
add esp, 0xc
cmp dword [ebp + 8], 0
je 0x405e05
cmp dword [ebp + 0xc], 0
jne 0x405e0f
jmp 0x406502
push 0
push 0x80
push 3
push 0
push 0
push 0x80000000
mov ecx, dword [ebp + 8]
push ecx
call dword [0x417140]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x405e3e
jmp 0x406502
push 0
mov edx, dword [ebp - 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x20], eax
push 0
push 0
push 0
push 2
push 0
mov eax, dword [ebp - 0x1c]
push eax
call dword [0x417148]
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
jne 0x405e74
jmp 0x406502
mov dword [ebp - 0x48], 0
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x458], 0
push 0
push 1
call fcn.00407130
add esp, 8
test eax, eax
jne 0x4064ea
mov ecx, dword [ebp - 0x458]
cmp ecx, dword [ebp - 0x20]
jae 0x4064ea
mov eax, dword [ebp - 0x48]
xor edx, edx
div dword [ebp - 0x454]
add edx, dword [ebp - 0xc]
mov dword [ebp - 0xc], edx
mov eax, dword [ebp - 0x48]
xor edx, edx
div dword [ebp - 0x454]
imul eax, dword [ebp - 0x454]
mov dword [ebp - 0x48], eax
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x2c], edx
mov eax, dword [ebp - 0x2c]
add eax, dword [ebp - 0xc]
push eax
mov ecx, dword [ebp - 0x48]
push ecx
push 0
push 4
mov edx, dword [ebp - 0x38]
push edx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x405f07
jmp 0x406502
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x44], eax
mov ecx, dword [ebp - 0x44]
add ecx, dword [ebp - 0xc]
mov dword [ebp - 0x44], ecx
mov edx, dword [ebp - 0x44]
mov eax, dword [edx]
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x44]
add ecx, 4
mov dword [ebp - 0x44], ecx
mov edx, dword [ebp - 0x44]
mov eax, dword [edx]
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov dword [ebp - 0x24], 0
mov edx, dword [ebp - 0x2c]
add edx, dword [ebp - 0x18]
mov dword [ebp - 0x2c], edx
mov eax, dword [ebp - 0xc]
add eax, dword [ebp - 0x14]
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp - 0x18]
add ecx, dword [ebp - 0xc]
push ecx
mov edx, dword [ebp - 0x48]
push edx
push 0
push 4
mov eax, dword [ebp - 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x405f7e
jmp 0x406502
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x44], ecx
mov edx, dword [ebp - 0x44]
add edx, dword [ebp - 0xc]
mov dword [ebp - 0x44], edx
mov eax, dword [ebp - 0x18]
push eax
mov ecx, dword [ebp - 0x44]
push ecx
lea edx, [ebp - 0x450]
push edx
call fcn.00407940
add esp, 0xc
mov eax, dword [ebp - 0x18]
mov byte [ebp + eax - 0x450], 0
mov ecx, dword [ebp - 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov dword [ebp - 0x24], 0
lea edx, [ebp - 0x450]
push edx
mov eax, dword [ebp + 0xc]
push eax
push str._s_s
lea ecx, [ebp - 0x858]
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea edx, [ebp - 0x858]
push edx
call fcn.00406580
add esp, 4
cmp dword [ebp - 0x28], 0
jne 0x406141
lea eax, [ebp - 0x858]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x406141
lea ecx, [ebp - 0x858]
push ecx
push 0x406ff0
push 0
push 0x68
mov edx, dword [ebp + 0x10]
push edx
call dword [sym.imp.USER32.dll_DialogBoxParamA]
mov dword [ebp - 0x860], eax
cmp dword [ebp - 0x860], 2
je 0x406137
cmp dword [ebp - 0x860], 7
je 0x406067
cmp dword [ebp - 0x860], 0x3eb
je 0x40605b
jmp 0x406141
mov dword [ebp - 0x28], 1
jmp 0x406141
mov eax, dword [ebp - 0xc]
add eax, dword [ebp - 0x18]
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp - 0xc]
cmp ecx, dword [ebp - 0x454]
jbe 0x406093
mov edx, dword [ebp - 0xc]
sub edx, dword [ebp - 0x454]
mov dword [ebp - 0xc], edx
mov eax, dword [ebp - 0x48]
add eax, dword [ebp - 0x454]
mov dword [ebp - 0x48], eax
mov ecx, dword [ebp - 0x458]
add ecx, dword [ebp - 0x10]
mov dword [ebp - 0x458], ecx
mov edx, dword [ebp - 0x10]
sub edx, dword [ebp - 0x2c]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x48]
add eax, dword [ebp - 0x10]
mov dword [ebp - 0x48], eax
mov ecx, dword [ebp - 0x458]
mov dword [ebp - 0x868], ecx
mov dword [ebp - 0x864], 0
fild qword [ebp - 0x868]
mov edx, dword [ebp - 0x20]
mov dword [ebp - 0x870], edx
mov dword [ebp - 0x86c], 0
fild qword [ebp - 0x870]
fdivp st(1)
fmul qword [0x413b60]
fadd qword [0x413b58]
fnstcw word [ebp - 0x872]
movzx eax, word [ebp - 0x872]
or eax, 0xc00
mov dword [ebp - 0x878], eax
fldcw word [ebp - 0x878]
fistp qword [ebp - 0x880]
fldcw word [ebp - 0x872]
mov eax, dword [ebp - 0x880]
push eax
push 2
call fcn.00407150
add esp, 8
jmp 0x405e8c
jmp 0x406502
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
lea ecx, [ebp - 0x858]
push ecx
call dword [0x417140]
mov dword [ebp - 0x85c], eax
cmp dword [ebp - 0x85c], 0xffffffff
jne 0x406179
jmp 0x406502
mov edx, dword [ebp - 0x10]
sub edx, dword [ebp - 0x2c]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x10]
sub eax, 8
jne 0x4061eb
mov ecx, dword [ebp - 0x10]
sub ecx, 8
jmp 0x40619c
mov edx, dword [ebp - 0x18]
add edx, dword [ebp - 0x10]
add edx, dword [ebp - 0xc]
mov dword [ebp - 0xc], edx
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0x454]
jbe 0x4061cb
mov ecx, dword [ebp - 0xc]
sub ecx, dword [ebp - 0x454]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 0x48]
add edx, dword [ebp - 0x454]
mov dword [ebp - 0x48], edx
mov eax, dword [ebp - 0x2c]
add eax, dword [ebp - 0x10]
add eax, dword [ebp - 0x458]
mov dword [ebp - 0x458], eax
mov ecx, dword [ebp - 0x30]
add ecx, 1
mov dword [ebp - 0x30], ecx
jmp 0x405e8c
push 0
mov edx, dword [ebp - 0x10]
push edx
push 0
push 4
push 0
mov eax, dword [ebp - 0x85c]
push eax
call dword [0x417148]
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x40], 0
jne 0x406217
jmp 0x406502
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0xc]
add ecx, dword [ebp - 0x18]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 0xc]
cmp edx, dword [ebp - 0x454]
jbe 0x40624a
mov eax, dword [ebp - 0xc]
sub eax, dword [ebp - 0x454]
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp - 0x48]
add ecx, dword [ebp - 0x454]
mov dword [ebp - 0x48], ecx
push 0
push 1
call fcn.00407130
add esp, 8
test eax, eax
jne 0x4063cf
mov edx, dword [ebp - 4]
cmp edx, dword [ebp - 0x10]
jae 0x4063cf
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 4]
cmp eax, dword [ebp - 0x454]
jae 0x406286
mov ecx, dword [ebp - 0x10]
sub ecx, dword [ebp - 4]
mov dword [ebp - 0x884], ecx
jmp 0x406292
mov edx, dword [ebp - 0x454]
mov dword [ebp - 0x884], edx
mov eax, dword [ebp - 0x884]
mov dword [ebp - 0x4c], eax
mov ecx, dword [ebp - 0x4c]
add ecx, dword [ebp - 0xc]
push ecx
mov edx, dword [ebp - 0x48]
push edx
push 0
push 4
mov eax, dword [ebp - 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x4062c7
jmp 0x406502
mov ecx, dword [ebp - 0x4c]
push ecx
mov edx, dword [ebp - 4]
push edx
push 0
push 2
mov eax, dword [ebp - 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x4062f0
jmp 0x406502
mov ecx, dword [ebp - 0x4c]
push ecx
mov edx, dword [ebp - 0x24]
add edx, dword [ebp - 0xc]
push edx
mov eax, dword [ebp - 8]
push eax
call fcn.00407940
add esp, 0xc
mov ecx, dword [ebp - 0x4c]
push ecx
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.KERNEL32.dll_FlushViewOfFile]
mov eax, dword [ebp - 4]
add eax, dword [ebp - 0x4c]
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 0x48]
add ecx, dword [ebp - 0x4c]
mov dword [ebp - 0x48], ecx
mov edx, dword [ebp - 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov dword [ebp - 0x24], 0
mov eax, dword [ebp - 8]
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov dword [ebp - 8], 0
mov ecx, dword [ebp - 0x458]
add ecx, dword [ebp - 4]
mov dword [ebp - 0x88c], ecx
mov dword [ebp - 0x888], 0
fild qword [ebp - 0x88c]
mov edx, dword [ebp - 0x20]
mov dword [ebp - 0x894], edx
mov dword [ebp - 0x890], 0
fild qword [ebp - 0x894]
fdivp st(1)
fmul qword [0x413b60]
fadd qword [0x413b58]
fnstcw word [ebp - 0x896]
movzx eax, word [ebp - 0x896]
or eax, 0xc00
mov dword [ebp - 0x89c], eax
fldcw word [ebp - 0x89c]
fistp qword [ebp - 0x8a4]
fldcw word [ebp - 0x896]
mov eax, dword [ebp - 0x8a4]
push eax
push 2
call fcn.00407150
add esp, 8
jmp 0x40624a
cmp dword [ebp - 8], 0
je 0x4063e6
mov ecx, dword [ebp - 8]
push ecx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov dword [ebp - 8], 0
cmp dword [ebp - 0x40], 0
je 0x4063fd
mov edx, dword [ebp - 0x40]
push edx
call dword [0x417144]
mov dword [ebp - 0x40], 0
cmp dword [ebp - 0x85c], 0xffffffff
je 0x40641d
mov eax, dword [ebp - 0x85c]
push eax
call dword [0x417144]
mov dword [ebp - 0x85c], 0xffffffff
mov ecx, dword [ebp - 4]
cmp ecx, dword [ebp - 0x10]
je 0x40642f
jmp 0x406502
lea edx, [ebp - 0x858]
push edx
call fcn.00406640
add esp, 4
test eax, eax
jne 0x40644c
jmp 0x406502
mov eax, dword [ebp - 4]
add eax, dword [ebp - 0x2c]
add eax, dword [ebp - 0x458]
mov dword [ebp - 0x458], eax
mov ecx, dword [ebp - 0x30]
add ecx, 1
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp - 0x458]
mov dword [ebp - 0x8ac], edx
mov dword [ebp - 0x8a8], 0
fild qword [ebp - 0x8ac]
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x8b4], eax
mov dword [ebp - 0x8b0], 0
fild qword [ebp - 0x8b4]
fdivp st(1)
fmul qword [0x413b60]
fadd qword [0x413b58]
fnstcw word [ebp - 0x8b6]
movzx eax, word [ebp - 0x8b6]
or eax, 0xc00
mov dword [ebp - 0x8bc], eax
fldcw word [ebp - 0x8bc]
fistp qword [ebp - 0x8c4]
fldcw word [ebp - 0x8b6]
mov ecx, dword [ebp - 0x8c4]
push ecx
push 2
call fcn.00407150
add esp, 8
jmp 0x405e8c
mov edx, dword [ebp - 0x458]
cmp edx, dword [ebp - 0x20]
jne 0x406502
cmp dword [ebp - 0x30], 0
je 0x406502
mov dword [ebp - 0x34], 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 8], 0
je 0x40651b
mov eax, dword [ebp - 8]
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
cmp dword [ebp - 0x40], 0
je 0x40652b
mov ecx, dword [ebp - 0x40]
push ecx
call dword [0x417144]
cmp dword [ebp - 0x85c], 0xffffffff
je 0x406541
mov edx, dword [ebp - 0x85c]
push edx
call dword [0x417144]
cmp dword [ebp - 0x24], 0
je 0x406551
mov eax, dword [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
cmp dword [ebp - 0x38], 0
je 0x406561
mov ecx, dword [ebp - 0x38]
push ecx
call dword [0x417144]
cmp dword [ebp - 0x1c], 0xffffffff
je 0x406571
mov edx, dword [ebp - 0x1c]
push edx
call dword [0x417144]
mov eax, dword [ebp - 0x34]
mov esp, ebp
pop ebp
ret