Function at 0x413860
Capabilities:
Check if file exists
Get file size
Read file on windows

Disassembly:
sub esp, 0x214
mov eax, dword [0x477b14]
mov dword [esp + 0x210], eax
lea eax, [esp + 8]
push 1
push eax
call fcn.00410220
add esp, 8
lea ecx, [esp + 8]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4138a8
push 0x47b848
lea edx, [esp + 0xc]
push str._spackage2.ini
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push ebx
push esi
push edi
xor ebx, ebx
push ebx
push ebx
push 3
push ebx
push 1
push SysReAllocString
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [0x47c99c], eax
add eax, 6
push eax
call fcn.00445884
mov edx, dword [0x47c99c]
add esp, 4
push ebx
lea ecx, [esp + 0x14]
push ecx
push edx
mov edi, eax
push edi
push esi
mov dword [esp + 0x24], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [0x47c99c]
push 0x20
push 0x477798
push esi
push edi
call fcn.0040e540
mov eax, esi
cdq
sub eax, edx
sar eax, 1
mov word [edi + eax*2], 0xd
mov word [edi + eax*2 + 2], 0xa
mov word [edi + eax*2 + 4], bx
lea eax, [esi + esi]
push 1
push eax
call fcn.004459ea
push 0x47c9a0
push 0x47b230
mov dword [0x47c998], eax
mov dword [0x47a25c], ebx
mov dword [0x47a260], ebx
call fcn.00420980
mov edx, dword [0x47c998]
push 1
push edx
lea eax, [esp + 0x34]
lea ecx, [edi + 2]
push eax
mov dword [esp + 0x38], ecx
call fcn.00422340
add esp, 0x2c
test al, al
je 0x413ab3
mov edi, edi
mov esi, dword [0x47c998]
cmp word [esi], 0x3b
je 0x413a95
push 8
push str.VERSION
push esi
call fcn.00445e8a
add esp, 0xc
test eax, eax
jne 0x4139cf
add esi, 0x10
push esi
call fcn.004458f5
add esp, 4
cmp eax, 0xcd
mov dword [0x47c990], eax
jne 0x413a95
mov dword [0x47c990], 0xcc
jmp 0x413a95
mov ecx, dword [0x47c998]
push 0xd
push str.PREVWORKAREA
push ecx
call fcn.00445e8a
add esp, 0xc
test eax, eax
jne 0x413a0e
push 0x47a268
push 0x47a264
push 0x47a260
push 0x47a25c
add esi, 0x1a
push esi
call fcn.00410600
add esp, 0x14
jmp 0x413a95
mov edx, dword [0x47c998]
push 6
push str.OBJECT
push edx
call fcn.00446140
add esp, 0xc
test eax, eax
jne 0x413a41
mov eax, dword [0x47c998]
push 1
push 1
push eax
lea ecx, [esp + 0x18]
push ecx
call fcn.00410b80
add esp, 0x10
jmp 0x413a95
mov edx, dword [0x47c998]
push 0xc
push str.LASTSCREENW
push edx
call fcn.00445e8a
add esp, 0xc
test eax, eax
jne 0x413a6b
add esi, 0x18
push esi
call fcn.004458f5
mov dword [0x47a264], eax
jmp 0x413a92
mov eax, dword [0x47c998]
push 0xc
push str.LASTSCREENH
push eax
call fcn.00445e8a
add esp, 0xc
test eax, eax
jne 0x413a95
add esi, 0x18
push esi
call fcn.004458f5
mov dword [0x47a268], eax
add esp, 4
mov ecx, dword [0x47c998]
push 1
push ecx
lea edx, [esp + 0x14]
push edx
call fcn.00422340
add esp, 0xc
test al, al
jne 0x413980
push edi
call fcn.00445979
mov eax, dword [0x47c998]
push eax
call fcn.00445979
mov eax, dword [0x47c9a0]
add esp, 8
pop edi
pop esi
mov dword [0x47c998], ebx
cmp eax, ebx
pop ebx
je 0x413ae2
push eax
call fcn.00445979
add esp, 4
mov ecx, dword [esp + 0x210]
call fcn.00444c27
add esp, 0x214
ret