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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x435e07
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 eax, dword [ebp + 0xc]
mov edi, dword [ebp + 8]
push 0
push 0x1a
lea edx, [ebp - 0x218]
mov esi, ecx
mov ecx, dword [ebp + 0x10]
push edx
push 0
mov dword [ebp - 0x4b4], eax
mov dword [ebp - 0x4b0], ecx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
mov ebx, 8
cmp dword [esi + 0x14], ebx
jb 0x4059a6
mov eax, dword [esi]
jmp 0x4059a8
mov eax, esi
push eax
lea eax, [ebp - 0x218]
push eax
push str._s_s
mov edx, eax
call fcn.00404770
add esp, 0xc
lea ecx, [ebp - 0x218]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4059de
push eax
lea edx, [ebp - 0x218]
push edx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
cmp dword [esi + 0x30], ebx
lea eax, [esi + 0x1c]
jb 0x4059e8
mov eax, dword [eax]
push eax
lea eax, [ebp - 0x218]
push eax
push str._s_s
mov edx, eax
call fcn.00404770
add esp, 0xc
lea ecx, [ebp - 0x218]
push ecx
push 0x104
lea edx, [ebp - 0x420]
push edx
push 0x43c02c
push str.LastConnect
push str.ConnectSetting
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
mov ecx, 0x43c02c
lea eax, [ebp - 0x420]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x405a58
test dx, dx
je 0x405a54
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x405a58
add eax, 4
add ecx, 4
test dx, dx
jne 0x405a32
xor eax, eax
jmp 0x405a5d
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x405cc0
lea eax, [ebp - 0x420]
push eax
lea ecx, [ebp - 0x4ac]
push ecx
call sym.jsService.exe_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____cdecl_KpBase::ws2s_wchar_t_const__
push eax
lea edx, [ebp - 0x43c]
push edx
mov dword [ebp - 4], 0
call sym.jsService.exe_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____cdecl_AyDecrypt::DecryptIni_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char____
add esp, 0x10
mov esi, eax
mov ebx, 0x10
cmp edi, esi
je 0x405aef
cmp dword [edi + 0x14], ebx
jb 0x405aaa
mov eax, dword [edi]
push eax
call fcn.0041bfc5
add esp, 4
mov dword [edi + 0x14], 0xf
mov dword [edi + 0x10], 0
mov byte [edi], 0
cmp dword [esi + 0x14], ebx
jae 0x405ad1
mov eax, dword [esi + 0x10]
inc eax
push eax
push esi
push edi
call fcn.0041b8d0
add esp, 0xc
jmp 0x405adb
mov eax, dword [esi]
mov dword [edi], eax
mov dword [esi], 0
mov ecx, dword [esi + 0x10]
mov dword [edi + 0x10], ecx
mov edx, dword [esi + 0x14]
xor eax, eax
mov dword [edi + 0x14], edx
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], eax
cmp dword [ebp - 0x428], ebx
jb 0x405b06
mov eax, dword [ebp - 0x43c]
push eax
call fcn.0041bfc5
add esp, 4
mov dword [ebp - 4], 0xffffffff
mov dword [ebp - 0x428], 0xf
mov dword [ebp - 0x42c], 0
mov byte [ebp - 0x43c], 0
cmp dword [ebp - 0x498], ebx
jb 0x405b3f
mov ecx, dword [ebp - 0x4ac]
push ecx
call fcn.0041bfc5
add esp, 4
mov esi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea edx, [ebp - 0x218]
push edx
push 0x104
lea eax, [ebp - 0x420]
push eax
push 0x43c02c
push str.LastSMode
push str.ConnectSetting
call esi
lea ecx, [ebp - 0x420]
push ecx
lea edx, [ebp - 0x43c]
push edx
call sym.jsService.exe_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____cdecl_KpBase::ws2s_wchar_t_const__
push eax
lea eax, [ebp - 0x474]
push eax
mov dword [ebp - 4], 2
call sym.jsService.exe_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____cdecl_AyDecrypt::DecryptIni_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char____
add esp, 0x10
mov byte [ebp - 4], 4
cmp dword [ebp - 0x428], ebx
jb 0x405bae
mov ecx, dword [ebp - 0x43c]
push ecx
call fcn.0041bfc5
add esp, 4
mov eax, dword [ebp - 0x474]
mov edi, 0xf
mov dword [ebp - 0x428], edi
mov dword [ebp - 0x42c], 0
mov byte [ebp - 0x43c], 0
cmp dword [ebp - 0x460], ebx
jae 0x405bde
lea eax, [ebp - 0x474]
push eax
call fcn.0041bdc3
mov edx, dword [ebp - 0x4b4]
add esp, 4
mov dword [edx], eax
lea eax, [ebp - 0x218]
push eax
push 0x104
lea ecx, [ebp - 0x420]
push ecx
push 0x43c02c
push str.LastLMode
push str.ConnectSetting
call esi
lea edx, [ebp - 0x420]
push edx
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_KpBase::ws2s_wchar_t_const__
push eax
lea ecx, [ebp - 0x458]
push ecx
mov byte [ebp - 4], 5
call sym.jsService.exe_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char_____cdecl_AyDecrypt::DecryptIni_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char____
add esp, 0x10
cmp dword [ebp - 0x47c], ebx
jb 0x405c51
mov edx, dword [ebp - 0x490]
push edx
call fcn.0041bfc5
add esp, 4
mov eax, dword [ebp - 0x458]
cmp dword [ebp - 0x444], ebx
jae 0x405c65
lea eax, [ebp - 0x458]
push eax
call fcn.0041bdc3
mov ecx, dword [ebp - 0x4b0]
add esp, 4
mov dword [ecx], eax
cmp dword [ebp - 0x444], ebx
jb 0x405c8d
mov edx, dword [ebp - 0x458]
push edx
call fcn.0041bfc5
add esp, 4
mov dword [ebp - 0x444], edi
mov dword [ebp - 0x448], 0
mov byte [ebp - 0x458], 0
cmp dword [ebp - 0x460], ebx
jb 0x405cbb
mov eax, dword [ebp - 0x474]
push eax
call fcn.0041bfc5
add esp, 4
mov eax, 1
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 0xc