Function at 0x4595b9
Capabilities:
Check if file exists
Create directory
Get common file path
Get file attributes
Move file

Disassembly:
push 0x4c4
mov eax, 0x531d4d
call fcn.004e49d2
mov esi, dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea eax, [ebp - 0x21c]
xor ebx, ebx
push ebx
push 0x1a
push eax
push ebx
mov dword [ebp - 0x4d0], ebx
call esi
test eax, eax
jne 0x459624
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push str.GetBasePsiphonDataDir
push str._s___SHGetFolderPath__roaming__failed___d_
push ebx
push ebx
call fcn.0043a0a0
add esp, 0x14
mov dword [0x5e8600], 7
xor eax, eax
mov dword [0x5e85fc], ebx
mov word [0x5e85ec], ax
mov eax, 0x5e85ec
jmp 0x45989f
push 1
push 0x1c
lea eax, [ebp - 0x424]
push eax
push ebx
call esi
test eax, eax
jne 0x459649
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push str.GetBasePsiphonDataDir
push str._s___SHGetFolderPath__local__failed___d_
jmp 0x4595f8
mov esi, 0x5aa4d8
lea ecx, [ebp - 0x484]
push esi
call fcn.00446acb
lea eax, [ebp - 0x21c]
mov dword [ebp - 4], ebx
push eax
lea ecx, [ebp - 0x4b4]
call fcn.00446acb
lea ecx, [ebp - 0x484]
mov byte [ebp - 4], 1
push ecx
mov edx, eax
lea ecx, [ebp - 0x46c]
call fcn.0042adac
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x4b4]
call fcn.00427ba9
push ebx
push 1
lea ecx, [ebp - 0x484]
mov byte [ebp - 4], 4
call fcn.00427ba9
push esi
lea ecx, [ebp - 0x49c]
call fcn.00446acb
lea eax, [ebp - 0x424]
mov byte [ebp - 4], 5
push eax
lea ecx, [ebp - 0x4cc]
call fcn.00446acb
lea ecx, [ebp - 0x49c]
mov byte [ebp - 4], 6
push ecx
mov edx, eax
lea ecx, [ebp - 0x454]
call fcn.0042adac
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x4cc]
call fcn.00427ba9
push ebx
push 1
lea ecx, [ebp - 0x49c]
call fcn.00427ba9
xor eax, eax
mov dword [ebp - 0x428], 7
mov dword [ebp - 0x42c], ebx
mov word [ebp - 0x43c], ax
mov byte [ebp - 4], 0xa
lea eax, [ebp - 0x454]
cmp dword [ebp - 0x440], 8
mov edi, dword [sym.imp.KERNEL32.DLL_GetFileAttributesW]
cmovae eax, dword [ebp - 0x454]
push eax
call edi
mov esi, dword [sym.imp.KERNEL32.DLL_GetLastError]
cmp eax, 0xffffffff
je 0x45974c
test al, 0x10
je 0x45974c
push 0xffffffffffffffff
jmp 0x4597c6
cmp dword [ebp - 0x458], 8
lea eax, [ebp - 0x46c]
cmovae eax, dword [ebp - 0x46c]
push eax
call edi
or edi, 0xffffffff
cmp eax, edi
je 0x4597c5
test al, 0x10
je 0x4597c5
cmp dword [ebp - 0x440], 8
lea ecx, [ebp - 0x454]
push 0xb
cmovae ecx, dword [ebp - 0x454]
lea eax, [ebp - 0x46c]
cmp dword [ebp - 0x458], 8
push ecx
cmovae eax, dword [ebp - 0x46c]
push eax
call dword [sym.imp.KERNEL32.DLL_MoveFileExW]
test eax, eax
jne 0x4597c5
call esi
push eax
push str.GetBasePsiphonDataDir
push str._s:_MigratePsiphonDataDir_failed_to_move_roaming_to_local___d_
push 1
push ebx
call fcn.0043a0a0
add esp, 0x14
lea eax, [ebp - 0x46c]
push edi
jmp 0x4597cc
push edi
lea eax, [ebp - 0x454]
push ebx
push eax
lea ecx, [ebp - 0x43c]
call fcn.0042660a
cmp dword [ebp - 0x428], 8
lea eax, [ebp - 0x43c]
push ebx
cmovae eax, dword [ebp - 0x43c]
push eax
call dword [sym.imp.KERNEL32.DLL_CreateDirectoryW]
test eax, eax
jne 0x459860
call esi
cmp eax, 0xb7
je 0x459860
call esi
push eax
push str.GetBasePsiphonDataDir
push str._s___create_directory_failed___d_
push ebx
push ebx
call fcn.0043a0a0
add esp, 0x14
mov dword [0x5e8600], 7
xor eax, eax
mov dword [0x5e85fc], ebx
lea ecx, [ebp - 0x43c]
mov word [0x5e85ec], ax
push ebx
push 1
call fcn.00427ba9
push ebx
push 1
lea ecx, [ebp - 0x454]
call fcn.00427ba9
push ebx
push 1
lea ecx, [ebp - 0x46c]
call fcn.00427ba9
jmp 0x45961a
lea eax, [ebp - 0x43c]
mov esi, 0x5e85ec
push eax
mov ecx, esi
call fcn.004259ad
push ebx
push 1
lea ecx, [ebp - 0x43c]
call fcn.00427ba9
push ebx
push 1
lea ecx, [ebp - 0x454]
call fcn.00427ba9
push ebx
push 1
lea ecx, [ebp - 0x46c]
call fcn.00427ba9
mov eax, esi
call fcn.004e497c
ret