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

Disassembly:
push 0x4c4
mov eax, 0x531aca
call fcn.004e4785
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 0x45949c
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.0043a05d
add esp, 0x14
mov dword [0x5e7600], 7
xor eax, eax
mov dword [0x5e75fc], ebx
mov word [0x5e75ec], ax
mov eax, 0x5e75ec
jmp 0x459717
push 1
push 0x1c
lea eax, [ebp - 0x424]
push eax
push ebx
call esi
test eax, eax
jne 0x4594c1
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push str.GetBasePsiphonDataDir
push str._s___SHGetFolderPath__local__failed___d_
jmp 0x459470
mov esi, 0x5a8fd0
lea ecx, [ebp - 0x484]
push esi
call fcn.0044698c
lea eax, [ebp - 0x21c]
mov dword [ebp - 4], ebx
push eax
lea ecx, [ebp - 0x4b4]
call fcn.0044698c
lea ecx, [ebp - 0x484]
mov byte [ebp - 4], 1
push ecx
mov edx, eax
lea ecx, [ebp - 0x46c]
call fcn.0042ad8f
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x4b4]
call fcn.00427b8c
push ebx
push 1
lea ecx, [ebp - 0x484]
mov byte [ebp - 4], 4
call fcn.00427b8c
push esi
lea ecx, [ebp - 0x49c]
call fcn.0044698c
lea eax, [ebp - 0x424]
mov byte [ebp - 4], 5
push eax
lea ecx, [ebp - 0x4cc]
call fcn.0044698c
lea ecx, [ebp - 0x49c]
mov byte [ebp - 4], 6
push ecx
mov edx, eax
lea ecx, [ebp - 0x454]
call fcn.0042ad8f
pop ecx
push ebx
push 1
lea ecx, [ebp - 0x4cc]
call fcn.00427b8c
push ebx
push 1
lea ecx, [ebp - 0x49c]
call fcn.00427b8c
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 0x4595c4
test al, 0x10
je 0x4595c4
push 0xffffffffffffffff
jmp 0x45963e
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 0x45963d
test al, 0x10
je 0x45963d
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 0x45963d
call esi
push eax
push str.GetBasePsiphonDataDir
push str._s:_MigratePsiphonDataDir_failed_to_move_roaming_to_local___d_
push 1
push ebx
call fcn.0043a05d
add esp, 0x14
lea eax, [ebp - 0x46c]
push edi
jmp 0x459644
push edi
lea eax, [ebp - 0x454]
push ebx
push eax
lea ecx, [ebp - 0x43c]
call fcn.004265ed
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 0x4596d8
call esi
cmp eax, 0xb7
je 0x4596d8
call esi
push eax
push str.GetBasePsiphonDataDir
push str._s___create_directory_failed___d_
push ebx
push ebx
call fcn.0043a05d
add esp, 0x14
mov dword [0x5e7600], 7
xor eax, eax
mov dword [0x5e75fc], ebx
lea ecx, [ebp - 0x43c]
mov word [0x5e75ec], ax
push ebx
push 1
call fcn.00427b8c
push ebx
push 1
lea ecx, [ebp - 0x454]
call fcn.00427b8c
push ebx
push 1
lea ecx, [ebp - 0x46c]
call fcn.00427b8c
jmp 0x459492
lea eax, [ebp - 0x43c]
mov esi, 0x5e75ec
push eax
mov ecx, esi
call fcn.00425990
push ebx
push 1
lea ecx, [ebp - 0x43c]
call fcn.00427b8c
push ebx
push 1
lea ecx, [ebp - 0x454]
call fcn.00427b8c
push ebx
push 1
lea ecx, [ebp - 0x46c]
call fcn.00427b8c
mov eax, esi
call fcn.004e472f
ret