-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
277 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,38 @@ | ||
[package] | ||
name = "autorun" | ||
version = "0.5.1" | ||
version = "0.6.0" | ||
authors = ["Vurv78 <[email protected]>"] | ||
edition = "2018" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[lib] | ||
crate-type = ["dylib"] | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
rglua = { git = "https://github.com/Vurv78/rglua" } | ||
|
||
detour = "0.8.1" | ||
detour = { version = "0.8.1", default-features = false } | ||
|
||
# Global Mutable Variables | ||
once_cell = "1.8.0" | ||
atomic = "0.5.0" | ||
|
||
# Misc | ||
home = "0.5.3" | ||
anyhow = "1.0.42" | ||
anyhow = "1.0.44" | ||
thiserror = "1.0.30" | ||
|
||
# Logging | ||
chrono = "0.4.19" | ||
log = "0.4.14" | ||
simplelog = "0.10.0" | ||
chrono = { version = "0.4.19", optional = true } | ||
log = { version = "0.4.14", optional = true } | ||
simplelog = { version = "0.11.0", optional = true } | ||
|
||
regex = "1.5.4" | ||
regex = "1.5.4" | ||
|
||
[features] | ||
default = ["runner"] | ||
runner = [] | ||
|
||
# Disabled by default for now as this breaks autorun. | ||
logging = ["chrono", "log", "simplelog"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
@echo off | ||
rustup target add i686-pc-windows-msvc | ||
cargo build --target=i686-pc-windows-msvc | ||
move %cd%\target\i686-pc-windows-msvc\debug\Autorun.dll %cd%\gmsv_autorun_win32.dll | ||
set file_name=autorun.dll | ||
|
||
set target=i686-pc-windows-msvc | ||
set target_dir=%cd%\target\%target%\release | ||
set out=%cd%\gmsv_autorun_win32.dll | ||
|
||
rustup target add %target% | ||
cargo build --release --target=%target% | ||
|
||
move %target_dir%\%file_name% %out% | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
@echo off | ||
cargo build | ||
move %cd%\target\debug\Autorun.dll %cd%\gmsv_autorun_win64.dll | ||
set file_name=autorun.dll | ||
|
||
set target=x86_64-pc-windows-msvc | ||
set target_dir=%cd%\target\%target%\release | ||
set out=%cd%\gmsv_autorun_win64.dll | ||
|
||
rustup target add %target% | ||
cargo build --release --target=%target% | ||
|
||
move %target_dir%\%file_name% %out% | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#[macro_export] | ||
macro_rules! lazy_detour { | ||
// Lazy Path | ||
( $vis:vis static $name:ident : $t:ty = ($target:expr, $tour:expr) ; $($rest:tt)* ) => { | ||
$vis static $name: once_cell::sync::Lazy< detour::GenericDetour< $t > > = once_cell::sync::Lazy::new(|| unsafe { | ||
match detour::GenericDetour::new( $target, $tour ) { | ||
Ok(b) => { | ||
b.enable().expect( concat!("Failed to enable detour '", stringify!($name), "'") ); | ||
b | ||
}, | ||
Err(why) => panic!( concat!("Failed to create hook '", stringify!($name), "' {}"), why) | ||
} | ||
}); | ||
lazy_detour!( $($rest)* ); | ||
}; | ||
// OnceCell Path | ||
( $vis:vis static $name:ident : $t:ty ; $($rest:tt)* ) => { | ||
$vis static $name: once_cell::sync::OnceCell<detour::GenericDetour<$t>> = once_cell::sync::OnceCell::new(); | ||
lazy_detour!( $($rest)* ); | ||
}; | ||
() => (); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.