diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ecda53..aebe7e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ +### 1.2.0 - June 18, 2023 + +- add support for GTA The Trilogy - The Definitive Edition v1.0.17.39540 (Epic Games Store) +- fix an issue when constructor commands for derived classes returned incorrect values (`Heli.Create`, `Boat.Create`, etc.) +- fix an issue when the library could not read the host version if the path to the executable contained non-ASCII characters +- improve log for objects: now it gets serialized with all properties, not just `[object Object]` + +**INSTALLER** + +- update references to Ultimate ASI Loader files to match their new names on GitHub +- append `Gameface\Binary\Win64` if a root directory of GTA The Trilogy - The Definitive Edition is selected + +**SDK AND PLUGINS** + +- Events 1.1: add support for latest version of GTA The Trilogy - The Definitive Edition (v1.0.17.39540), all launchers + +**BREAKING CHANGES** + +- bumped minimum required versions of [command definitions](https://re.cleo.li/docs/en/definitions.html) + ### 1.1.3 - February 21, 2023 - add support for GTA The Trilogy - The Definitive Edition v1.0.17.39540 (Rockstar Games Launcher) diff --git a/docs/en/definitions.md b/docs/en/definitions.md index 3a726b5..62e384d 100644 --- a/docs/en/definitions.md +++ b/docs/en/definitions.md @@ -6,15 +6,15 @@ At start CLEO validates that a definition file is present and correct and if not | Game | File | Minimum Required Version | | ----------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------ | -| GTA III, re3 | [gta3.json](https://github.com/sannybuilder/library/blob/master/gta3/gta3.json) | `0.262` | -| GTA VC, reVC | [vc.json](https://github.com/sannybuilder/library/blob/master/vc/vc.json) | `0.268` | -| GTA San Andreas (Classic) 1.0 | [sa.json](https://github.com/sannybuilder/library/blob/master/sa/sa.json) | `0.313` | +| GTA III, re3 | [gta3.json](https://github.com/sannybuilder/library/blob/master/gta3/gta3.json) | `0.265` | +| GTA VC, reVC | [vc.json](https://github.com/sannybuilder/library/blob/master/vc/vc.json) | `0.271` | +| GTA San Andreas (Classic) 1.0 | [sa.json](https://github.com/sannybuilder/library/blob/master/sa/sa.json) | `0.316` | | GTA III: The Definitive Edition | [gta3_unreal.json](https://github.com/sannybuilder/library/blob/master/gta3_unreal/gta3_unreal.json) | `0.227` | | Vice City: The Definitive Edition | [vc_unreal.json](https://github.com/sannybuilder/library/blob/master/vc_unreal/vc_unreal.json) | `0.233` | | San Andreas: The Definitive Edition | [sa_unreal.json](https://github.com/sannybuilder/library/blob/master/sa_unreal/sa_unreal.json) | `0.262` | | GTA IV | [gta_iv.json](https://github.com/sannybuilder/library/blob/master/gta_iv/gta_iv.json) | `0.78` | -| Unknown (32-bit) | [unknown_x86.json](https://github.com/sannybuilder/library/blob/master/unknown_x86/unknown_x86.json) | `0.223` | -| Unknown (64-bit) | [unknown_x64.json](https://github.com/sannybuilder/library/blob/master/unknown_x64/unknown_x64.json) | `0.226` | +| Unknown (32-bit) | [unknown_x86.json](https://github.com/sannybuilder/library/blob/master/unknown_x86/unknown_x86.json) | `0.225` | +| Unknown (64-bit) | [unknown_x64.json](https://github.com/sannybuilder/library/blob/master/unknown_x64/unknown_x64.json) | `0.228` | | Bully: Scholarship Edition | [bully.json](https://github.com/sannybuilder/library/blob/master/bully/bully.json) | `0.41` | CLEO Redux uses compound definitions (a combination of the primary JSON file for the current game and a JSON file for the Unknown host). It lets SDK commands to work in JS scripts regardless of them being defined or not in the primary JSON file. You should notice that during updates CLEO downloads both `.json` and `unknown.json` as well as the accompanying `enums.js` files. It should not affect any existing scripts. diff --git a/docs/en/events.md b/docs/en/events.md index acc70fc..6304ca4 100644 --- a/docs/en/events.md +++ b/docs/en/events.md @@ -51,7 +51,7 @@ cancel(); // the event callback won't be called anymore Triggered after the game creates a new vehicle of any type in the world. An event's `data` object contains the address of the vehicle structure. -Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)` +Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.17.39540)`, `GTA VC: DE (1.0.17.39540)`, `GTA SA: DE (1.0.17.39540)` ```ts interface OnVehicleCreateEvent { @@ -74,7 +74,7 @@ addEventListener("OnVehicleCreate", (event: OnVehicleCreateEvent) => { Triggered after the game creates a new ped of any type in the world. An event's `data` object contains the address of the ped structure. -Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)` +Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.17.39540)`, `GTA VC: DE (1.0.17.39540)`, `GTA SA: DE (1.0.17.39540)` ```ts interface OnPedCreateEvent { @@ -97,7 +97,7 @@ addEventListener("OnPedCreate", (event: OnPedCreateEvent) => { Triggered after the game creates a new object of any type in the world. An event's `data` object contains the address of the object structure. -Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)` +Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.17.39540)`, `GTA VC: DE (1.0.17.39540)`, `GTA SA: DE (1.0.17.39540)` ```ts interface OnObjectCreateEvent { @@ -120,7 +120,7 @@ addEventListener("OnObjectCreate", (event: OnObjectCreateEvent) => { Triggered _before_ the game deletes a vehicle from the world. An event's `data` object contains the address of the vehicle structure. -Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)` +Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.17.39540)`, `GTA VC: DE (1.0.17.39540)`, `GTA SA: DE (1.0.17.39540)` ```ts interface OnVehicleDeleteEvent { @@ -143,7 +143,7 @@ addEventListener("OnVehicleDelete", (event: OnVehicleDeleteEvent) => { Triggered _before_ the game deletes a ped from the world. An event's `data` object contains the address of the ped structure. -Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)` +Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.17.39540)`, `GTA VC: DE (1.0.17.39540)`, `GTA SA: DE (1.0.17.39540)` ```ts interface OnPedDeleteEvent { @@ -166,7 +166,7 @@ addEventListener("OnPedDelete", (event: OnPedDeleteEvent) => { Triggered _before_ the game deletes an object from the world. An event's `data` object contains the address of the object structure. -Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)` +Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.17.39540)`, `GTA VC: DE (1.0.17.39540)`, `GTA SA: DE (1.0.17.39540)` ```ts interface OnObjectDeleteEvent { diff --git a/installer/cleo_redux.iss b/installer/cleo_redux.iss index 83a42be..2116580 100644 --- a/installer/cleo_redux.iss +++ b/installer/cleo_redux.iss @@ -1,5 +1,5 @@ #define AppName "CLEO Redux" -#define AppVersion "1.1.3" +#define AppVersion "1.2.0" #define AppPublisher "Seemann" #define AppURL "https://re.cleo.li" #define SourceDir "..\" @@ -63,7 +63,7 @@ Name: "plugins/imgui/SilentPatch"; Description: "SilentPatch - needed for the mo Name: "plugins/memops"; Description: "MemoryOperations (by ThirteenAG)"; Types: full Name: "plugins/input"; Description: "Input 1.3"; Types: full Name: "plugins/frontend"; Description: "Frontend 1.1"; Types: full -Name: "plugins/events"; Description: "Events 1.0"; Types: full +Name: "plugins/events"; Description: "Events 1.1"; Types: full Name: "loaders"; Description: "File Loaders"; Types: full Name: "loaders/text"; Description: "*.txt, *.text (Text files)"; Types: full Name: "loaders/ide"; Description: "*.ide (Item Definition files)"; Types: full @@ -531,14 +531,15 @@ begin WizardForm.ComponentsList.Checked[14] := False; end; - // ImGuiRedux is bugged on re3 - if isRe then + // ImGuiRedux is bugged on re3/DE + if isRe or Is3Master() or IsVCMaster() or IsSAMaster() then begin // ImGuiRedux WizardForm.ComponentsList.Checked[5] := False; // D3 Wrapper WizardForm.ComponentsList.Checked[6] := False; + WizardForm.ComponentsList.ItemEnabled[6] := False; end; // MSS lib is an ASI loader @@ -569,6 +570,11 @@ begin if (CurPageID = wpSelectDir) and (WizardDirValue <> '') then begin + if ((DirExists(WizardDirValue + '\Gameface\Binaries\Win64')) and ( + FileExists(WizardDirValue + '\PlayGTA3.exe') or + FileExists(WizardDirValue + '\PlayGTAViceCity.exe') or + FileExists(WizardDirValue + '\PlayGTASanAndreas.exe'))) then + WizardForm.DirEdit.Text := WizardDirValue + '\Gameface\Binaries\Win64'; FGameId := IdentifyGame(WizardDirValue); end; @@ -594,14 +600,14 @@ begin begin if IsX64() then if isRe then - DownloadPage.Add('{#UAL64}/d3d9.zip', 'd3d9.zip', '') + DownloadPage.Add('{#UAL64}/d3d9-x64.zip', 'd3d9.zip', '') else - DownloadPage.Add('{#UAL64}/version.zip', 'version.zip', ''); + DownloadPage.Add('{#UAL64}/version-x64.zip', 'version.zip', ''); if IsX86() then if IsGta3 or IsVC or IsIV then - DownloadPage.Add('{#UAL32}/dinput8.zip', 'dinput8.zip', '') + DownloadPage.Add('{#UAL32}/dinput8-Win32.zip', 'dinput8.zip', '') else - DownloadPage.Add('{#UAL32}/vorbisFile.zip', 'vorbisFile.zip', ''); + DownloadPage.Add('{#UAL32}/vorbisFile-Win32.zip', 'vorbisFile.zip', ''); end; if FDlMemOpsPlugin then diff --git a/plugins/Events/Cargo.lock b/plugins/Events/Cargo.lock index 7c9afa2..60dba6a 100644 --- a/plugins/Events/Cargo.lock +++ b/plugins/Events/Cargo.lock @@ -42,34 +42,17 @@ dependencies = [ "syn", ] -[[package]] -name = "detour" -version = "0.9.0" -source = "git+https://github.com/x87/detour-rs.git#b0e6366661a6660aa99c4b0b9028d14b27984d44" -dependencies = [ - "cfg-if", - "generic-array", - "lazy_static", - "libc", - "libudis86-sys", - "mmap-fixed-fixed", - "region", - "slice-pool", -] - [[package]] name = "events" -version = "1.0.0" +version = "1.1.0" dependencies = [ "cleo_redux_sdk", "ctor", - "detour", "lazy_static", "null_fn", + "retour", "serde", "serde_json", - "version_info", - "winapi", ] [[package]] @@ -186,6 +169,22 @@ dependencies = [ "winapi", ] +[[package]] +name = "retour" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a83f9f8fa2d02a11cb18d157ca898f1d8a197c19b084ef8d0a8da256a5c58935" +dependencies = [ + "cfg-if", + "generic-array", + "lazy_static", + "libc", + "libudis86-sys", + "mmap-fixed-fixed", + "region", + "slice-pool", +] + [[package]] name = "ryu" version = "1.0.12" @@ -259,15 +258,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "version_info" -version = "0.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb7678f85a3b77528a842d4d47b289bc2867db8e31c79c672641c741ce9eddd" -dependencies = [ - "winapi", -] - [[package]] name = "winapi" version = "0.3.9" diff --git a/plugins/Events/Cargo.toml b/plugins/Events/Cargo.toml index 6a89732..f3c4bdd 100644 --- a/plugins/Events/Cargo.toml +++ b/plugins/Events/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "events" -version = "1.0.0" +version = "1.1.0" edition = "2021" authors = ["Seemann "] @@ -12,10 +12,7 @@ crate-type = ["cdylib"] cleo_redux_sdk = "*" ctor = "0.1.21" null_fn = "0.1.1" -detour = {git = "https://github.com/x87/detour-rs.git"} +retour = "0.1.0" serde = {version = "1.0.144", features = ["derive"]} serde_json = {version = "1.0.85", features = ["preserve_order"]} -lazy_static = "1.4.0" -version_info = "*" -[target.'cfg(windows)'.dependencies] -winapi = { version = "0.3", features = ["libloaderapi"] } \ No newline at end of file +lazy_static = "1.4.0" \ No newline at end of file diff --git a/plugins/Events/src/gta_classic/cworld_add.rs b/plugins/Events/src/gta_classic/cworld_add.rs index 7f29ac2..05c45f7 100644 --- a/plugins/Events/src/gta_classic/cworld_add.rs +++ b/plugins/Events/src/gta_classic/cworld_add.rs @@ -15,26 +15,20 @@ static mut CWORLD_ADD: extern "C" fn(*const u8) = std::ptr::null(); lazy_static! { static ref CWORLD_ADD_ADDR: Option = { - use crate::utils::{get_exe_version, IMAGE_BASE}; use cleo_redux_sdk::HostId; match cleo_redux_sdk::get_host_id() { - HostId::RE3 | HostId::REVC => match cleo_redux_sdk::get_symbol_address("CWorld::Add") { + HostId::RE3 + | HostId::REVC + | HostId::GTA3 + | HostId::VC + | HostId::SA + | HostId::GTA3_UNREAL + | HostId::VC_UNREAL + | HostId::SA_UNREAL => match cleo_redux_sdk::get_symbol_address("CWorld::Add") { 0 => None, x => Some(x), }, - HostId::GTA3 => Some(0x004AE930), - HostId::VC => Some(0x004DB3F0), - HostId::SA => Some(0x00563220), - HostId::GTA3_UNREAL if get_exe_version("LibertyCity.exe") == Some((1, 0, 8, 11827)) => { - Some(*IMAGE_BASE + 0xF34DB0) - } - HostId::VC_UNREAL if get_exe_version("ViceCity.exe") == Some((1, 0, 8, 11827)) => { - Some(*IMAGE_BASE + 0xF569F0) - } - HostId::SA_UNREAL if get_exe_version("SanAndreas.exe") == Some((1, 0, 8, 11827)) => { - Some(*IMAGE_BASE + 0x100AF70) - } _ => None, } }; diff --git a/plugins/Events/src/gta_classic/cworld_remove.rs b/plugins/Events/src/gta_classic/cworld_remove.rs index a7991ed..9267c33 100644 --- a/plugins/Events/src/gta_classic/cworld_remove.rs +++ b/plugins/Events/src/gta_classic/cworld_remove.rs @@ -16,28 +16,20 @@ static mut CWORLD_REMOVE: extern "C" fn(*const u8) = std::ptr::null(); lazy_static! { static ref CWORLD_REMOVE_ADDR: Option = { - use crate::utils::{get_exe_version, IMAGE_BASE}; use cleo_redux_sdk::HostId; match cleo_redux_sdk::get_host_id() { - HostId::RE3 | HostId::REVC => { - match cleo_redux_sdk::get_symbol_address("CWorld::Remove") { - 0 => None, - x => Some(x), - } - } - HostId::GTA3 => Some(0x004AE9D0), - HostId::VC => Some(0x004DB310), - HostId::SA => Some(0x00563280), - HostId::GTA3_UNREAL if get_exe_version("LibertyCity.exe") == Some((1, 0, 8, 11827)) => { - Some(*IMAGE_BASE + 0xF34E90) - } - HostId::VC_UNREAL if get_exe_version("ViceCity.exe") == Some((1, 0, 8, 11827)) => { - Some(*IMAGE_BASE + 0xF56AE0) - } - HostId::SA_UNREAL if get_exe_version("SanAndreas.exe") == Some((1, 0, 8, 11827)) => { - Some(*IMAGE_BASE + 0x100AFB0) - } + HostId::RE3 + | HostId::REVC + | HostId::GTA3 + | HostId::VC + | HostId::SA + | HostId::GTA3_UNREAL + | HostId::VC_UNREAL + | HostId::SA_UNREAL => match cleo_redux_sdk::get_symbol_address("CWorld::Remove") { + 0 => None, + x => Some(x), + }, _ => None, } }; diff --git a/plugins/Events/src/lib.rs b/plugins/Events/src/lib.rs index e03a093..d2c6c6a 100644 --- a/plugins/Events/src/lib.rs +++ b/plugins/Events/src/lib.rs @@ -11,6 +11,6 @@ extern "C" {} #[ctor] fn init() { - cleo_redux_sdk::log("Events plugin 1.0"); + cleo_redux_sdk::log("Events plugin 1.1"); gta_classic::register_hooks(); } diff --git a/plugins/Events/src/utils.rs b/plugins/Events/src/utils.rs index ed2f065..302a633 100644 --- a/plugins/Events/src/utils.rs +++ b/plugins/Events/src/utils.rs @@ -1,20 +1,11 @@ -use version_info; -lazy_static! { - pub static ref IMAGE_BASE: usize = - unsafe { winapi::um::libloaderapi::GetModuleHandleA(std::ptr::null()) as usize }; -} #[macro_export] macro_rules! detour { ( $addr: expr => $cb: expr ) => {{ - let hook = detour::RawDetour::new($addr as *const (), $cb as *const ()).unwrap(); + let hook = retour::RawDetour::new($addr as *const (), $cb as *const ()).unwrap(); hook.enable().unwrap(); let result = std::mem::transmute(hook.trampoline()); std::mem::forget(hook); result }}; } - -pub fn get_exe_version(exe_name: &str) -> Option<(u32, u32, u32, u32)> { - version_info::get_file_version(exe_name) -} diff --git a/website/index.html b/website/index.html index 7834b7b..ffa82ab 100644 --- a/website/index.html +++ b/website/index.html @@ -123,7 +123,7 @@

data-translate="download" >Download - v1.1.3 | February 21, 2023 + v1.2.0 | June 19, 2023