Function at 0x406523
Capabilities:
Create directory
Get common file path
Query or enumerate registry value

Disassembly:
mov eax, 0x42e4b8
call fcn.004279d0
sub esp, 0x320
push esi
mov esi, dword [ebp + 8]
mov ecx, esi
call fcn.004011bd
test eax, eax
je 0x406786
push 0x105
lea eax, [ebp - 0x124]
push 0
push eax
call sub.MSVCRT.dll_memset
mov ecx, dword [esi]
add esp, 0xc
test ecx, ecx
je 0x406569
call fcn.0040130a
jmp 0x40656b
xor eax, eax
push ebx
push edi
push eax
lea eax, [ebp - 0x124]
push eax
call sub.MSVCRT.dll_strcpy
mov ebx, dword [sym.imp.MSVCRT.dll_strstr]
mov edi, str._WINDOWS_DIR_
lea eax, [ebp - 0x124]
push edi
push eax
call ebx
add esp, 0x10
mov esi, 0x104
test eax, eax
je 0x4065ff
and byte [ebp - 0x228], 0
lea eax, [ebp - 0x228]
push esi
push eax
call dword [sym.imp.KERNEL32.DLL_GetWindowsDirectoryA]
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x228]
push eax
call fcn.00401118
push edi
call sub.MSVCRT.dll_strlen
pop ecx
lea eax, [ebp + eax - 0x124]
push eax
lea ecx, [ebp - 0x10]
call fcn.004010b1
mov ecx, dword [ebp + 8]
and dword [ebp - 4], 0
lea eax, [ebp - 0x10]
push eax
call fcn.00401168
or dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x10]
test ecx, ecx
je 0x406727
call fcn.004012dd
jmp 0x406727
mov edi, str._SYSTEM_DIR_
lea eax, [ebp - 0x124]
push edi
push eax
call ebx
pop ecx
test eax, eax
pop ecx
je 0x40666b
and byte [ebp - 0x228], 0
lea eax, [ebp - 0x228]
push esi
push eax
call dword [sym.imp.KERNEL32.DLL_GetSystemDirectoryA]
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x228]
push eax
call fcn.00401118
push edi
call sub.MSVCRT.dll_strlen
pop ecx
lea eax, [ebp + eax - 0x124]
push eax
lea ecx, [ebp - 0x10]
call fcn.004010b1
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x10]
push eax
mov dword [ebp - 4], 1
call fcn.00401168
or dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x10]
jmp 0x4065ed
mov edi, str._PROGRAMFILES_DIR_
lea eax, [ebp - 0x124]
push edi
push eax
call ebx
pop ecx
test eax, eax
pop ecx
je 0x406727
and byte [ebp - 0x32c], 0
and dword [ebp - 0x14], 0
lea eax, [ebp - 0x14]
push eax
push 0x20019
push 0
push str.SoftwareMicrosoftWindowsCurrentVersion
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x406727
lea eax, [ebp - 0x1c]
xor ebx, ebx
push eax
lea eax, [ebp - 0x32c]
push eax
push ebx
push ebx
push str.ProgramFilesDir
push dword [ebp - 0x14]
mov dword [ebp - 0x1c], esi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x40671e
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x32c]
push eax
call fcn.00401118
push edi
call sub.MSVCRT.dll_strlen
pop ecx
lea eax, [ebp + eax - 0x124]
push eax
lea ecx, [ebp - 0x18]
call fcn.004010b1
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x18]
push eax
mov dword [ebp - 4], 2
call fcn.00401168
mov ecx, dword [ebp - 0x18]
or dword [ebp - 4], 0xffffffff
cmp ecx, ebx
je 0x40671e
call fcn.004012dd
mov dword [ebp - 0x18], ebx
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push esi
lea eax, [ebp - 0x124]
push 0
push eax
call sub.MSVCRT.dll_memset
mov edi, dword [ebp + 8]
add esp, 0xc
mov ecx, edi
xor esi, esi
call fcn.004011bd
test eax, eax
jbe 0x406781
mov ecx, dword [edi]
test ecx, ecx
je 0x406756
call fcn.0040130a
jmp 0x406758
xor eax, eax
mov al, byte [eax + esi]
cmp al, 0x5c
mov byte [ebp + esi - 0x124], al
jne 0x406775
lea eax, [ebp - 0x124]
push 0
push eax
call dword [sym.imp.KERNEL32.DLL_CreateDirectoryA]
mov ecx, edi
inc esi
call fcn.004011bd
cmp esi, eax
jb 0x406749
push 1
pop eax
pop edi
pop ebx
mov ecx, dword [ebp - 0xc]
pop esi
mov dword fs:[0], ecx
leave
ret 4