Skip to content

Instantly share code, notes, and snippets.

Created September 5, 2017 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/f2ddfcaca31e3754883027852d61e1b4 to your computer and use it in GitHub Desktop.
Save anonymous/f2ddfcaca31e3754883027852d61e1b4 to your computer and use it in GitHub Desktop.
disables shadows in acs.exe render pipeline for 1.14.4
package main
import (
"crypto/sha256"
"fmt"
"io/ioutil"
)
const VERSION = "0.1"
type BinaryInfo struct {
Version string
FunctionOffset int
Orig string
OrigOpcode byte
Patched string
PatchedOpcode byte
}
func checksum(buf []byte) string {
return fmt.Sprintf("%x", sha256.Sum256(buf))
}
func main() {
info := &BinaryInfo{
Version: "1.14.4",
FunctionOffset: 0x273ee0,
Orig: "c258a4b22b33fed749e530224b95f2aa8adfdeae2a0c8b894062f2be14010153",
OrigOpcode: 0x48,
Patched: "245e935a356cdc2bb99c6ee007ea76b82bfb78709c8db4da8155db2b80d3d9ca",
PatchedOpcode: 0xc3,
}
filename := "acs.exe"
buf, err := ioutil.ReadFile(filename)
if err != nil {
fmt.Println(err)
return
}
fmt.Println("== Assetto Corsa Disable Shadows Patcher", VERSION)
current := checksum(buf)
switch current {
case info.Orig:
fmt.Println(" * found original acs.exe\n * patching now..")
buf[info.FunctionOffset] = info.PatchedOpcode
err = ioutil.WriteFile(filename, buf, 0755)
if err != nil {
fmt.Println(err)
return
}
fmt.Println("= successfully patched")
fmt.Println("\nrestart Assetto Corsa and enjoy VR without flickering shadows")
case info.Patched:
fmt.Println(" * found patched acs.exe\n * reverting back to original..")
buf[info.FunctionOffset] = info.OrigOpcode
err = ioutil.WriteFile(filename, buf, 0755)
if err != nil {
fmt.Println(err)
return
}
fmt.Println("= successfully reverted back to original acs.exe")
fmt.Println("\nrestart Assetto Corsa and Shadows are rendered again")
default:
fmt.Println("acs.exe version not supported (only 1.14.4 supported)")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment