Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #17 from DrDonk/dev
Browse files Browse the repository at this point in the history
4.2.0 Release
  • Loading branch information
DrDonk authored May 13, 2022
2 parents 75326f9 + 8ded116 commit 186663a
Show file tree
Hide file tree
Showing 37 changed files with 770 additions and 300 deletions.
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
/tests/

/darwin/
/linux/patchgos
/linux/patchsmc
/linux/patchvmkctl
/windows/patchgos.exe
/windows/patchsmc.exe
/windows/patchvmkctl.exe
/dist/linux/patchgos
/dist/linux/patchsmc
/dist/linux/patchvmkctl
/dist/windows/patchgos.exe
/dist/windows/patchsmc.exe
/dist/windows/patchvmkctl.exe
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

All dates are UK format.

## 13/05/22 4.2.0
_drdonk:_
* Split unlocker.exe into 2 new files unlock.exe and relock.exe so can be directly executed on Windows without
having to pass a parameter to install or uninstall
* Added Windows manifest to allow the executables to directly run as Administrator without using re-spawn code
* Minimize false AV detection especially Windows Defender
* Added a new command to check the status of the patching called check.exe
* Fix to restarting vmware-tray.exe on Windows which had the wrong working directory

## 03/03/22 4.1.3
_drdonk:_
* Update VMware Tools to version 12.0.0
Expand Down
Binary file added CHANGELOG.pdf
Binary file not shown.
42 changes: 19 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
**IMPORTANT**
---

**False positive from anti-virus software**
**False positive from antivirus software**

Some Windows AV programs mistakenly flag the unlocker as having a virus. This is a false positive and it is mainly seen with Windows Defender. The Go Langauge web site documents the problem.
Some Windows antivirus programs mistakenly flag the unlocker as having a virus. This is a false positive
and it is mainly seen with Windows Defender. The Go Langauge website documents the problem.

https://go.dev/doc/faq#virus

Always download from the releases section here, and if you have any doubts you can compile the source code and will see the false positive from Defender.
If you have any doubts you can compile the source code yourself.

1. Use a release from the Releases section of this GitHub repository. https://github.com/DrDonk/unlocker/releases
2. Always uninstall the previous version of the Unlocker before using a new version or
Expand Down Expand Up @@ -48,29 +49,24 @@ or any other features that are not already in the VMware compiled code.
A patched macSO kernel must be used to run on AMD systems.

## 2. Prerequisites
The code has no pre-requisites and should run directly from the download. The code is written in Go with some
utility Bash and Powershell files.
The code is written in Go and has no pre-requisites and should run directly from the download.

## 3. Windows
On Windows you will need to either run a Command or Powershell prompt as Administrator and navigate to the folder
where the golocker has been unpacked and run:

```
cd .\windows
.\unlocker.exe <install | uninstall>
install - install patches
uninstall - uninstall patches
```
On Windows you can double-click the executables to launch them from the "windows" folder. You may be prompted to run
with Administrator rights which are required to patch VMware.

* unlock.exe - apply patches to VMware
* relock.exe - remove patches from VMware
* check.exe - check the patch status of VMware

## 4. Linux
On Linux you will need to be either root or use sudo to run the scripts in the terminal and navigate to the folder
where the golocker has been unpacked and run:

```
cd ./linux
./unlocker <install | uninstall>
install - install patches
uninstall - uninstall patches
```
On Linux you will need to be either root or use sudo to run the scripts in the terminal.

Navigate to the folder where the unlocker has been unpacked, and run the required command from the "linux" folder.

* unlock - apply patches to VMware
* relock - remove patches from VMware
* check - check the patch status of your VMware installation

## 5. VMware Downloads
These URLs will link to the latest versions of VMware's hosted products:
Expand Down
Binary file added README.pdf
Binary file not shown.
Binary file added TROUBLESHOOTING.pdf
Binary file not shown.
42 changes: 35 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,38 @@
#!/usr/bin/env bash
#!/usr/bin/env zsh
#set -x

echo Building release executables
if ! [ $# -eq 1 ] ; then
echo "Product version not found" >&2
exit 1
fi

pushd ./commands/check
echo "Building check"
go-winres make --arch amd64 --product-version $1 --file-version $1
env GOOS=windows GOARCH=amd64 go build -o ../../dist/windows
env GOOS=linux GOARCH=amd64 go build -o ../../dist/linux
rm rsrc_windows_amd64.syso
popd

pushd ./commands/relock
echo "Building relock"
go-winres make --arch amd64 --product-version $1 --file-version $1
env GOOS=windows GOARCH=amd64 go build -o ../../dist/windows
env GOOS=linux GOARCH=amd64 go build -o ../../dist/linux
rm rsrc_windows_amd64.syso
popd

pushd ./commands/unlock
echo "Building unlock"
go-winres make --arch amd64 --product-version $1 --file-version $1
env GOOS=windows GOARCH=amd64 go build -o ../../dist/windows
env GOOS=linux GOARCH=amd64 go build -o ../../dist/linux
rm rsrc_windows_amd64.syso
popd

echo Building Windows executables...
env GOOS=windows GOARCH=amd64 go build -o ./windows/dumpsmc.exe ./tools/dumpsmc.go
env GOOS=windows GOARCH=amd64 go build -o ./windows/unlocker.exe ./command/unlocker.go

echo Building Linux executables...
env GOOS=linux GOARCH=amd64 go build -o ./linux/dumpsmc ./tools/dumpsmc.go
env GOOS=linux GOARCH=amd64 go build -o ./linux/unlocker ./command/unlocker.go
cp -v LICENSE ./dist
cp -v *.md ./dist
cp -v *.pdf ./dist
cp -vr ./iso ./dist
9 changes: 9 additions & 0 deletions clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env zsh
#set -x
echo Clean distribution
rm -vfr ./dist
mkdir -vp ./dist/iso
mkdir -vp ./dist/linux
mkdir -vp ./dist/windows

rm -vfr ./commands/rsrc_windows_amd64.syso
165 changes: 0 additions & 165 deletions command/unlocker.go

This file was deleted.

61 changes: 61 additions & 0 deletions commands/check/check.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
//
// SPDX-FileCopyrightText: © 2014-2022 David Parsons
// SPDX-License-Identifier: MIT

package main

import (
"fmt"
"github.com/drdonk/golocker/vmwpatch"
"os"
)

func waitExit() {
quiet := os.Getenv("UNLOCK_QUIET")
if quiet != "1" {
fmt.Println()
fmt.Println("\nPress Enter key to continue...")

_, _ = fmt.Scanln()
}
}

func main() {
// Titles
fmt.Printf("Checker %s for VMware Workstation/Player\n", vmwpatch.VERSION)
fmt.Println("============================================")
fmt.Println(vmwpatch.COPYRIGHT)
fmt.Println()

// Check admin rights
if !vmwpatch.IsAdmin() {
fmt.Println("Re-run with admin/root privileges")
waitExit()
return
}

// Get VMware product details from registry and file system
v := vmwpatch.VMWInfo()
if v.ProductVersion != "" {
fmt.Println("VMware is installed at: ", v.InstallDir)
fmt.Println("VMware version: ", v.BuildNumber)
} else {
fmt.Println("VMware is not installed on this computer")
waitExit()
return
}
patchFlag, patchStatus, hash256 := vmwpatch.IsSMCPatched(v.PathVMXDefault)
fmt.Printf("Patch Status: %s (%d)\nSHA256: %s\n", patchStatus, patchFlag, hash256)

patchFlag, patchStatus, hash256 = vmwpatch.IsSMCPatched(v.PathVMXDebug)
fmt.Printf("Patch Status: %s (%d)\nSHA256: %s\n", patchStatus, patchFlag, hash256)

patchFlag, patchStatus, hash256 = vmwpatch.IsSMCPatched(v.PathVMXStats)
fmt.Printf("Patch Status: %s (%d)\nSHA256: %s\n", patchStatus, patchFlag, hash256)

patchFlag, patchStatus, hash256 = vmwpatch.IsGOSPatched(v.PathVMwareBase)
fmt.Printf("Patch Status: %s (%d)\nSHA256: %s\n", patchStatus, patchFlag, hash256)

waitExit()
return
}
Loading

0 comments on commit 186663a

Please sign in to comment.