Function at 0x4039e0
Capabilities:
Check if file exists
Create directory
Get common file path

Disassembly:
sub esp, 0x470
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x46c], eax
push ebx
push ebp
push esi
push edi
xor edi, edi
push 0x206
lea eax, [esp + 0x27a]
push edi
push eax
mov word [esp + 0x280], di
call fcn.004025f0
add esp, 0xc
lea esi, [esp + 0x34]
call fcn.00401000
mov edx, dword [0x405094]
mov eax, dword [edx + 0xc]
mov ecx, 0x405094
call eax
push 0x104
lea ecx, [esp + 0x278]
push ecx
lea esi, [eax + 0x10]
push edi
mov dword [esp + 0x1c], esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea edx, [esp + 0x274]
push edx
call dword [sym.imp.SHLWAPI.dll_PathStripPathW]
push 0x208
lea eax, [esp + 0x6e]
push edi
push eax
mov word [esp + 0x74], di
call fcn.004025f0
add esp, 0xc
push edi
push 0x23
lea ecx, [esp + 0x70]
push ecx
push edi
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
test eax, eax
je 0x403ea7
mov edi, dword [sym.imp.SHLWAPI.dll_PathAppendW]
push str.Kingsoft
lea edx, [esp + 0x6c]
push edx
call edi
mov ebp, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea eax, [esp + 0x68]
push eax
call ebp
test eax, eax
mov ebx, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
jne 0x403ad4
push 0
lea ecx, [esp + 0x6c]
push ecx
call ebx
test eax, eax
jne 0x403ad4
lea eax, [esi - 0x10]
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jmp 0x403eb7
push 0x4042c8
lea ecx, [esp + 0x6c]
push ecx
call edi
lea edx, [esp + 0x68]
push edx
call ebp
test eax, eax
jne 0x403afb
push eax
lea eax, [esp + 0x6c]
push eax
call ebx
test eax, eax
je 0x403ea7
push 0x4042d0
lea ecx, [esp + 0x6c]
push ecx
call edi
lea edx, [esp + 0x68]
push edx
call ebp
test eax, eax
jne 0x403b22
push eax
lea eax, [esp + 0x6c]
push eax
call ebx
test eax, eax
je 0x403ea7
lea ecx, [esp + 0x274]
push ecx
push 0x4042e4
lea eax, [esp + 0x70]
lea edi, [esp + 0x1c]
call fcn.00401090
lea edi, [esp + 0x24]
call fcn.004011e0
add esp, 4
lea edi, [esp + 0x24]
call fcn.004011e0
add esp, 4
lea edi, [esp + 0x10]
call fcn.00401110
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x403b7d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x403b9d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x403bbd
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push ecx
mov eax, 0x4042e8
mov edi, esp
call fcn.00401090
mov esi, dword [esp + 0x14]
add esi, 0xfffffff0
push ecx
mov eax, esi
mov edi, esp
mov dword [esp + 0x18], esi
call fcn.00401530
add eax, 0x10
mov dword [edi], eax
call fcn.00403870
add esp, 8
test eax, eax
je 0x403e8c
mov edx, dword [0x405094]
mov eax, dword [edx + 0xc]
mov ecx, 0x405094
mov dword [esp + 0x1c], 0
call eax
mov edx, dword [0x405094]
add eax, 0x10
mov dword [esp + 0x18], eax
mov eax, dword [edx + 0xc]
mov ecx, 0x405094
call eax
mov edx, dword [0x405094]
add eax, 0x10
mov dword [esp + 0x14], eax
mov eax, dword [edx + 0xc]
mov ecx, 0x405094
call eax
mov edx, dword [0x405094]
mov ebp, eax
mov eax, dword [edx + 0xc]
add ebp, 0x10
mov ecx, 0x405094
mov dword [esp + 0x20], ebp
call eax
mov edx, dword [0x405094]
add eax, 0x10
mov dword [esp + 0x28], eax
mov eax, dword [edx + 0xc]
mov ecx, 0x405094
call eax
add eax, 0x10
push 0x67
mov dword [esp + 0x34], eax
call fcn.00401a80
mov ecx, eax
add esp, 4
test ecx, ecx
je 0x403c90
lea edx, [esp + 0x18]
push edx
mov eax, 0x67
call fcn.004012c0
lea ebx, [esp + 0x18]
mov edi, 0x4042f0
lea esi, [esp + 0x24]
call fcn.00401250
mov ebx, eax
mov edi, 0x4042f4
lea esi, [esp + 0x2c]
call fcn.00401250
lea edi, [esp + 0x18]
call fcn.00401110
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x403cdb
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x403cfb
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edx, dword [esp + 0x18]
lea esi, [esp + 0x1c]
call fcn.00401be0
test eax, eax
jne 0x403dc3
push 0x69
call fcn.00401a80
mov ecx, eax
add esp, 4
test ecx, ecx
je 0x403d2f
lea edx, [esp + 0x28]
push edx
mov eax, 0x69
call fcn.004012c0
push 0x6a
call fcn.00401a80
mov ecx, eax
add esp, 4
test ecx, ecx
je 0x403d4e
lea eax, [esp + 0x30]
push eax
mov eax, 0x6a
call fcn.004012c0
lea ecx, [esp + 0x30]
push ecx
push 0x404324
lea eax, [esp + 0x30]
lea edi, [esp + 0x34]
call fcn.004011e0
add esp, 4
mov ebx, eax
lea esi, [esp + 0x28]
call fcn.00401170
add esp, 4
lea edi, [esp + 0x20]
call fcn.00401110
mov eax, esi
call fcn.004010f0
lea eax, [esp + 0x2c]
call fcn.004010f0
push 0x68
call fcn.00401a80
mov ecx, eax
add esp, 4
test ecx, ecx
je 0x403dae
lea edx, [esp + 0x14]
push edx
mov eax, 0x68
call fcn.004012c0
mov eax, dword [esp + 0x14]
mov ebp, dword [esp + 0x20]
push eax
lea ecx, [esp + 0x20]
push ecx
mov esi, ebp
call fcn.00401ba0
mov eax, dword [esp + 0x10]
push ecx
mov esi, esp
call fcn.00401530
add eax, 0x10
mov dword [esi], eax
call fcn.004037e0
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
add esp, 4
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x403dfc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x403e1c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
add ebp, 0xfffffff0
lea ecx, [ebp + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x403e39
mov ecx, dword [ebp]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push ebp
call edx
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x403e59
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x403e79
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x403e88
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [esp + 0x10]
lea ecx, [esi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x403ec3
mov ecx, dword [esi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push esi
call edx
jmp 0x403ec3
lea eax, [esi - 0x10]
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x403ec3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea edi, [esp + 0x38]
call fcn.004016c0
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x403eec
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x47c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
xor eax, eax
call fcn.004025d9
add esp, 0x470
ret 0x10