Function at 0x4083f0
Capabilities:
Access peb ldr_data
Check if file exists
Create directory
Get common file path
Get file attributes

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x40c651
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x468
mov eax, dword [0x413024]
push ebx
push esi
push edi
push 0x40d518
mov esi, ecx
push str.CVerSwitch::SyncClientConfig
mov dword [esp + 0x474], eax
mov eax, dword [esi + 4]
mov ecx, dword [eax]
push 0xd7
push eax
call dword [ecx + 0xc]
add esp, 0x10
lea ecx, [esp + 0x28]
call fcn.004038a0
mov edx, dword [esi + 0x30]
push 0xf003f
push edx
xor edi, edi
push 0x80000002
lea ecx, [esp + 0x34]
mov dword [esp + 0x488], edi
call fcn.00403dc0
test al, al
jne 0x40849b
cmp dword [esp + 0x38], 5
jne 0x4088a3
mov edx, dword [esp + 0x34]
mov eax, dword [esi + 4]
mov ecx, dword [eax]
push edx
push 0x8fe
push 0xd9
push eax
call dword [ecx + 0xc]
add esp, 0x10
mov byte [esi + 0x58], 1
jmp 0x40894f
mov eax, dword [esi + 0x34]
lea eax, [eax + eax + 2]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
cmp ebx, edi
jne 0x4084da
mov esi, dword [esi + 4]
mov eax, dword [esi]
push 1
push str.SyncClientConfig___NULL__lpszMSSQLServXX
push 0x90e
push 0xd5
push esi
call dword [eax + 0xc]
add esp, 0x14
jmp 0x40894f
mov eax, dword [esi + 4]
mov ecx, dword [eax]
push ebx
push str.SyncClientConfig___lpszMSSQLServXX
push 0xd7
push eax
call dword [ecx + 0xc]
mov word [esp + 0x68], di
xor eax, eax
mov ecx, 0x81
lea edi, [esp + 0x6a]
rep stosd dword es:[edi], eax
add esp, 0x10
lea edx, [esp + 0x260]
push edx
push 0x104
stosw word es:[edi], ax
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [esp + 0x260]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
or edi, 0xffffffff
cmp eax, edi
jne 0x40853d
push 0
lea ecx, [esp + 0x264]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea edx, [esp + 0x58]
push edx
push 0
push 0x40db0c
lea eax, [esp + 0x26c]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
jne 0x408574
push edi
call fcn.004024b0
add esp, 4
push str..ConnectTo.tmp
lea ecx, [esp + 0x5c]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov eax, dword [esi + 4]
mov edx, dword [eax]
lea ecx, [esp + 0x260]
push ecx
push str.SyncClientConfig___szTempPath
push 0xd7
push eax
call dword [edx + 0xc]
add esp, 0x10
lea ecx, [esp + 0x10]
call fcn.004038a0
mov eax, dword [esp + 0x30]
test eax, eax
mov byte [esp + 0x47c], 1
jne 0x4085af
mov eax, dword [esp + 0x2c]
push 0xf003f
push str.ClientConnectTo
push eax
lea ecx, [esp + 0x1c]
call fcn.00403dc0
test al, al
je 0x4086a1
lea edx, [esp + 0x58]
push edx
lea ecx, [esp + 0x14]
call fcn.00403f00
test al, al
jne 0x408648
mov eax, dword [esi + 4]
mov ecx, dword [eax]
lea edx, [esp + 0x58]
push edx
push str.szBakConnectToFile
push 0xd7
push eax
call dword [ecx + 0xc]
mov edx, dword [esp + 0x30]
mov eax, dword [esi + 4]
mov ecx, dword [eax]
push edx
push str.SyncClientConfig___BackupChildKey
push 0x93e
push 0xd5
push eax
call dword [ecx + 0xc]
mov eax, dword [esp + 0x44]
add esp, 0x24
cmp eax, 5
jne 0x40863d
mov edx, dword [esp + 0x1c]
mov eax, dword [esi + 4]
mov ecx, dword [eax]
push edx
push 0x944
push 0xd9
push eax
call dword [ecx + 0xc]
add esp, 0x10
mov byte [esi + 0x58], 1
lea ecx, [esp + 0x10]
call fcn.004038c0
jmp 0x4086c7
lea ecx, [esp + 0x10]
call fcn.004038c0
lea ecx, [esp + 0x40]
call fcn.004038a0
mov eax, dword [esi + 0x30]
push eax
push ebx
mov byte [esp + 0x484], 2
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
xor edi, edi
mov dword [esp + 0xc], edi
mov eax, edi
sub eax, 0
je 0x408715
dec eax
je 0x4086ff
dec eax
jne 0x40872f
mov ecx, dword [esi + 0x30]
push 0x40e6b8
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea edx, [ebx + eax*2 - 4]
push edx
jmp 0x408729
cmp dword [esp + 0x20], 5
jne 0x408651
mov edx, dword [esp + 0x1c]
mov eax, dword [esi + 4]
mov ecx, dword [eax]
push edx
push 0x95a
push 0xd9
push eax
call dword [ecx + 0xc]
add esp, 0x10
mov byte [esi + 0x58], 1
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
lea ecx, [esp + 0x10]
mov byte [esp + 0x47c], 0
call fcn.00403d80
lea ecx, [esp + 0x28]
mov dword [esp + 0x47c], edi
call fcn.00403d80
xor eax, eax
jmp 0x4088bc
mov eax, dword [esi + 0x30]
push 0x40e6b0
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea ecx, [ebx + eax*2 - 4]
push ecx
jmp 0x408729
mov edx, dword [esi + 0x30]
push 0x40e6a8
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea eax, [ebx + eax*2 - 4]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov eax, dword [esi + 4]
mov ecx, dword [eax]
push edi
push str.SyncClientConfig___switch_i_
push 0xd8
push eax
call dword [ecx + 0xc]
mov eax, dword [esi + 4]
mov edx, dword [eax]
push ebx
push str.SyncClientConfig___lpszMSSQLServXX
push 0xd7
push eax
call dword [edx + 0xc]
add esp, 0x20
push 0xf003f
push ebx
push 0x80000002
lea ecx, [esp + 0x4c]
call fcn.00403dc0
test al, al
je 0x408837
lea eax, [esp + 0x58]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x408828
mov eax, dword [esp + 0x48]
test eax, eax
jne 0x408796
mov eax, dword [esp + 0x44]
push 0xf003f
push str.ClientConnectTo
push eax
lea ecx, [esp + 0x1c]
call fcn.00403dc0
test al, al
je 0x4087c4
push 0
push 0
lea ecx, [esp + 0x18]
call fcn.004038f0
lea ecx, [esp + 0x10]
call fcn.004038c0
push 0
push str.ClientConnectTo
lea ecx, [esp + 0x48]
call fcn.00403e30
mov edi, eax
test edi, edi
je 0x408804
lea ecx, [esp + 0x58]
push ecx
mov ecx, edi
call fcn.00403f60
mov ecx, edi
call fcn.004038c0
mov edx, dword [edi]
push 1
mov ecx, edi
call dword [edx]
lea ecx, [esp + 0x40]
call fcn.004038c0
mov edi, dword [esp + 0xc]
jmp 0x408842
cmp dword [edi + 0x10], 5
jne 0x408828
mov edi, dword [edi + 0xc]
mov eax, dword [esi + 4]
mov ecx, dword [eax]
push edi
push 0x9a2
push 0xd9
push eax
call dword [ecx + 0xc]
add esp, 0x10
mov byte [esi + 0x58], 1
lea ecx, [esp + 0x40]
call fcn.004038c0
mov edi, dword [esp + 0xc]
jmp 0x408842
cmp dword [esp + 0x50], 5
je 0x4088dd
inc edi
cmp edi, 3
mov dword [esp + 0xc], edi
jl 0x408673
lea ecx, [esp + 0x28]
call fcn.004038c0
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov esi, dword [esi + 4]
mov eax, dword [esi]
push 1
push str.CVerSwitch::SyncClientConfig
push 0xd8
push esi
call dword [eax + 0xc]
add esp, 0x10
lea ecx, [esp + 0x40]
mov byte [esp + 0x47c], 1
call fcn.00403d80
lea ecx, [esp + 0x10]
mov byte [esp + 0x47c], 0
call fcn.00403d80
lea ecx, [esp + 0x28]
mov dword [esp + 0x47c], 0xffffffff
call fcn.00403d80
mov eax, 1
mov ecx, dword [esp + 0x474]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x46c]
call fcn.0040bc27
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x4c]
mov eax, dword [esi + 4]
mov edx, dword [eax]
push ecx
push 0x9ba
push 0xd9
push eax
call dword [edx + 0xc]
add esp, 0x10
lea ecx, [esp + 0x28]
mov byte [esi + 0x58], 1
call fcn.004038c0
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov esi, dword [esi + 4]
mov edx, dword [esi]
push 0
push str.CVerSwitch::SyncClientConfig
push 0xd8
push esi
call dword [edx + 0xc]
add esp, 0x10
lea ecx, [esp + 0x40]
mov byte [esp + 0x47c], 1
call fcn.00403d80
lea ecx, [esp + 0x10]
mov byte [esp + 0x47c], 0
call fcn.00403d80
lea ecx, [esp + 0x28]
mov dword [esp + 0x47c], 0xffffffff
call fcn.00403d80
xor eax, eax
jmp 0x4088bc