Function at 0x470590
Capabilities:
Get common file path
Query environment variable
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x45c
mov eax, dword [0x54d104]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [0x554d20]
lea ecx, [ebp - 0x450]
push esi
push edi
xorps xmm0, xmm0
mov dword [ebp - 0x45c], 0
xor eax, eax
mov byte [ebp - 0x455], 0
push 0x13
movups xmmword [ebp - 0x438], xmm0
push str.SoftwareMicrosoft_
mov dword [ebp - 0x428], 0
mov dword [ebp - 0x424], 7
mov word [ebp - 0x438], ax
movups xmmword [ebp - 0x450], xmm0
mov dword [ebp - 0x440], eax
mov dword [ebp - 0x43c], eax
call fcn.0040a960
push 0x104
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
jne 0x47062b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x45c], eax
cmp dword [ebp - 0x428], 0
je 0x47073e
movzx ecx, word [0x554c5c]
lea eax, [ebp - 0x450]
neg ecx
lea edx, [ebp - 0x454]
push edx
sbb ecx, ecx
cmp dword [ebp - 0x43c], 8
cmovae eax, dword [ebp - 0x450]
and ecx, 0x100
or ecx, 1
push ecx
push 0
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov dword [ebp - 0x45c], eax
test eax, eax
jne 0x470844
cmp dword [ebp - 0x424], 8
lea ecx, [ebp - 0x41c]
push ecx
lea ecx, [ebp - 0x210]
mov dword [ebp - 0x41c], 0x208
push ecx
lea ecx, [ebp - 0x420]
push ecx
lea eax, [ebp - 0x438]
cmovae eax, dword [ebp - 0x438]
push 0
push eax
push dword [ebp - 0x454]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov dword [ebp - 0x45c], eax
test eax, eax
jne 0x470732
mov eax, dword [ebp - 0x41c]
shr eax, 1
mov dword [ebp - 0x41c], eax
cmp eax, 0x104
jne 0x4706f6
mov dword [ebp - 0x41c], 0x103
mov eax, 0x206
jmp 0x470703
add eax, eax
cmp eax, 0x208
jae 0x470871
xor ecx, ecx
cmp dword [ebp - 0x420], 2
mov word [ebp + eax - 0x210], cx
jne 0x470732
lea eax, [ebp - 0x210]
push 0x25
push eax
call fcn.004b2788
add esp, 8
test eax, eax
je 0x470732
mov byte [ebp - 0x455], 1
push dword [ebp - 0x454]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 0x45c], 0
jne 0x470844
xor eax, eax
mov word [ebp - 0xa], ax
cmp byte [ebp - 0x455], al
je 0x47081d
push 0x104
lea eax, [ebp - 0x418]
push eax
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov esi, eax
test esi, esi
je 0x4707f3
cmp esi, 0x104
ja 0x470793
lea eax, [esi - 1]
push eax
lea eax, [ebp - 0x418]
jmp 0x47083c
xor ecx, ecx
mov eax, esi
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004bbca0
mov edi, eax
add esp, 4
test edi, edi
je 0x4707f9
push esi
push edi
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x4707e2
cmp eax, esi
ja 0x4707e8
lea eax, [esi - 1]
mov ecx, ebx
push eax
push edi
call fcn.0040a680
push edi
call fcn.004bbcb0
add esp, 4
jmp 0x470844
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
call fcn.004bbcb0
add esp, 4
jmp 0x4707f9
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebx + 0x14], 8
mov eax, ebx
jb 0x470803
mov eax, dword [ebx]
lea ecx, [ebp - 0x210]
cmp ecx, eax
je 0x470844
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x470810
jmp 0x470831
lea ecx, [ebp - 0x210]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x470826
sub ecx, edx
lea eax, [ebp - 0x210]
sar ecx, 1
push ecx
push eax
mov ecx, ebx
call fcn.0040a680
lea ecx, [ebp - 0x450]
call fcn.0040aa40
lea ecx, [ebp - 0x438]
call fcn.0040aa40
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x45c]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.004af3ab
mov esp, ebp
pop ebp
ret
call fcn.004af55a
int3