Function at 0x505640
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xdc
mov eax, dword [0x5ed284]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0x18]
push esi
mov esi, dword [ebp + 0xc]
push edi
push 0xdb1
push 0x5a2f88
mov dword [ebp - 0xdc], eax
mov eax, dword [ebp + 0x14]
push 1
push 0x100000
mov dword [ebp - 0xd8], eax
call sym.FLAMESLauncher.exe_FUtilityMemAllocateWithTag
add esp, 0x10
mov edi, eax
test ebx, ebx
jne 0x5056de
lea eax, [ebp - 0xd4]
push eax
push dword [ebp - 0xd8]
call sym.FLAMESLauncher.exe_FDBRead
add esp, 8
test eax, eax
jne 0x5056d8
push str.Error:_There_was_an_error_reading_from_the_export_file._n
push eax
push eax
call sym.FLAMESLauncher.exe_FMHAnnounceError
push 0xdbe
push 0x5a2f88
push edi
call sym.FLAMESLauncher.exe_FUtilityMemFreeWithTag
add esp, 0x18
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0052bfb9
mov esp, ebp
pop ebp
ret
lea ebx, [ebp - 0xd4]
cmp dword [ebx + 0xc8], 2
je 0x5056fc
push str.Error:_There_was_an_error_reading_from_the_export_file._n
push 0
push 0
call sym.FLAMESLauncher.exe_FMHAnnounceError
push 0xdcb
jmp 0x5056b7
cmp dword [ebp + 0x10], 0
mov eax, dword [ebx + 0xcc]
mov dword [ebp - 0xd8], eax
je 0x505715
xor ebx, ebx
jmp 0x5057b0
push esi
call sym.FLAMESLauncher.exe_FOSUtilityFileExists
add esp, 4
test eax, eax
je 0x505762
push esi
call sym.FLAMESLauncher.exe_FOSUtilityMakeFileWritable
add esp, 4
test eax, eax
jne 0x505762
push esi
push str.Error:_The_file___s__could_not_be_made_writable._n
push eax
push eax
call sym.FLAMESLauncher.exe_FMHPrintError
push 0xde3
push 0x5a2f88
push edi
call sym.FLAMESLauncher.exe_FUtilityMemFreeWithTag
add esp, 0x1c
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0052bfb9
mov esp, ebp
pop ebp
ret
push 0x5c0dbc
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x5057aa
push esi
push str.Error:_The_file___s__could_not_be_opened_for_writing._n
push eax
push eax
call sym.FLAMESLauncher.exe_FMHPrintError
push 0xdf2
push 0x5a2f88
push edi
call sym.FLAMESLauncher.exe_FUtilityMemFreeWithTag
add esp, 0x1c
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0052bfb9
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0xd8]
push dword [ebp - 0xdc]
mov edx, 0x100000
mov esi, eax
cmp eax, edx
cmovg esi, edx
push esi
push 1
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x10
cmp eax, esi
jne 0x50584c
test ebx, ebx
je 0x5057e9
push ebx
push esi
push 1
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
cmp eax, esi
jne 0x505834
mov eax, dword [ebp - 0xd8]
sub eax, esi
mov dword [ebp - 0xd8], eax
jne 0x5057b0
xor esi, esi
test ebx, ebx
je 0x505809
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
push 0xe2c
push 0x5a2f88
push edi
call sym.FLAMESLauncher.exe_FUtilityMemFreeWithTag
mov ecx, dword [ebp - 4]
add esp, 0xc
xor eax, eax
test esi, esi
sete al
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.0052bfb9
mov esp, ebp
pop ebp
ret
push str.Error:_Unable_to_write_to_the_temporary_input_file._n
push 0
push 0
call sym.FLAMESLauncher.exe_FMHAnnounceError
add esp, 0xc
mov esi, 1
jmp 0x5057ff
push str.Error:_Unable_to_read_from_the_export_file._n
push 0
push 0
call sym.FLAMESLauncher.exe_FMHAnnounceError
add esp, 0xc
mov esi, 1
jmp 0x5057fb