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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2bc
mov eax, dword [0x42603c]
xor eax, ebp
mov dword [ebp - 4], eax
xor eax, eax
push 0x206
push eax
lea ecx, [ebp - 0x28a]
push ecx
mov word [ebp - 0x28c], ax
call fcn.00413700
xor edx, edx
push 0x7e
push edx
lea eax, [ebp - 0x82]
push eax
mov word [ebp - 0x84], dx
call fcn.00413700
add esp, 0x18
mov dword [ebp - 0x298], 0x40
mov dword [ebp - 0x294], 1
xor eax, eax
nop
movzx ecx, word [eax + str.C:Program_FilesWW2017CF]
mov word [eax + 0xf99cd0], cx
add eax, 2
test cx, cx
jne 0x407760
push str.GetNativeSystemInfo
push str.kernel32
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x40779a
lea ecx, [ebp - 0x2bc]
push ecx
call eax
movzx eax, word [ebp - 0x2bc]
test eax, eax
je 0x4077b1
xor edx, edx
cmp eax, 9
sete dl
mov eax, edx
jmp 0x4077b3
xor eax, eax
mov dword [0xf99ed8], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push 0x104
push 0xf99ee8
mov dword [0xf99ee0], eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
jne 0x4077e7
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040f51e
mov esp, ebp
pop ebp
ret
push 0x104
push 0xf9a0f0
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x4077d7
cmp dword [0xf99ed8], 0
push ebx
push esi
push edi
je 0x407957
mov edi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
lea eax, [ebp - 0x290]
push eax
push 0x20219
push 0
push str.SOFTWAREMicrosoftWindowsCurrentVersion
push reloc.OLEAUT32.dll_SysReAllocString
call edi
test eax, eax
jne 0x407bca
mov ebx, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
lea ecx, [ebp - 0x298]
push ecx
mov ecx, dword [ebp - 0x290]
lea edx, [ebp - 0x84]
push edx
lea eax, [ebp - 0x294]
push eax
push 0
push str.ProgramFilesDir
push ecx
call ebx
test eax, eax
jne 0x407bbd
jmp 0x407870
movzx ecx, word [ebp + eax - 0x84]
mov word [eax + 0xf9a500], cx
add eax, 2
test cx, cx
jne 0x407870
push 0x80
lea edx, [ebp - 0x84]
push 0
push edx
call fcn.00413700
mov eax, dword [ebp - 0x290]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
add esp, 0xc
push eax
call esi
lea ecx, [ebp - 0x290]
push ecx
push 0x20119
push 0
push str.SOFTWAREMicrosoftWindowsCurrentVersion
push reloc.OLEAUT32.dll_SysReAllocString
call edi
test eax, eax
jne 0x407bca
lea edx, [ebp - 0x298]
push edx
mov edx, dword [ebp - 0x290]
lea eax, [ebp - 0x84]
push eax
lea ecx, [ebp - 0x294]
push ecx
push 0
push str.ProgramFilesDir
push edx
call ebx
test eax, eax
jne 0x40793b
jmp 0x407900
movzx ecx, word [ebp + eax - 0x84]
mov word [eax + 0xf9a2f8], cx
add eax, 2
test cx, cx
jne 0x407900
push 0x80
lea eax, [ebp - 0x84]
push 0
push eax
call fcn.00413700
mov ecx, dword [ebp - 0x290]
add esp, 0xc
push ecx
call esi
jmp 0x4079ea
mov edx, dword [ebp - 0x290]
push edx
call esi
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040f51e
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 0x290]
push ecx
push 0x20019
push 0
push str.SOFTWAREMicrosoftWindowsCurrentVersion
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x407bca
lea edx, [ebp - 0x298]
push edx
mov edx, dword [ebp - 0x290]
lea eax, [ebp - 0x84]
push eax
lea ecx, [ebp - 0x294]
push ecx
push 0
push str.ProgramFilesDir
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x407bbd
mov edi, edi
movzx ecx, word [ebp + eax - 0x84]
mov word [eax + 0xf9a2f8], cx
add eax, 2
test cx, cx
jne 0x4079b0
push 0x80
lea eax, [ebp - 0x84]
push 0
push eax
call fcn.00413700
mov ecx, dword [ebp - 0x290]
add esp, 0xc
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0x104
lea edx, [ebp - 0x28c]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x407bca
push 0x208
push 0
push 0xf9a708
call fcn.00413700
add esp, 0xc
xor eax, eax
lea esp, [esp]
movzx ecx, word [ebp + eax - 0x28c]
mov word [eax + 0xf9a708], cx
add eax, 2
test cx, cx
jne 0x407a20
lea eax, [ebp - 0x28c]
push 0x5c
push eax
call fcn.0040fb74
add esp, 8
test eax, eax
je 0x407bca
lea ecx, [ebp - 0x28c]
push 0x5c
push ecx
call fcn.0040fb74
add eax, 2
mov edx, 0xf9a910
add esp, 8
sub edx, eax
jmp 0x407a70
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x407a70
lea edx, [ebp - 0x28c]
push 0x5c
push edx
call fcn.0040fb74
xor ecx, ecx
add esp, 8
mov word [eax + 2], cx
xor eax, eax
jmp 0x407aa0
movzx ecx, word [ebp + eax - 0x28c]
mov word [eax + 0xf9ad20], cx
add eax, 2
test cx, cx
jne 0x407aa0
lea edx, [ebp - 0x28c]
push 0x5c
push edx
call fcn.0040fb74
xor ecx, ecx
add esp, 8
mov word [eax], cx
xor eax, eax
nop
movzx ecx, word [ebp + eax - 0x28c]
mov word [eax + 0xf9af28], cx
add eax, 2
test cx, cx
jne 0x407ad0
push 0x208
lea edx, [ebp - 0x28c]
push 0
push edx
call fcn.00413700
add esp, 0xc
xor eax, eax
nop
movzx ecx, word [eax + 0xf9a910]
mov word [ebp + eax - 0x28c], cx
add eax, 2
test cx, cx
jne 0x407b00
lea eax, [ebp - 0x28c]
push 0x2e
push eax
call fcn.0040fb74
add esp, 8
test eax, eax
je 0x407bca
lea ecx, [ebp - 0x28c]
push 0x2e
push ecx
call fcn.0040fb74
xor edx, edx
add esp, 8
mov word [eax], dx
xor eax, eax
jmp 0x407b50
movzx ecx, word [ebp + eax - 0x28c]
mov word [eax + 0xf9ab18], cx
add eax, 2
test cx, cx
jne 0x407b50
mov esi, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push 0x104
push 0xf9b130
push str._TEMP_
call esi
push 0xf9ab18
push str.C:UsersPublicSMR7Debug_s
push 0xf9b338
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push 0x104
push 0xf9b540
push str._SystemDrive_
call esi
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040f51e
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x290]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
xor eax, eax
pop ebx
call fcn.0040f51e
mov esp, ebp
pop ebp
ret