Superfly-Inc / ShowKeyPlus

Windows product key finder and validation checker
MIT License
930 stars 162 forks source link

Windows 11 CLI Check #42

Closed JasonChillblast closed 2 years ago

JasonChillblast commented 2 years ago

I'll start by saying thank you for the tool. It is fantastic.

I've been using the CLI version (1.0.7060) for a long time now in WinPE with v1.0.6893 as a 'backup' for when the CLI analysis fails (i.e. when Windows is partially installed).

The new version doesn't have WinPE support yet, however, we are starting to analyse systems with Windows 11 injections and it still shows 'Windows 10' as the injected version on these older builds.

Any chance you can release 1.0.7060 but with Windows 11 awareness? i.e. so the CLI functionality still works

Thanks in advance.

Superfly-Inc commented 2 years ago

Thanx Jason ;)

Sorry for the late reply.

As you may be aware the problem is that Microsoft still has Windows 10 in the Windows 11 registry.

I had look at the old code - it's horrible - I'd rather leave it as is.

Instead you can call the exe with a script and manipulate the output like this:

` $param1=$args[0]

& ".\ShowKeyPlus.exe " $param1

while (-not (Test-Path $param1)) { Start-Sleep 1 }

$Output = (Get-Content -Path $param1)

if ($Output -replace '\s','' -match "Version:22*") { foreach($line in $Output) {

    if ($line -match "Product Name")
    {   
        $newline = $line -replace "Windows 10", "Windows 11"

        $Output -replace $line , $newline | Out-File $param1 -Force

        break
    } 
} 

} ` So instead of calling the exe directly, you pass the parameter to the script like this:

PS C:\Users\Craig\Desktop\ShowKeyPlus_x64> .\ShowKeyPlusCLI.ps1 test.txt

Hopefully MS fixes the registry soon.

Cheers PS: Can't seem to get code blocks working - so excuse the formatting.

JasonChillblast commented 2 years ago

Thanks! A workaround is fine with me.

I'll be sure to give that a go and let you know how I get on 😊