Function at 0x403343
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.00404830
add esp, 0xc
lea eax, [ebp - 0x7c]
push eax
push 0x2001f
push ebx
push str.SoftwareThunder_NetworkGameXM_DL
push 0x80000002
mov dword [ebp - 0x7c], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x4033e8
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 0x4033e8
cmp dword [ebp - 0x70], 1
jne 0x4033e8
lea eax, [ebp - 0x6c]
push eax
push esi
call fcn.00404a55
pop ecx
pop ecx
cmp dword [ebp - 0x7c], ebx
je 0x4033f6
push dword [ebp - 0x7c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp word [0x411c40], bx
jne 0x40351a
mov eax, dword [0x40c784]
mov dword [ebp - 0x6c], eax
mov eax, dword [0x40c788]
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 0x40345f
lea eax, [eax + eax + 4]
push eax
call fcn.00404c11
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.00404a55
push dword [ebp - 0x70]
call fcn.00404aea
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.00404c11
pop ecx
push eax
push dword [ebp - 0x74]
mov dword [ebp - 0x70], eax
call edi
test eax, eax
jbe 0x4034e3
mov edi, dword [ebp - 0x70]
mov eax, edi
cmp word [eax], bx
je 0x4034e3
lea eax, [ebp - 0x6c]
push edi
push eax
call fcn.00404b6d
test eax, eax
pop ecx
pop ecx
je 0x4034d1
push edi
call dword [sym.imp.KERNEL32.dll_GetDriveTypeW]
cmp eax, 3
jne 0x4034d1
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 0x4034d1
cmp dword [ebp - 0x74], ebx
jg 0x4034ff
jl 0x4034d1
cmp dword [ebp - 0x78], 0x6400000
ja 0x4034ff
push dword [ebp - 0x70]
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea edi, [edi + eax*2 + 2]
cmp word [edi], bx
jne 0x40348e
lea eax, [ebp - 0x6c]
push eax
push esi
call fcn.00404a55
pop ecx
pop ecx
call fcn.00401946
test al, al
je 0x403502
push str.Program_Files__x86__
jmp 0x403507
push edi
jmp 0x4034e7
push str.Program_Files_
push esi
call fcn.00404a2b
pop ecx
pop ecx
push dword [ebp - 0x70]
call fcn.00404aea
pop ecx
jmp 0x403521
mov byte [0x411620], 1
mov edi, 0x40c708
push edi
call fcn.0040301b
test eax, eax
pop ecx
je 0x403551
push esi
push edi
call fcn.00403182
push esi
call fcn.00404a15
lea eax, [eax*2 + 0x411c3e]
add esp, 0xc
cmp word [eax], 0x5c
jne 0x403551
mov word [eax], bx
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40356b
push esi
push ebx
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
test eax, eax
je 0x40356b
mov dword [ebp - 0x80], ebx
push esi
push 0x40c2f0
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.0040412d
add ebp, 0x1a0
leave
ret