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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1278
call fcn.0052c8c0
mov eax, dword [0x5ed284]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [0x5f6228], 0
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 8]
push edi
mov dword [ebp - 0x125c], esi
mov dword [ebp - 0x1278], ebx
mov dword [ebp - 0x1268], eax
mov dword [ebp - 0x1270], 1
mov dword [ebp - 0x126c], 1
mov dword [ebp - 0x1264], 0
je 0x5040d1
mov eax, dword [0xa1c670]
cmp dword [eax + 0x13c], 0
je 0x5040d1
push 0
call sym.FLAMESLauncher.exe_FFileManagerReadUserMapFile
add esp, 4
push ebx
test eax, eax
jne 0x503cf3
push str.FFileManager_Error:_Failed_to_add_group_to_user__s.
push eax
push eax
call sym.FLAMESLauncher.exe_FMHPrintError
add esp, 0x10
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
call sym.FLAMESLauncher.exe_FFileManagerGetUserByName
add esp, 4
mov dword [ebp - 0x1274], eax
test eax, eax
jne 0x503d28
push ebx
push str.FFileManager_Error:_Failed_to_add_dataset_to_user__s._User_not_found.
push eax
push eax
call sym.FLAMESLauncher.exe_FMHPrintError
add esp, 0x10
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 2
push ebx
call sym.FLAMESLauncher.exe_FFileManagerIsUserLocked
add esp, 8
test eax, eax
je 0x503dc0
mov dword [ebp - 0x126c], 0
mov ecx, 0x21
lea edi, [ebp - 0x1258]
rep movsd dword es:[edi], dword [esi]
mov esi, dword [ebp - 0x125c]
push 0
push dword [esi + 0x80]
call sym.FLAMESLauncher.exe_FFileManagerGetDatasetStringType
mov ecx, eax
lea edx, [ebp - 0x11d4]
add esp, 8
sub edx, ecx
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx + ecx - 1], al
test al, al
jne 0x503d72
call sym.FLAMESLauncher.exe_FFileManagerCreateGrantArray
mov edi, dword [ebp - 0x1274]
push esi
push edi
mov dword [ebp - 0x1114], eax
call sym.FLAMESLauncher.exe_FFileManagerGetDatasetByName
mov esi, eax
add esp, 8
mov dword [ebp - 0x1260], esi
test esi, esi
je 0x503df6
push 0x16c
push 0x5a1fe0
push dword [ebp - 0x1114]
call sym.FLAMESLauncher.exe_FRecordArrayDestroyWithTag
add esp, 0xc
jmp 0x503e1c
push 2
push ebx
call sym.FLAMESLauncher.exe_FFileManagerLockUser
add esp, 8
test eax, eax
jne 0x503d45
push ebx
push str.FFileManager_Error:_Failed_to_add_dataset_to_user__s.
push eax
push eax
call sym.FLAMESLauncher.exe_FMHPrintError
add esp, 0x10
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 eax, [ebp - 0x1194]
push eax
lea esi, [ebp - 0x1258]
push ebx
mov dword [ebp - 0x1260], esi
call fcn.00506990
add esp, 8
mov dword [ebp - 0x1264], 1
mov edx, esi
mov ecx, edi
sub edx, edi
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx + ecx + 0xe4], al
test al, al
jne 0x503e22
lea eax, [esi + 0x128]
push eax
call fcn.00505f50
lea ecx, [edi + 0xc2]
add esp, 4
lea edx, [ebp - 0x10c]
sub edx, ecx
nop
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx + ecx - 1], al
test al, al
jne 0x503e50
mov edx, 0x5a1ab8
mov esi, edx
mov al, byte [edx]
inc edx
test al, al
jne 0x503e64
lea edi, [ebp - 0x10c]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x503e74
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [ebp - 0x1260]
and ecx, 3
add edx, 0xc4
rep movsb byte es:[edi], byte [esi]
mov esi, edx
mov al, byte [edx]
inc edx
test al, al
jne 0x503e98
lea edi, [ebp - 0x10c]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x503ea8
mov ecx, edx
lea eax, [ebp - 0x10c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
cmp dword [ebp + 0x14], 0
rep movsb byte es:[edi], byte [esi]
je 0x503eea
push 1
push eax
mov eax, dword [0xa1c670]
push dword [ebp - 0x1268]
push dword [eax + 0x13c]
call sym.FLAMESLauncher.exe_FDatabaseConnectionCopyFile
add esp, 0x10
mov edi, eax
jmp 0x503f42
push 0x5c0dbc
push eax
mov eax, dword [0xa1c670]
push dword [eax + 0x13c]
call sym.FLAMESLauncher.exe_FDatabaseConnectionOpenFile
mov esi, eax
add esp, 0xc
test esi, esi
je 0x50407f
push 0x5c0db8
push dword [ebp - 0x1268]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
add esp, 8
mov dword [ebp - 0x125c], eax
test eax, eax
jne 0x503fbe
xor edi, edi
push 1
push esi
push dword [esi + 0x110]
call sym.FLAMESLauncher.exe_FDatabaseConnectionCloseFile
add esp, 0xc
test edi, edi
je 0x50407f
cmp dword [ebp - 0x1264], 0
je 0x503f77
mov eax, dword [ebp - 0x1274]
push 0x1f3
push 0x5a1fe0
push dword [ebp - 0x1260]
push dword [eax + 0x258]
call sym.FLAMESLauncher.exe_FRecordArrayAddRecordWithTag
add esp, 0x10
cmp dword [ebp - 0x126c], 0
je 0x504069
push ebx
call sym.FLAMESLauncher.exe_FFileManagerWriteDatasetMapFile
add esp, 4
push ebx
test eax, eax
jne 0x50405d
push str.FFileManager_Error:_Failed_to_add_dataset_to_user__s.
push eax
push eax
call sym.FLAMESLauncher.exe_FMHPrintError
push ebx
call sym.FLAMESLauncher.exe_FFileManagerUnlockUser
add esp, 0x14
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 eax
push 0x1000
lea eax, [ebp - 0x1110]
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov edi, eax
add esp, 0x10
test edi, edi
je 0x504029
mov ebx, 1
push dword [esi]
lea eax, [ebp - 0x1110]
push edi
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
push dword [ebp - 0x125c]
xor ecx, ecx
cmp eax, edi
push 0x1000
lea eax, [ebp - 0x1110]
cmovne ebx, ecx
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov edi, eax
add esp, 0x20
test edi, edi
jne 0x503fe1
mov dword [ebp - 0x1270], ebx
mov ebx, dword [ebp - 0x1278]
push dword [ebp - 0x125c]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov edi, dword [ebp - 0x1270]
add esp, 4
cmp edi, 1
jne 0x503f31
push 0
push esi
push dword [esi + 0x110]
call sym.FLAMESLauncher.exe_FDatabaseConnectionCloseFile
add esp, 0xc
jmp 0x503f4a
call sym.FLAMESLauncher.exe_FFileManagerUnlockUser
add esp, 4
test eax, eax
je 0x5040d1
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0052bfb9
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x1264], 0
je 0x5040a0
push 0x1da
push 0x5a1fe0
push dword [ebp - 0x1114]
call sym.FLAMESLauncher.exe_FRecordArrayDestroyWithTag
add esp, 0xc
lea eax, [ebp - 0x10c]
push eax
push dword [ebp - 0x1268]
push ebx
push str.FFileManager_Error:_Failed_to_add_dataset_to_user_s._Unable_to_copy_file__s_to_file__s
push 0
push 0
call sym.FLAMESLauncher.exe_FMHPrintError
add esp, 0x18
cmp dword [ebp - 0x126c], 0
je 0x5040d1
push ebx
call sym.FLAMESLauncher.exe_FFileManagerUnlockUser
add esp, 4
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0052bfb9
mov esp, ebp
pop ebp
ret