Function at 0x18005c970
Capabilities:
Get common file path
Write file on windows

Disassembly:
mov rax, rsp
push rdi
sub rsp, 0x340
mov qword [rsp + 0x50], 0xfffffffffffffffe
mov qword [rax + 0x18], rbx
mov qword [rax + 0x20], rsi
mov rax, qword [0x1801563c0]
xor rax, rsp
mov qword [rsp + 0x330], rax
mov rbx, rdx
mov rdi, rcx
mov qword [rsp + 0x48], rdx
cmp qword [rcx + 8], 0
jne 0x18005c9e6
mov rcx, qword [rdx]
add rcx, 0xfffffffffffffff4
lea rax, [0x18015f758]
cmp rcx, rax
je 0x18005c9dc
or eax, 0xffffffff
lock xadd dword [rcx], eax
dec eax
test eax, eax
jg 0x18005c9dc
mov rcx, qword [rdx]
sub rcx, 0xc
call fcn.1800d1434
mov eax, 6
jmp 0x18005cbff
lea rcx, [rsp + 0x80]
call fcn.1800c3360
nop
mov r8, qword [rdi + 8]
lea rdx, [rsp + 0x58]
lea rcx, [rsp + 0x80]
call fcn.1800c33f4
nop
lea rdx, [rsp + 0x120]
mov ecx, 0x104
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
xor edi, edi
and qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
mov rcx, qword [rbx]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rsi, rax
cmp rax, 0xffffffffffffffff
jne 0x18005cb4b
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
jne 0x18005caab
cmp edi, 0xa
jge 0x18005caab
inc edi
mov ecx, 0xc8
call qword [sym.imp.KERNEL32.dll_Sleep]
and qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
mov rcx, qword [rbx]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rsi, rax
cmp rax, 0xffffffffffffffff
je 0x18005ca56
jmp 0x18005cb4b
mov rax, qword [rbx]
mov qword [rsp + 0x20], rax
lea r9, str.CChromeJSONHelper::SaveFile_:_cannot_save_prefs_file_::__s
mov r8d, 0x249
lea rdx, str..ChromeJSONHelper.cpp
lea rcx, [0x18015f578]
call fcn.18000b1e8
lea rcx, [0x180162178]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
nop
cmp qword [rsp + 0x78], 0x10
jb 0x18005caf3
mov rcx, qword [rsp + 0x60]
call fcn.1800d1290
mov qword [rsp + 0x78], reloc.WS2_32.dll_ntohs
and qword [rsp + 0x70], 0
mov byte [rsp + 0x60], 0
lea rcx, [rsp + 0x80]
call fcn.180059d0c
nop
mov rcx, qword [rbx]
add rcx, 0xfffffffffffffff4
lea rax, [0x18015f758]
cmp rcx, rax
je 0x18005cb41
or eax, 0xffffffff
lock xadd dword [rcx], eax
dec eax
test eax, eax
jg 0x18005cb41
mov rcx, qword [rbx]
sub rcx, 0xc
call fcn.1800d1434
mov eax, 0x80004005
jmp 0x18005cbff
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
lea rdx, [rsp + 0x60]
cmp qword [rsp + 0x78], 0x10
cmovae rdx, qword [rsp + 0x60]
and qword [rsp + 0x20], 0
lea r9, [rsp + 0x40]
mov r8d, dword [rsp + 0x70]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rcx, [0x180162178]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
nop
cmp qword [rsp + 0x78], 0x10
jb 0x18005cbaf
mov rcx, qword [rsp + 0x60]
call fcn.1800d1290
mov qword [rsp + 0x78], reloc.WS2_32.dll_ntohs
and qword [rsp + 0x70], 0
mov byte [rsp + 0x60], 0
lea rcx, [rsp + 0x80]
call fcn.180059d0c
nop
mov rcx, qword [rbx]
add rcx, 0xfffffffffffffff4
lea rax, [0x18015f758]
cmp rcx, rax
je 0x18005cbfd
or eax, 0xffffffff
lock xadd dword [rcx], eax
dec eax
test eax, eax
jg 0x18005cbfd
mov rcx, qword [rbx]
sub rcx, 0xc
call fcn.1800d1434
xor eax, eax
mov rcx, qword [rsp + 0x330]
xor rcx, rsp
call fcn.1800d12b0
lea r11, [rsp + 0x340]
mov rbx, qword [r11 + 0x20]
mov rsi, qword [r11 + 0x28]
mov rsp, r11
pop rdi
ret