Function at 0x406520
Capabilities:
Check if file exists
Create directory
Get common file path
Read .ini file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43676d
mov eax, dword fs:[0]
push eax
sub esp, 0x4a8
mov eax, dword [0x45a6d0]
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 ebx, dword [ebp + 8]
push 0
push 0x1a
lea eax, [ebp - 0x218]
push eax
push 0
mov esi, ecx
mov dword [ebp - 0x4b0], ebx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
mov edi, 8
cmp dword [esi + 0x14], edi
jb 0x40657a
mov eax, dword [esi]
jmp 0x40657c
mov eax, esi
push eax
lea ecx, [ebp - 0x218]
push ecx
push str._s_s
mov edx, ecx
call fcn.00404770
add esp, 0xc
lea edx, [ebp - 0x218]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4065b2
push eax
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
cmp dword [esi + 0x30], edi
lea eax, [esi + 0x1c]
jb 0x4065bc
mov eax, dword [eax]
push eax
lea ecx, [ebp - 0x218]
push ecx
push str._s_s
mov edx, ecx
call fcn.00404770
push 0x2000
call fcn.0041a77e
push 0x1000
mov esi, eax
push 0
push esi
call fcn.00426cd0
add esp, 0x1c
lea edx, [ebp - 0x218]
push edx
push 0x1000
push esi
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
mov edi, esi
test eax, eax
je 0x4066b8
mov ebx, eax
xor eax, eax
mov word [ebp - 0x43c], ax
mov eax, edi
mov dword [ebp - 0x428], 7
mov dword [ebp - 0x42c], 0
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x406633
sub eax, edx
sar eax, 1
push eax
mov eax, edi
lea esi, [ebp - 0x43c]
call fcn.00409320
push 0xa
push str.DnsSetting
mov ecx, esi
push ecx
call fcn.00409170
cmp eax, 0xffffffff
je 0x406676
lea edx, [ebp - 0x218]
push edx
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
mov eax, edi
lea edx, [eax + 2]
jmp 0x406680
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x406680
sub eax, edx
sar eax, 1
cmp dword [ebp - 0x428], 8
lea edi, [edi + eax*2 + 2]
jb 0x4066ab
mov eax, dword [ebp - 0x43c]
push eax
call fcn.0041bfc5
add esp, 4
dec ebx
jne 0x406611
mov ebx, dword [ebp - 0x4b0]
mov esi, dword [ebx]
mov ecx, dword [ebx + 4]
sub ecx, esi
mov eax, 0x2e8ba2e9
imul ecx
sar edx, 4
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
mov dword [ebp - 0x4b0], 0
je 0x406bcd
mov dword [ebp - 0x4b4], 0
mov edi, 0x10
mov edx, dword [ebp - 0x4b4]
cmp dword [edx + esi + 0x14], 0
je 0x406b9c
mov eax, dword [ebp - 0x4b0]
push eax
push str.DnsSetting
push str._s__d
lea edx, [ebp - 0x420]
call fcn.00404770
mov eax, dword [ebx]
mov esi, dword [ebp - 0x4b4]
add eax, esi
add eax, 4
push eax
lea ecx, [ebp - 0x458]
push ecx
call sym.jsService.exe_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____cdecl_AyDecrypt::EncryptIni_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char____
add esp, 0x14
mov dword [ebp - 4], 0
cmp dword [eax + 0x14], edi
jb 0x406747
mov eax, dword [eax]
push eax
lea edx, [ebp - 0x43c]
push edx
call sym.jsService.exe_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____cdecl_KpBase::s2ws_char_const__
add esp, 8
cmp dword [eax + 0x14], 8
jb 0x40675f
mov eax, dword [eax]
lea ecx, [ebp - 0x218]
push ecx
push eax
push str.GUID
lea edx, [ebp - 0x420]
push edx
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
cmp dword [ebp - 0x428], 8
jb 0x406791
mov eax, dword [ebp - 0x43c]
push eax
call fcn.0041bfc5
add esp, 4
xor ecx, ecx
mov dword [ebp - 0x428], 7
mov dword [ebp - 0x42c], 0
mov word [ebp - 0x43c], cx
cmp dword [ebp - 0x444], edi
jb 0x4067c5
mov edx, dword [ebp - 0x458]
push edx
call fcn.0041bfc5
add esp, 4
mov eax, dword [ebx]
cmp dword [esi + eax], 0
mov eax, 0xf
mov byte [ebp - 0x43c], 0
mov dword [ebp - 0x428], eax
je 0x406914
mov edx, dword [0x43c250]
mov ecx, dword [str.ay_dns_true]
mov dword [ebp - 0x438], edx
mov dx, word [0x43c254]
mov word [ebp - 0x434], dx
mov dl, byte [0x43c256]
cmp eax, edi
mov dword [ebp - 0x43c], ecx
mov byte [ebp - 0x432], dl
mov dword [ebp - 0x42c], 0xb
mov eax, ecx
jae 0x40682b
lea eax, [ebp - 0x43c]
mov byte [eax + 0xb], 0
lea eax, [ebp - 0x43c]
push eax
lea ecx, [ebp - 0x458]
push ecx
mov dword [ebp - 4], 1
call sym.jsService.exe_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____cdecl_AyDecrypt::EncryptIni_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char____
add esp, 8
mov byte [ebp - 4], 2
cmp dword [eax + 0x14], edi
jb 0x406857
mov eax, dword [eax]
push eax
lea edx, [ebp - 0x474]
push edx
call sym.jsService.exe_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____cdecl_KpBase::s2ws_char_const__
mov esi, 8
add esp, 8
cmp dword [eax + 0x14], esi
jb 0x406873
mov eax, dword [eax]
lea ecx, [ebp - 0x218]
push ecx
push eax
push str.IsAuto
lea edx, [ebp - 0x420]
push edx
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
cmp dword [ebp - 0x460], esi
jb 0x4068a4
mov eax, dword [ebp - 0x474]
push eax
call fcn.0041bfc5
add esp, 4
xor esi, esi
xor ecx, ecx
mov dword [ebp - 0x460], 7
mov dword [ebp - 0x464], esi
mov word [ebp - 0x474], cx
cmp dword [ebp - 0x444], edi
jb 0x4068d6
mov edx, dword [ebp - 0x458]
push edx
call fcn.0041bfc5
add esp, 4
mov dword [ebp - 4], 0xffffffff
mov dword [ebp - 0x444], 0xf
mov dword [ebp - 0x448], esi
mov byte [ebp - 0x458], 0
cmp dword [ebp - 0x428], edi
jb 0x406b9c
mov eax, dword [ebp - 0x43c]
push eax
call fcn.0041bfc5
add esp, 4
jmp 0x406b9c
mov edx, dword [0x43c26c]
mov ecx, dword [str.ay_dns_false]
mov dword [ebp - 0x438], edx
mov edx, dword [0x43c270]
cmp eax, edi
mov dword [ebp - 0x43c], ecx
mov dword [ebp - 0x434], edx
mov dword [ebp - 0x42c], 0xc
mov eax, ecx
jae 0x40694e
lea eax, [ebp - 0x43c]
mov byte [eax + 0xc], 0
lea eax, [ebp - 0x43c]
push eax
lea ecx, [ebp - 0x474]
push ecx
mov dword [ebp - 4], 3
call sym.jsService.exe_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____cdecl_AyDecrypt::EncryptIni_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char____
add esp, 8
mov byte [ebp - 4], 4
cmp dword [eax + 0x14], edi
jb 0x40697a
mov eax, dword [eax]
push eax
lea edx, [ebp - 0x458]
push edx
call sym.jsService.exe_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____cdecl_KpBase::s2ws_char_const__
mov esi, 8
add esp, 8
cmp dword [eax + 0x14], esi
jb 0x406996
mov eax, dword [eax]
lea ecx, [ebp - 0x218]
push ecx
push eax
push str.IsAuto
lea edx, [ebp - 0x420]
push edx
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
cmp dword [ebp - 0x444], esi
jb 0x4069c7
mov eax, dword [ebp - 0x458]
push eax
call fcn.0041bfc5
add esp, 4
xor esi, esi
xor ecx, ecx
mov dword [ebp - 0x444], 7
mov dword [ebp - 0x448], esi
mov word [ebp - 0x458], cx
cmp dword [ebp - 0x460], edi
jb 0x4069f9
mov edx, dword [ebp - 0x474]
push edx
call fcn.0041bfc5
add esp, 4
mov dword [ebp - 0x464], esi
or esi, 0xffffffff
mov dword [ebp - 4], esi
mov dword [ebp - 0x460], 0xf
mov byte [ebp - 0x474], 0
cmp dword [ebp - 0x428], edi
jb 0x406a2d
mov eax, dword [ebp - 0x43c]
push eax
call fcn.0041bfc5
add esp, 4
mov eax, dword [ebx]
add eax, dword [ebp - 0x4b4]
lea ecx, [ebp - 0x474]
add eax, 0x20
push eax
push ecx
call sym.jsService.exe_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____cdecl_AyDecrypt::EncryptIni_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char____
add esp, 8
mov dword [ebp - 4], 5
cmp dword [eax + 0x14], edi
jb 0x406a56
mov eax, dword [eax]
push eax
lea edx, [ebp - 0x458]
push edx
call sym.jsService.exe_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____cdecl_KpBase::s2ws_char_const__
add esp, 8
cmp dword [eax + 0x14], 8
jb 0x406a6e
mov eax, dword [eax]
lea ecx, [ebp - 0x218]
push ecx
push eax
push str.FirstDns
lea edx, [ebp - 0x420]
push edx
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
cmp dword [ebp - 0x444], 8
jb 0x406aa0
mov eax, dword [ebp - 0x458]
push eax
call fcn.0041bfc5
add esp, 4
xor ecx, ecx
mov dword [ebp - 4], esi
mov dword [ebp - 0x444], 7
mov dword [ebp - 0x448], 0
mov word [ebp - 0x458], cx
cmp dword [ebp - 0x460], edi
jb 0x406ad7
mov edx, dword [ebp - 0x474]
push edx
call fcn.0041bfc5
add esp, 4
mov eax, dword [ebx]
add eax, dword [ebp - 0x4b4]
add eax, 0x3c
push eax
lea eax, [ebp - 0x490]
push eax
call sym.jsService.exe_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____cdecl_AyDecrypt::EncryptIni_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char____
add esp, 8
mov dword [ebp - 4], 6
cmp dword [eax + 0x14], edi
jb 0x406b00
mov eax, dword [eax]
push eax
lea ecx, [ebp - 0x4ac]
push ecx
call sym.jsService.exe_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____cdecl_KpBase::s2ws_char_const__
add esp, 8
cmp dword [eax + 0x14], 8
jb 0x406b18
mov eax, dword [eax]
lea edx, [ebp - 0x218]
push edx
push eax
push str.SecondDns
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
cmp dword [ebp - 0x498], 8
jb 0x406b4a
mov ecx, dword [ebp - 0x4ac]
push ecx
call fcn.0041bfc5
add esp, 4
xor edx, edx
mov dword [ebp - 4], esi
mov dword [ebp - 0x498], 7
mov dword [ebp - 0x49c], 0
mov word [ebp - 0x4ac], dx
cmp dword [ebp - 0x47c], edi
jb 0x406b81
mov eax, dword [ebp - 0x490]
push eax
call fcn.0041bfc5
add esp, 4
mov dword [ebp - 0x47c], 0xf
mov dword [ebp - 0x480], 0
mov byte [ebp - 0x490], 0
mov esi, dword [ebx]
mov ecx, dword [ebx + 4]
inc dword [ebp - 0x4b0]
add dword [ebp - 0x4b4], 0x58
sub ecx, esi
mov eax, 0x2e8ba2e9
imul ecx
sar edx, 4
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
cmp dword [ebp - 0x4b0], ecx
jb 0x4066ef
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.0041b4d6
mov esp, ebp
pop ebp
ret 4