Function at 0x40382f
Capabilities:
Check if file exists
Get common file path
Get disk information
Get disk size
Query or enumerate registry value
Set environment variable

Disassembly:
push ebp
lea ebp, [esp - 0x1a0]
sub esp, 0x220
mov eax, dword [0x410eec]
push ebx
push esi
push edi
push 0x104
xor ebx, ebx
push ebx
mov esi, 0x411c40
push esi
mov dword [ebp + 0x19c], eax
mov dword [ebp - 0x80], 1
call fcn.004045a0
add esp, 0xc
lea eax, [ebp - 0x7c]
push eax
push 0x2001f
push ebx
push str.SoftwareThunder_NetworkGameDCF_DL
push 0x80000002
mov dword [ebp - 0x7c], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x4038d4
mov word [ebp - 0x6c], bx
mov ecx, 0x81
lea edi, [ebp - 0x6a]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x74]
push eax
lea eax, [ebp - 0x6c]
push eax
lea eax, [ebp - 0x70]
push eax
push ebx
push str.InstDir
push dword [ebp - 0x7c]
mov dword [ebp - 0x74], 0x104
mov dword [ebp - 0x70], ebx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x4038d4
cmp dword [ebp - 0x70], 1
jne 0x4038d4
lea eax, [ebp - 0x6c]
push eax
push esi
call fcn.004047c5
pop ecx
pop ecx
cmp dword [ebp - 0x7c], ebx
je 0x4038e2
push dword [ebp - 0x7c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp word [0x411c40], bx
jne 0x403a02
mov eax, dword [0x40cc18]
mov dword [ebp - 0x6c], eax
mov eax, dword [0x40cc1c]
mov dword [ebp - 0x68], eax
xor eax, eax
mov ecx, 0x80
lea edi, [ebp - 0x64]
push ebx
rep stosd dword es:[edi], eax
mov edi, dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
push ebx
call edi
cmp eax, ebx
mov dword [ebp - 0x74], eax
jbe 0x40394b
lea eax, [eax + eax + 4]
push eax
call fcn.00404981
pop ecx
push dword [ebp - 0x74]
mov dword [ebp - 0x70], eax
push eax
call edi
push dword [ebp - 0x70]
lea eax, [ebp - 0x6c]
push eax
call fcn.004047c5
push dword [ebp - 0x70]
call fcn.0040485a
add esp, 0xc
mov word [ebp - 0x66], bx
mov edi, dword [sym.imp.KERNEL32.dll_GetLogicalDriveStringsW]
push ebx
push ebx
call edi
mov dword [ebp - 0x74], eax
lea eax, [eax + eax + 2]
push eax
call fcn.00404981
pop ecx
push eax
push dword [ebp - 0x74]
mov dword [ebp - 0x70], eax
call edi
test eax, eax
jbe 0x4039cb
mov edi, dword [ebp - 0x70]
cmp edi, ebx
je 0x4039cb
lea eax, [ebp - 0x6c]
push edi
push eax
call fcn.004048dd
test eax, eax
pop ecx
pop ecx
je 0x4039ba
push edi
call dword [sym.imp.KERNEL32.dll_GetDriveTypeW]
cmp eax, 3
jne 0x4039ba
push ebx
push ebx
lea eax, [ebp - 0x78]
push eax
push edi
mov dword [ebp - 0x78], ebx
mov dword [ebp - 0x74], ebx
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceExW]
test eax, eax
je 0x4039ba
cmp dword [ebp - 0x74], ebx
jg 0x4039e7
jl 0x4039ba
cmp dword [ebp - 0x78], 0x6400000
ja 0x4039e7
push dword [ebp - 0x70]
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea edi, [edi + eax*2 + 2]
cmp edi, ebx
jne 0x403977
lea eax, [ebp - 0x6c]
push eax
push esi
call fcn.004047c5
pop ecx
pop ecx
call fcn.00401916
test al, al
je 0x4039ea
push str.Program_Files__x86__
jmp 0x4039ef
push edi
jmp 0x4039cf
push str.Program_Files_
push esi
call fcn.0040479b
pop ecx
pop ecx
push dword [ebp - 0x70]
call fcn.0040485a
pop ecx
jmp 0x403a09
mov byte [0x411620], 1
mov edi, 0x40cba4
push edi
call fcn.00403507
test eax, eax
pop ecx
je 0x403a39
push esi
push edi
call fcn.0040366e
push esi
call fcn.00404785
lea eax, [eax*2 + 0x411c3e]
add esp, 0xc
cmp word [eax], 0x5c
jne 0x403a39
mov word [eax], bx
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x403a53
push esi
push ebx
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
test eax, eax
je 0x403a53
mov dword [ebp - 0x80], ebx
push esi
push 0x40c2f4
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov ecx, dword [ebp + 0x19c]
mov eax, dword [ebp - 0x80]
pop edi
pop esi
pop ebx
call fcn.00403e9d
add ebp, 0x1a0
leave
ret