Skip to content

Commit

Permalink
Testing MacOS support for EU4
Browse files Browse the repository at this point in the history
  • Loading branch information
IlliaYalovoi committed Jul 15, 2023
1 parent cbf14db commit 64b44d7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
all: build-windows build-linux
all: build-windows build-linux build-macos-amd64 build-macos-arm64

build-windows:
env GOOS=windows GOARCH=amd64 go build -o ./build/universal-checksum-patcher-windows.exe *.go

build-linux:
env GOOS=linux GOARCH=amd64 go build -o ./build/universal-checksum-patcher-linux *.go
env GOOS=linux GOARCH=amd64 go build -o ./build/universal-checksum-patcher-linux *.go

build-macos-amd64:
env GOOS=darwin GOARCH=amd64 go build -o ./build/universal-checksum-patcher-macos-amd64 *.go

build-macos-arm64:
env GOOS=darwin GOARCH=arm64 go build -o ./build/universal-checksum-patcher-macos-arm64 *.go
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Conrats, you done! In case you see unsupported version error most likely Paradox
# Supported games and platforms
| | Windows | Linux | MacOS |
| ---| --- | ---| --- |
| Europa Universalis IV | Yes :heavy_check_mark: | Yes :heavy_check_mark: | No :x: |
| Europa Universalis IV | Yes :heavy_check_mark: | Yes :heavy_check_mark: | Maybe |
| Hearts of Iron IV | Yes :heavy_check_mark: | No :x: | No :x: |

MacOS will be supported, if someone provide me executable files for analysis.
11 changes: 11 additions & 0 deletions patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,15 @@ func applyPatch(test bool, originalFileName, OS string) error {
var hexWantedWindows []string
var hexExistsLinux []string
var hexWantedLinux []string
var hexExistsDarwin []string
var hexWantedDarwin []string
// EU4
hexExistsEU4Windows := []string{"48", "8D", "0D", "??", "??", "??", "01", "E8", "??", "??", "??", "01", "85", "C0", "0F", "94", "C3", "E8"}
hexWantedEU4Windows := []string{"48", "8D", "0D", "??", "??", "??", "01", "E8", "??", "??", "??", "01", "31", "C0", "0F", "94", "C3", "E8"}
hexExistsEU4Linux := []string{"E8", "65", "95", "E5", "FF", "89", "C3", "E8", "38", "08", "EC", "FF", "31", "F6", "85", "DB", "40", "0F", "94", "C6", "48", "89", "C7"}
hexWantedEU4Linux := []string{"E8", "65", "95", "E5", "FF", "89", "C3", "E8", "38", "08", "EC", "FF", "31", "F6", "31", "DB", "40", "0F", "94", "C6", "48", "89", "C7"}
hexExistsEU4Darwin := []string{"E8", "7A", "C5", "76", "01", "89", "01", "89", "C3", "E8", "93", "A6", "EC", "FF", "31", "F6", "85", "DB", "40", "0F", "94", "C6", "48", "89", "C7"}
hexWantedEU4Darwin := []string{"E8", "7A", "C5", "76", "01", "89", "01", "89", "C3", "E8", "93", "A6", "EC", "FF", "31", "F6", "31", "DB", "40", "0F", "94", "C6", "48", "89", "C7"}
// HOI4
hexExistsHOI4Windows := []string{"48", "8D", "0D", "77", "B6", "C9", "01", "E8", "CA", "86", "B3", "01", "85", "C0", "0F", "94", "C3", "E8", "90"}
hexWantedHOI4Windows := []string{"48", "8D", "0D", "77", "B6", "C9", "01", "E8", "CA", "86", "B3", "01", "31", "C0", "0F", "94", "C3", "E8", "90"}
Expand All @@ -78,6 +82,9 @@ func applyPatch(test bool, originalFileName, OS string) error {

hexExistsLinux = hexExistsEU4Linux
hexWantedLinux = hexWantedEU4Linux

hexExistsDarwin = hexExistsEU4Darwin
hexWantedDarwin = hexWantedEU4Darwin
} else if strings.Contains(originalFileName, "hoi4") {
if OS == "linux" {

Expand All @@ -103,6 +110,10 @@ func applyPatch(test bool, originalFileName, OS string) error {
fileExtension = ""
hexExists = hexExistsLinux
hexWanted = hexWantedLinux
case "darwin":
fileExtension = ""
hexExists = hexExistsDarwin
hexWanted = hexWantedDarwin
default:
fileExtension = ""
return fmt.Errorf("this OS (%s) is not supported", OS)
Expand Down

0 comments on commit 64b44d7

Please sign in to comment.