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

Disassembly:
push 0x4c4
mov eax, 0x531b7b
call fcn.004e4832
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 0x459539
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 [0x5e8600], 7
xor eax, eax
mov dword [0x5e85fc], ebx
mov word [0x5e85ec], ax
mov eax, 0x5e85ec
jmp 0x4597b4
push 1
push 0x1c
lea eax, [ebp - 0x424]
push eax
push ebx
call esi
test eax, eax
jne 0x45955e
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push str.GetBasePsiphonDataDir
push str._s___SHGetFolderPath__local__failed___d_
jmp 0x45950d
mov esi, 0x5aa120
lea ecx, [ebp - 0x484]
push esi
call fcn.00446a26
lea eax, [ebp - 0x21c]
mov dword [ebp - 4], ebx
push eax
lea ecx, [ebp - 0x4b4]
call fcn.00446a26
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.00446a26
lea eax, [ebp - 0x424]
mov byte [ebp - 4], 5
push eax
lea ecx, [ebp - 0x4cc]
call fcn.00446a26
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 0x459661
test al, 0x10
je 0x459661
push 0xffffffffffffffff
jmp 0x4596db
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 0x4596da
test al, 0x10
je 0x4596da
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 0x4596da
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 0x4596e1
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 0x459775
call esi
cmp eax, 0xb7
je 0x459775
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 [0x5e8600], 7
xor eax, eax
mov dword [0x5e85fc], ebx
lea ecx, [ebp - 0x43c]
mov word [0x5e85ec], 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 0x45952f
lea eax, [ebp - 0x43c]
mov esi, 0x5e85ec
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.004e47dc
ret