Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Commit

Permalink
Add program and README
Browse files Browse the repository at this point in the history
  • Loading branch information
klauspost committed May 29, 2020
1 parent d7e2d4a commit b902c09
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 1 deletion.
63 changes: 62 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,63 @@
# ryzen-master-vbs-patch
AMD Ryzen Master VBS patcher

AMD Ryzen Master VBS patcher allows AMD Ryzen Master to run while Virtualization is enabled.


Thanks to [@TOM_RUS](https://twitter.com/TOM_RUS/status/1204867886197755904) for finding this.

This patch disables the VBS check on startup. It does NOT fix what might be the cause of this being disabled.

This MAY break functionality and it MAY stop working on future versions.

# Running

Various parts of this will require administrator access.

* Download and unzip binary from [releases](https://github.com/klauspost/ryzen-master-vbs-patch/releases).
* Copy `AMD Ryzen Master.exe` from `c:\Program Files\AMD\RyzenMaster\bin\` or where your software is installed.
* In Explorer Drag & Drop `AMD Ryzen Master.exe` in your new location on to `ryzen-master-vbs-patch.exe`
* If successful `patched-AMD Ryzen Master.exe` should now be created.
* Copy this back to the `RyzenMaster` folder.
* Rename your existing `AMD Ryzen Master.exe` to `AMD Ryzen Master BACKUP.exe` or similar.
* Rename `patched-AMD Ryzen Master.exe` to `AMD Ryzen Master.exe`.

From the commandline, the syntax is:

```
Usage: ryzen-master-vbs-patch [-p=patched] "AMD Ryzen Master.exe"
-p string
Specify prefix for output file. Set to "", overwrite input. (default "patched-")
```

# Building

Requires Go SDK installed.

`go get github.com/klauspost/ryzen-master-vbs-patch`
`go install github.com/klauspost/ryzen-master-vbs-patch`

# License

```
The MIT License (MIT)
Copyright (c) 2020 Klaus Post
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```
85 changes: 85 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
package main

import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
)

func init() {
flag.Usage = func() {
fmt.Println("Usage: ryzen-master-vbs-patch [-p=patched] \"AMD Ryzen Master.exe\"")
flag.PrintDefaults()
}
}

var prefix = flag.String("p", "patched-", `Specify prefix for output file. Set to "", overwrite input.`)

func main() {
flag.Parse()
args := flag.Args()
if len(args) == 0 {
flag.Usage()
return
}

for _, f := range args {
dir, file := filepath.Split(f)
err := patch(filepath.Join(dir, file), filepath.Join(dir, *prefix+file))
if err != nil {
fmt.Println(err)
os.Exit(1)
}
}
}

var search = []byte{0x44, 0x39, 0x6D, 0xA8, 0x0F, 0x84, 0xF7}
var replace = []byte{0x44, 0x39, 0x6D, 0xA8, 0x90, 0xe9, 0xf7}

func patch(in string, out string) error {
fmt.Println("Patching", in)
b, err := ioutil.ReadFile(in)
if err != nil {
return err
}
c := bytes.Count(b, search)
fmt.Println("Matching byte sequences:", c, "(should be 1)")
if c != 1 {
fmt.Println("Skipping file...")
return nil
}
b = bytes.Replace(b, search, replace, -1)
fmt.Println("Writing to", out)
err = ioutil.WriteFile(out, b, 0)
if err != nil {
return err
}
return nil
}

/*
The MIT License (MIT)
Copyright (c) 2020 Klaus Post
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

0 comments on commit b902c09

Please sign in to comment.