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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x8f8
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov eax, ecx
mov dword [ebp - 0x8f0], edx
cmp eax, 0x80000002
mov dword [ebp - 0x8f4], eax
mov ecx, str.HKCU
mov ebx, str.HKLM
cmovne ebx, ecx
lea ecx, [ebp - 0x8ec]
push ecx
push dword [ebp + 8]
mov dword [ebp - 0x8e0], ebx
push 0
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x40129f
push ebx
push str.locate_pythons_for_key:_unable_to_open_PythonCore_key_in__ls_n
call fcn.00401130
add esp, 8
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004036ef
mov esp, ebp
pop ebp
ret
imul ebx, dword [0x4288dc], 0x424
xor ecx, ecx
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [ebp - 0x8e8], ecx
add ebx, 0x4288e0
cmp dword [0x4288dc], 0x64
mov dword [ebp - 0x8cc], ebx
jae 0x401828
push edi
mov edi, dword [sym.imp.KERNEL32.dll_FormatMessageW]
push 8
lea eax, [ebp - 0x14]
push eax
push ecx
push dword [ebp - 0x8ec]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyW]
test eax, eax
jne 0x4017eb
push 7
lea eax, [ebp - 0x14]
push eax
push 8
push ebx
call fcn.0040e1e9
push 0x2d
push ebx
call fcn.00404617
mov esi, eax
add esp, 0x18
test esi, esi
je 0x401352
mov edx, 0x422df0
mov ecx, esi
nop dword [eax]
mov ax, word [ecx]
cmp ax, word [edx]
jne 0x401346
test ax, ax
je 0x401342
mov ax, word [ecx + 2]
cmp ax, word [edx + 2]
jne 0x401346
add ecx, 4
add edx, 4
test ax, ax
jne 0x401320
xor eax, eax
jmp 0x40134b
sbb eax, eax
or eax, 1
test eax, eax
jne 0x401352
mov word [esi], ax
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x8f0]
lea eax, [ebp - 0xc4]
push str._ls_lsInstallPath
push 0xffffffffffffffff
push 0x58
push eax
call fcn.004010b0
add esp, 0x18
lea eax, [ebp - 0x8d4]
push eax
push dword [ebp + 8]
lea eax, [ebp - 0xc4]
push 0
push eax
push dword [ebp - 0x8f4]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x4013da
push 0
push 0x400
lea ecx, [ebp - 0x8c4]
push ecx
push 0x400
push eax
push 0
push 0x1200
call edi
lea eax, [ebp - 0x8c4]
push eax
lea eax, [ebp - 0xc4]
push eax
push dword [ebp - 0x8e0]
push str._ls_ls:__ls
call fcn.00401130
add esp, 0x10
jmp 0x4017c9
lea eax, [ebp - 0x8c8]
mov dword [ebp - 0x8c8], 0x207
push eax
lea esi, [ebx + 0x14]
xor edi, edi
push esi
lea eax, [ebp - 0x8dc]
mov dword [ebp - 0x8d0], edi
push eax
push edi
push str.ExecutablePath
push dword [ebp - 0x8d4]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x401429
cmp dword [ebp - 0x8dc], 1
jne 0x401429
cmp dword [ebp - 0x8c8], edi
jne 0x4014b8
lea eax, [ebp - 0x8c8]
mov dword [ebp - 0x8c8], 0x207
push eax
push esi
lea eax, [ebp - 0x8dc]
mov edi, 1
push eax
push 0
push 0
push dword [ebp - 0x8d4]
mov dword [ebp - 0x8d0], edi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x4014b8
mov edi, dword [sym.imp.KERNEL32.dll_FormatMessageW]
lea ecx, [ebp - 0x8c4]
push 0
push 0x400
push ecx
push 0x400
push eax
push 0
push 0x1200
call edi
lea eax, [ebp - 0x8c4]
push eax
lea eax, [ebp - 0xc4]
push eax
push dword [ebp - 0x8e0]
push str._ls_ls:__ls_n
call fcn.00401130
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
add esp, 0x10
push dword [ebp - 0x8d4]
call esi
jmp 0x4017cf
push dword [ebp - 0x8d4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 0x8dc], 1
jne 0x4017c3
mov ecx, dword [ebp - 0x8c8]
shr ecx, 1
dec ecx
mov dword [ebp - 0x8c8], ecx
cmp word [ebx + ecx*2 + 0x12], 0x5c
jne 0x4014ef
dec ecx
mov dword [ebp - 0x8c8], ecx
cmp dword [0x427b30], 0
mov edx, 0x427b30
mov dword [ebp - 0x8e4], edx
je 0x4017c3
test edi, edi
je 0x40152f
push str.python.exe
push dword [edx]
mov eax, 0x104
sub eax, ecx
add ecx, 0xa
push str._ls_ls
push eax
push eax
lea eax, [ebx + ecx*2]
push eax
call fcn.004010b0
add esp, 0x18
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [ebp - 0x8d8], eax
cmp eax, 0xffffffff
jne 0x401582
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0
push 0x400
lea ecx, [ebp - 0x8c4]
push ecx
push 0x400
push eax
push 0
push 0x1200
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
lea eax, [ebp - 0x8c4]
push eax
push esi
push str.locate_pythons_for_key:__ls:__ls
call fcn.00401130
add esp, 0xc
jmp 0x40178b
test al, 0x10
je 0x401599
push esi
push str.locate_pythons_for_key:__ls_is_a_directory_n
call fcn.00401130
add esp, 8
jmp 0x40178b
xor ebx, ebx
mov edi, 0x4288e0
cmp dword [0x4288dc], ebx
jbe 0x4015c8
lea eax, [edi + 0x14]
push eax
push esi
call fcn.0040c6fa
add esp, 8
test eax, eax
je 0x4015d6
inc ebx
add edi, 0x424
cmp ebx, dword [0x4288dc]
jb 0x4015a8
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x4015f3
lea ebx, [esi - 4]
mov dword [ebx], eax
jmp 0x401643
test edi, edi
je 0x4015c8
push esi
push str.locate_pythons_for_key:__ls:_already_found_n
call fcn.00401130
mov ebx, dword [ebp - 0x8cc]
add esp, 8
jmp 0x401785
lea eax, [ebp - 0x8d8]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetBinaryTypeW]
test eax, eax
jne 0x401618
push esi
push str.Failure_getting_binary_type:__ls_n
call fcn.00401130
add esp, 8
lea ebx, [esi - 4]
jmp 0x401643
cmp dword [ebp - 0x8d8], 6
lea ebx, [esi - 4]
jne 0x40162c
mov dword [ebx], 0x40
jmp 0x401643
cmp dword [ebp - 0x8d8], 0
jne 0x40163d
mov dword [ebx], 0x20
jmp 0x401643
mov dword [ebx], 0
cmp dword [ebx], 0
jne 0x401667
push dword [ebp - 0x8d8]
push esi
push str.locate_pythons_for_key:__ls:_invalid_binary_type:__X_n
call fcn.00401130
mov ebx, dword [ebp - 0x8cc]
add esp, 0xc
jmp 0x401785
cmp dword [ebp + 0x10], 0
je 0x401694
push 0x5c
push esi
call fcn.00404617
add esp, 8
test eax, eax
je 0x401694
add eax, 2
push eax
lea eax, [esi + 0x208]
push 0x104
push eax
call fcn.0040d05e
add esp, 0xc
push 0x20
push esi
call fcn.00404308
add esp, 8
test eax, eax
je 0x401705
cmp word [esi + 0x208], 0
lea ecx, [esi + 0x208]
jne 0x4016c8
push esi
push 0x104
push ecx
call fcn.0040d05e
add esp, 0xc
lea ecx, [esi + 0x208]
mov edi, esi
lea edx, [edi + 2]
nop dword [eax]
mov ax, word [edi]
add edi, 2
test ax, ax
jne 0x4016d0
sub edi, edx
sar edi, 1
lea eax, [edi + edi]
push eax
lea eax, [ecx - 0x206]
push esi
push eax
call fcn.00406a00
mov eax, dword [ebp - 0x8cc]
mov ecx, 0x22
mov word [esi], cx
add esp, 0xc
mov dword [eax + edi*2 + 0x16], ecx
push dword [ebx]
push esi
push str.locate_pythons_for_key:__ls_is_a__dbit_executable_n
call fcn.00401130
mov eax, dword [ebx]
add esp, 0xc
xor ebx, ebx
mov dword [ebp - 0x8f8], eax
mov edi, 0x4288e0
cmp dword [0x4288dc], ebx
jbe 0x40175d
nop dword [eax]
cmp eax, dword [edi + 0x10]
jne 0x40174e
push edi
push dword [ebp - 0x8cc]
call fcn.0040c6fa
add esp, 8
test eax, eax
je 0x4017aa
mov eax, dword [ebp - 0x8f8]
inc ebx
add edi, 0x424
cmp ebx, dword [0x4288dc]
jb 0x401730
mov eax, dword [0x4288dc]
add esi, 0x424
mov ebx, dword [ebp - 0x8cc]
inc eax
add ebx, 0x424
mov dword [0x4288dc], eax
mov dword [ebp - 0x8cc], ebx
cmp eax, 0x64
jae 0x4017c3
mov edi, dword [ebp - 0x8d0]
mov edx, dword [ebp - 0x8e4]
add edx, 4
mov dword [ebp - 0x8e4], edx
cmp dword [edx], 0
je 0x4017c3
mov ecx, dword [ebp - 0x8c8]
jmp 0x401507
push dword [esi - 4]
mov ebx, dword [ebp - 0x8cc]
push ebx
push str.locate_pythons_for_key:__ls__i:_already_found_n
call fcn.00401130
add esp, 0xc
jmp 0x401785
mov edi, dword [sym.imp.KERNEL32.dll_FormatMessageW]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [ebp - 0x8e8]
inc ecx
cmp dword [0x4288dc], 0x64
mov dword [ebp - 0x8e8], ecx
jb 0x4012d8
jmp 0x401827
cmp eax, 0x103
je 0x401827
push 0
push 0x400
lea ecx, [ebp - 0x8c4]
push ecx
push 0x400
push eax
push 0
push 0x1200
call edi
lea eax, [ebp - 0x8c4]
push eax
lea eax, [ebp - 0x14]
push eax
push str.Cant_enumerate_registry_key_for_version__ls:__ls_n
call fcn.00401130
add esp, 0xc
pop edi
push dword [ebp - 0x8ec]
call esi
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.004036ef
mov esp, ebp
pop ebp
ret