Function at 0x401770
Capabilities:
Check if file exists
Get file attributes
Query or enumerate registry key
Query or enumerate registry value

Disassembly:
push ebp
push edi
push esi
mov esi, eax
push ebx
sub esp, 0x8dc
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x4c]
mov dword [esp + 0x10], eax
mov eax, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov dword [esp + 0x30], edx
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0
mov dword [esp + 4], str.SOFTWAREPythonPythonCore
mov dword [esp], esi
mov dword [esp + 0x34], eax
call eax
mov ecx, str.HKLM
mov edx, str.HKCU
sub esp, 0x14
cmp esi, 0x80000002
cmove edx, ecx
mov dword [esp + 0x3c], edx
test eax, eax
jne 0x401c60
mov eax, dword [0x44b808]
imul esi, eax, 0x214
add esi, 0x44b820
cmp eax, 0x63
ja 0x401d34
mov eax, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [esp + 0x20], 0
mov dword [esp + 0x38], eax
jmp 0x40187c
lea eax, [esp + 0x58]
lea edi, [esi + 0xc]
mov dword [esp + 0x58], 0x207
mov dword [esp + 0x14], eax
lea eax, [esp + 0x54]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x50]
mov dword [esp + 0x10], edi
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
sub esp, 0x18
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x50]
mov dword [esp], eax
mov eax, dword [esp + 0x38]
call eax
sub esp, 4
mov edx, dword [esp + 0x24]
test edx, edx
jne 0x4019c0
cmp dword [esp + 0x54], 1
je 0x401a20
add dword [esp + 0x20], 1
cmp dword [0x44b808], 0x63
ja 0x4019a5
lea eax, [esp + 0x60]
mov dword [esp + 0xc], 8
mov dword [esp + 8], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x4c]
mov dword [esp], eax
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyW]
sub esp, 0x10
test eax, eax
jne 0x401c80
lea eax, [esp + 0x60]
lea ebx, [esp + 0x70]
mov dword [esp], esi
mov dword [esp + 0xc], 3
mov dword [esp + 8], eax
mov dword [esp + 4], 4
call dword [sym.imp.msvcrt.dll_wcsncpy_s]
lea eax, [esp + 0x60]
mov dword [esp], ebx
mov ebp, dword [sym.imp.msvcrt.dll__snwprintf_s]
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], str.SOFTWAREPythonPythonCore
mov dword [esp + 0xc], str._ls_lsInstallPath
mov dword [esp + 8], 0xffffffff
mov dword [esp + 4], 0x30
call ebp
lea eax, [esp + 0x50]
mov dword [esp + 8], 0
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 4], ebx
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
mov eax, dword [esp + 0x34]
call eax
sub esp, 0x14
test eax, eax
je 0x401800
lea edi, [esp + 0xd0]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x400
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], 0x400
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], 0x1200
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
sub esp, 0x1c
mov eax, dword [esp + 0x3c]
mov dword [esp + 0xc], edi
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov dword [esp], str._ls_ls:__ls
call fcn.00401620
add dword [esp + 0x20], 1
cmp dword [0x44b808], 0x63
jbe 0x40187c
mov eax, dword [esp + 0x4c]
mov dword [esp], eax
mov eax, dword [esp + 0x38]
call eax
sub esp, 4
add esp, 0x8dc
pop ebx
pop esi
pop edi
pop ebp
ret
lea edi, [esp + 0xd0]
mov dword [esp + 8], edx
mov dword [esp + 0x10], edi
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x400
mov dword [esp + 0xc], 0x400
mov dword [esp + 4], 0
mov dword [esp], 0x1200
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
sub esp, 0x1c
mov eax, dword [esp + 0x3c]
mov dword [esp + 0xc], edi
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov dword [esp], str._ls_ls:__ls_n
call fcn.00401620
jmp 0x40186a
mov eax, dword [esp + 0x58]
shr eax, 1
lea edx, [eax - 1]
cmp word [esi + eax*2 + 8], 0x5c
mov dword [esp + 0x58], edx
lea edx, [eax - 2]
jne 0x401a3c
mov dword [esp + 0x58], edx
mov eax, dword [0x4061b0]
test eax, eax
je 0x40186a
mov dword [esp + 0x24], ebp
mov ebx, 0x4061b0
lea esi, [esi]
mov edx, dword [esp + 0x58]
mov ecx, 0x104
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], str.pythonw.exe
sub ecx, edx
lea eax, [esi + edx*2 + 0xc]
mov dword [esp + 0xc], str._ls_ls
mov dword [esp], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 8], ecx
mov dword [esp + 4], ecx
call eax
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
sub esp, 4
mov dword [esp + 0x5c], eax
cmp eax, 0xffffffff
je 0x401c00
mov edx, eax
and edx, 0x10
jne 0x401b18
mov ecx, dword [0x44b808]
mov ebp, 0x44b82c
test ecx, ecx
je 0x401b34
mov dword [esp + 0x28], ebx
mov ebx, ebp
mov ebp, edx
jmp 0x401ad9
add ebp, 1
add ebx, 0x214
cmp ebp, dword [0x44b808]
jae 0x401b30
mov dword [esp + 4], ebx
mov dword [esp], edi
call dword [sym.imp.msvcrt.dll__wcsicmp]
test eax, eax
jne 0x401ac8
mov dword [esp + 4], edi
mov ebx, dword [esp + 0x28]
mov dword [esp], str.locate_pythons_for_key:__ls:_already_found_n
call fcn.00401620
mov eax, dword [ebx + 4]
add ebx, 4
test eax, eax
je 0x40186a
lea edi, [esi + 0xc]
jmp 0x401a58
mov dword [esp + 8], eax
mov dword [esp + 4], edi
mov dword [esp], str.locate_pythons_for_key:__ls_is_a_directory_n
call fcn.00401620
jmp 0x401afe
mov ebx, dword [esp + 0x28]
lea eax, [esp + 0x5c]
mov dword [esp], edi
mov dword [esp + 4], eax
call dword [sym.imp.KERNEL32.dll_GetBinaryTypeW]
sub esp, 8
test eax, eax
je 0x401d10
mov eax, dword [esp + 0x5c]
cmp eax, 6
je 0x401d28
test eax, eax
jne 0x401cf0
mov dword [esi + 8], 0x20
mov dword [esp + 4], 0x20
mov dword [esp], edi
call sub.msvcrt.dll_wcschr
test eax, eax
je 0x401bb7
mov dword [esp], edi
call sub.msvcrt.dll_wcslen
mov dword [esp + 4], edi
lea edx, [eax + eax]
lea eax, [esi + 0xe]
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 0x28], edx
call sub.msvcrt.dll_memmove
mov edx, dword [esp + 0x28]
mov eax, 0x22
mov word [esi + 0xc], ax
mov dword [esi + edx + 0xe], 0x22
mov eax, dword [esi + 8]
mov dword [esp + 4], edi
mov dword [esp], str.locate_pythons_for_key:__ls_is_a__dbit_executable_n
mov dword [esp + 8], eax
call fcn.00401620
mov eax, dword [0x44b808]
lea edx, [eax + 1]
lea eax, [esi + 0x214]
mov dword [0x44b808], edx
cmp edx, 0x63
ja 0x4019a5
mov ecx, 0x85
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov esi, eax
jmp 0x401afe
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ebp, [esp + 0xd0]
mov dword [esp + 0x18], 0
mov dword [esp + 0x10], ebp
mov dword [esp + 0x14], 0x400
mov dword [esp + 0xc], 0x400
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], 0x1200
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
sub esp, 0x1c
mov dword [esp + 8], ebp
mov dword [esp + 4], edi
mov dword [esp], str.locate_pythons_for_key:__ls:__ls
call fcn.00401620
jmp 0x401afe
mov dword [esp + 4], edx
mov dword [esp], str.locate_pythons_for_key:_unable_to_open_PythonCore_key_in__ls_n
call fcn.00401620
add esp, 0x8dc
pop ebx
pop esi
pop edi
pop ebp
ret
cmp eax, 0x103
je 0x4019a5
lea ebx, [esp + 0xd0]
mov dword [esp + 0x18], 0
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], 0x400
mov dword [esp + 0xc], 0x400
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], 0x1200
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
sub esp, 0x1c
lea eax, [esp + 0x60]
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov dword [esp], str.Cant_enumerate_registry_key_for_version__ls:__ls_n
call fcn.00401620
jmp 0x4019a5
mov dword [esi + 8], 0
mov dword [esp + 8], eax
mov dword [esp + 4], edi
mov dword [esp], str.locate_pythons_for_key:__ls:_invalid_binary_type:__X_n
call fcn.00401620
jmp 0x401afe
mov dword [esp + 4], edi
mov dword [esp], str.Failure_getting_binary_type:__ls_n
call fcn.00401620
jmp 0x401afe
mov dword [esi + 8], 0x40
jmp 0x401b6c
mov eax, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [esp + 0x38], eax
jmp 0x4019a5