Function at 0x4161c0
Capabilities:
Create directory
Query environment variable
Read .ini file
Set environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x644
mov eax, dword [0x45b050]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
lea esi, [ecx + 4]
mov dword [ebp - 0x628], ecx
push edi
push 0
mov ecx, esi
mov dword [ebp - 0x624], esi
call fcn.0040fb80
mov ebx, dword [sym.imp.USER32.dll_GetSystemMetrics]
push 0
push 0xc
call ebx
push eax
push 0xb
call ebx
mov edi, dword [sym.imp.USER32.dll_LoadImageW]
push eax
push 1
push 0x80
push dword [0x45d45c]
call edi
push eax
push 1
push 0x80
push dword [esi]
mov esi, dword [sym.imp.USER32.dll_SendMessageW]
call esi
push 0
push 0x32
call ebx
push eax
push 0x31
call ebx
push eax
push 1
push 0x80
push dword [0x45d45c]
call edi
push eax
mov eax, dword [ebp - 0x624]
push 0
push 0x80
push dword [eax]
call esi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, dword [0x45e858]
add esi, 0x10
mov dword [ebp - 0x624], eax
push esi
mov dword [ebp - 0x644], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [0x45d428]
lea eax, [ebp - 0x624]
push eax
call fcn.00415070
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ebx, dword [ebp - 0x628]
lea eax, [ebp - 0x628]
push eax
mov byte [ebp - 0x640], 0
lea ecx, [ebx + 0x20]
mov dword [ebp - 0x628], ecx
lea ecx, [edi + 4]
call fcn.004137a0
lea eax, [ebx + 0x24]
mov dword [ebp - 0x62c], eax
lea ecx, [edi + 0x10]
lea eax, [ebp - 0x62c]
push eax
call fcn.004137a0
mov eax, dword [ebx + 4]
test eax, eax
je 0x4162f6
mov dword [ebp - 0x634], eax
lea ecx, [ebx + 0x2c]
mov eax, 4
mov word [ebp - 0x630], ax
lea eax, [ebp - 0x634]
push eax
call fcn.00413820
mov dword [ebx + 0xe8], 0
mov dword [ebx + 0x5c], 0
mov dword [ebx + 0x60], 1
push 0x447bf0
mov byte [ebx + 0x48], 0
mov dword [ebx + 0x4c], 0
call dword [sym.imp.USER32.dll_RegisterWindowMessageW]
call fcn.00411ad0
mov ecx, dword [ebx + 0x50]
mov edi, eax
test ecx, ecx
je 0x416340
push ecx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov dword [ebx + 0x50], 0
mov eax, edi
mov dword [ebx + 0x50], edi
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
test eax, eax
je 0x416383
push str.CreateInstance
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
je 0x41639c
lea ecx, [ebx + 0x54]
push ecx
push 0x447860
push 0x447850
call esi
lea ecx, [ebx + 0x58]
push ecx
push 0x447870
push 0x447850
call esi
jmp 0x41639c
push 0xbb8
call edi
push 0
push 1
push 0x111
push dword [ebx + 4]
call dword [sym.imp.USER32.dll_PostMessageW]
mov ecx, ebx
call fcn.00414470
mov ecx, ebx
call fcn.00413920
push 0x208
lea eax, [ebp - 0x20c]
push 0
push eax
call fcn.00424380
add esp, 0xc
lea eax, [ebp - 0x20c]
push 0x104
push eax
push 0x447a98
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov esi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea eax, [ebp - 0x20c]
push 0
push eax
call esi
push 0x208
lea eax, [ebp - 0x414]
push 0
push eax
call fcn.00424380
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x414]
push 0x104
push eax
call fcn.00429a76
push str.KZMount.ini
lea eax, [ebp - 0x414]
push 0x104
push eax
call fcn.00429a01
push 0x208
lea eax, [ebp - 0x61c]
push 0
push eax
call fcn.00424380
add esp, 0x30
lea eax, [ebp - 0x414]
push eax
push 0x104
lea eax, [ebp - 0x61c]
push eax
lea eax, [ebp - 0x20c]
push eax
push str.IndexPath
push 0x447af4
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
push 0
lea eax, [ebp - 0x61c]
push eax
call esi
lea eax, [ebp - 0x61c]
push eax
push str.KZMOUNT_INDEXPATH
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov ecx, dword [ebx + 0x54]
test ecx, ecx
je 0x4165c6
mov byte [ebp - 0x61d], 0
lea edx, [ebp - 0x61d]
mov eax, dword [ecx]
push edx
push ecx
call dword [eax + 0xc]
test eax, eax
jne 0x4165ad
cmp byte [ebp - 0x61d], al
je 0x4164f0
push 0x27e7
push 0x27dd
push 0x27dd
mov ecx, ebx
call fcn.004177f0
mov ecx, dword [ebx + 0x58]
test ecx, ecx
je 0x4165c6
mov eax, dword [ecx]
push ecx
call dword [eax + 0xc]
mov ecx, ebx
test eax, eax
jne 0x416573
call fcn.004152e0
jmp 0x4165c6
lea ecx, [ebp - 0x63c]
call fcn.0041d8e0
lea ecx, [ebp - 0x63c]
call fcn.0041d8f0
test al, al
je 0x416589
push 0xd5
mov ecx, ebx
call fcn.004176e0
push ecx
mov ecx, dword [ebx + 0x54]
mov eax, esp
mov dword [eax], ecx
test ecx, ecx
je 0x416528
mov eax, dword [ecx]
push ecx
call dword [eax + 4]
lea ecx, [ebp - 0x63c]
call fcn.0041dea0
test al, al
je 0x416589
push 0x80
mov ecx, ebx
call fcn.004176e0
push 0x2816
push 0x27dd
push 0x27dd
mov ecx, ebx
call fcn.004177f0
mov ecx, dword [ebx + 0x58]
test ecx, ecx
je 0x4165c6
mov eax, dword [ecx]
push ecx
call dword [eax + 0xc]
mov ecx, ebx
test eax, eax
jne 0x416573
call fcn.004152e0
jmp 0x4165c6
push 0x2813
push 0xd5
push 0x27dd
call fcn.004177f0
jmp 0x4165c6
push 0xd4
mov ecx, ebx
call fcn.004176e0
push 0x2815
push 0xbd
push 0x27dd
mov ecx, ebx
call fcn.004177f0
jmp 0x4165c6
push 0xbb8
call edi
push 0
push 1
push 0x111
push dword [ebx + 4]
call dword [sym.imp.USER32.dll_PostMessageW]
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004204ef
mov esp, ebp
pop ebp
ret 0x10