Skip to content

Updating, cleaning, Cordl fixes #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 71 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
4454d89
Update packages
Fernthedev Nov 11, 2024
19925a8
Generate types for Unity 2022, parameters are broken
Fernthedev Nov 11, 2024
07ca277
Make ParameterInfo wrap Il2CppType
Fernthedev Nov 11, 2024
5ddc8e8
Update detour to retour fork
Fernthedev Nov 11, 2024
168aafc
Rename Unity 2022, 2021, 2019 to ilc2pp_v31, 29, 24 respectively
Fernthedev Nov 11, 2024
30fe3cd
Bring back types 2018
Fernthedev Nov 11, 2024
8e3761b
Fmt and clippy
Fernthedev Nov 11, 2024
83b2e14
Add feature
Fernthedev Nov 26, 2024
078c209
Fix version check
Fernthedev Dec 2, 2024
d99d802
Add Void type
Fernthedev Dec 2, 2024
63b28ff
Add types for cordl
Fernthedev Dec 3, 2024
e571825
Generics information
Fernthedev Dec 3, 2024
fad1763
Add ByRef/ByRefMut
Fernthedev Dec 4, 2024
0513125
static il2cpp exception lifetime
Fernthedev Dec 6, 2024
09f2ee6
Add ObjectType trait
Fernthedev Dec 7, 2024
92a6d16
Value type extension helper
Fernthedev Dec 7, 2024
ee46f01
Move value box
Fernthedev Dec 7, 2024
1917569
Implement type for pointer variants
Fernthedev Dec 7, 2024
361d9cd
Implement traits for pointer types
Fernthedev Dec 7, 2024
e6e3588
Add static lifetime
Fernthedev Dec 7, 2024
7e2afd6
ObjectType implementation for pointer type
Fernthedev Dec 7, 2024
2773c1f
Remove conflicting trait impl
Fernthedev Dec 7, 2024
a3ea98a
add type impl for char
Fernthedev Dec 8, 2024
f4cec34
ByRef ignorance
Fernthedev Dec 8, 2024
d7620c5
Increase maximum parameter count
Fernthedev Dec 8, 2024
6750adc
Add Gc/GcType for reference types
Fernthedev Dec 9, 2024
12acbce
Manually implement traits
Fernthedev Dec 9, 2024
da58e65
More GC type shenanigans
Fernthedev Dec 9, 2024
d62dd8c
aDD bounds
Fernthedev Dec 9, 2024
9faeae1
Fix Held type
Fernthedev Dec 9, 2024
95aa66c
Fix generic bounds check for Gc<T>
Fernthedev Dec 9, 2024
e1705dc
Fix generic bounds check in `caller`
Fernthedev Dec 9, 2024
6b96da1
Implement debug for `Gc`
Fernthedev Dec 9, 2024
f72a2d1
Use GC for return types
Fernthedev Dec 10, 2024
798d0b0
Fix type bindings for different platforms
Fernthedev Dec 10, 2024
d257fcc
Add types for GC callee
Fernthedev Dec 10, 2024
d059d1e
Fix GcType argument bound check
Fernthedev Dec 10, 2024
401319b
Add `convert` and documentation
Fernthedev Dec 10, 2024
7569a71
Change `convert` to `cast` and add `downcast`
Fernthedev Dec 10, 2024
7ef98df
Add debug logging information for method lookup
Fernthedev Dec 15, 2024
3decad7
Add const T* for Gc<T>
Fernthedev Jan 2, 2025
62b6103
Add Gc specialization for ObjectType
Fernthedev Jan 5, 2025
42b037c
Add ValueTypePadding type
Fernthedev Jan 5, 2025
1acb1ce
Add traits to `ValueTypePadding`
Fernthedev Jan 5, 2025
17552b1
Update beatsaber-hook
Fernthedev Jan 5, 2025
b0470ef
Change Held for Gc<T>
Fernthedev Jan 5, 2025
f07aa16
Add Send + Sync to Gc<T>
Fernthedev Jan 6, 2025
1092d6d
Refactor error handling for Send/Sync support
Fernthedev Jan 8, 2025
f0e91f7
Implement error for Gc<Exception>
Fernthedev Jan 8, 2025
d98f1d7
Debug log
Fernthedev Jan 13, 2025
5b43181
Pretty print
Fernthedev Jan 13, 2025
b64b203
Debug print lines
Fernthedev Jan 13, 2025
a20a10a
More debug logs
Fernthedev Jan 13, 2025
8d3d014
Improve bindgen
Fernthedev Jan 13, 2025
70804ea
Better intellisense
Fernthedev Jan 13, 2025
202623a
More logging
Fernthedev Jan 13, 2025
d7b20b0
More logging
Fernthedev Jan 13, 2025
25a4bdd
More logs
Fernthedev Jan 13, 2025
9c1b5d1
Fix logging to safely retrieve method parameter types
Fernthedev Jan 13, 2025
7397a98
Log parameter count
Fernthedev Jan 13, 2025
2757b3c
Even more logging
Fernthedev Jan 13, 2025
9d920ea
Log class not found
Fernthedev Jan 13, 2025
85a47e9
Fix typo
Fernthedev Jan 13, 2025
19c792b
Add ByRef wrapper type for representing ref types
Fernthedev Jan 13, 2025
89fbc12
Finish ByRef<T>
Fernthedev Jan 14, 2025
008101e
Fix feature lock
Fernthedev Jan 14, 2025
a2f699d
ByRef is not a ThisArgument
Fernthedev Jan 14, 2025
8abbbb4
Add Returned and ThisArgument
Fernthedev Jan 14, 2025
b8d35ec
Add Type traits to ByRef for callee
Fernthedev Jan 14, 2025
cd491af
Log method name
Fernthedev Jan 14, 2025
0b6fec3
More log information
Fernthedev Jan 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "inline_hook/beatsaber-hook"]
path = inline_hook/beatsaber-hook
url = https://github.com/sc2ad/beatsaber-hook
url = https://github.com/QuestPackageManager/beatsaber-hook.git
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"rust-analyzer.cargo.features": [
"unity2019",
"serde"
"il2cpp_v31",
"serde",
"util",
"cache",
"trace"
],
"rust-analyzer.imports.granularity.group": "module"
}
10 changes: 6 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ tracing = { version = "0.1", features = [
"std",
], default-features = false, optional = true }
tracing-subscriber = { version = "0.3", default-features = false, optional = true }
tracing-error = { version = "0.1", default-features = false, optional = true }
paranoid-android = { version = "0.1.2", optional = true }
thiserror = "1"
tracing-error = { version = "0.2", default-features = false, optional = true }
paranoid-android = { version = "0.2", optional = true }
thiserror = "2"

[target.'cfg(not(target_os = "android"))'.dependencies]
tracing-subscriber = { version = "0.3", features = [
Expand All @@ -34,7 +34,9 @@ tracing-subscriber = { version = "0.3", features = [

[features]
default = ["util", "cache"]
unity2019 = ["libil2cpp/unity2019"]
il2cpp_v31 = ["libil2cpp/il2cpp_v31"]
il2cpp_v29 = ["libil2cpp/il2cpp_v29"]
il2cpp_v24 = ["libil2cpp/il2cpp_v24"]
unity2018 = ["libil2cpp/unity2018"]
util = ["tracing", "tracing-error", "tracing-subscriber", "paranoid-android"]
cache = ["libil2cpp/cache"]
Expand Down
2 changes: 1 addition & 1 deletion inline_hook/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
cfg-if = "1"

[target.'cfg(not(target_os = "android"))'.dependencies]
detour = "0.8"
retour = "0.3"

[build-dependencies]
cc = "1"
2 changes: 1 addition & 1 deletion inline_hook/beatsaber-hook
Submodule beatsaber-hook updated 88 files
+13 −0 .clang-format
+6 −0 .clangd
+102 −68 .github/workflows/build-ndk.yml
+0 −191 .github/workflows/publish.yml
+17 −1 .gitignore
+0 −44 Android.mk
+0 −49 Android.tests.mk
+0 −6 Application.mk
+155 −0 CMakeLists.txt
+5 −3 README.md
+22 −17 build.ps1
+2 −2 copy.ps1
+11 −0 mod.template.json
+43 −10 qpm.json
+144 −0 qpm.shared.json
+18 −29 shared/config/config-utils.hpp
+2 −5 shared/inline-hook/And64InlineHook.cpp
+0 −0 shared/inline-hook/inlineHook.c
+0 −0 shared/inline-hook/relocate.c
+1 −1 shared/rapidjson
+438 −0 shared/utils/accessor-wrapper-types.hpp
+288 −312 shared/utils/alphanum.hpp
+32 −0 shared/utils/base-wrapper-type.hpp
+57 −0 shared/utils/better_span.hpp
+50 −4 shared/utils/byref.hpp
+303 −0 shared/utils/capstone-utils.hpp
+9 −0 shared/utils/early-mod-checks.hpp
+9 −0 shared/utils/enum-type.hpp
+47 −0 shared/utils/enum-wrapper-type.hpp
+47 −4 shared/utils/gc-alloc.hpp
+3 −0 shared/utils/hashing.hpp
+6 −9 shared/utils/hook-tracker.hpp
+311 −13 shared/utils/hooking.hpp
+346 −279 shared/utils/il2cpp-functions.hpp
+279 −103 shared/utils/il2cpp-type-check.hpp
+60 −0 shared/utils/il2cpp-utils-boxing.hpp
+47 −31 shared/utils/il2cpp-utils-classes.hpp
+136 −9 shared/utils/il2cpp-utils-exceptions.hpp
+14 −22 shared/utils/il2cpp-utils-fields.hpp
+908 −558 shared/utils/il2cpp-utils-methods.hpp
+9 −9 shared/utils/il2cpp-utils-properties.hpp
+328 −269 shared/utils/il2cpp-utils.hpp
+0 −380 shared/utils/instruction-parsing.hpp
+12 −388 shared/utils/logging.hpp
+0 −1,086 shared/utils/manual-il2cpp-typedefs.h
+0 −104 shared/utils/mod-checks.hpp
+200 −0 shared/utils/result.hpp
+65 −0 shared/utils/size-concepts.hpp
+207 −0 shared/utils/type-concepts.hpp
+428 −168 shared/utils/typedefs-array.hpp
+3 −39 shared/utils/typedefs-delegate.hpp
+49 −0 shared/utils/typedefs-disposal.hpp
+689 −0 shared/utils/typedefs-list.hpp
+6 −12 shared/utils/typedefs-object.hpp
+338 −0 shared/utils/typedefs-string.hpp
+312 −143 shared/utils/typedefs-wrappers.hpp
+65 −229 shared/utils/typedefs.h
+66 −13 shared/utils/utils-functions.h
+21 −26 shared/utils/utils.h
+9 −0 shared/utils/value-type.hpp
+60 −0 shared/utils/value-wrapper-type.hpp
+16 −14 src/config/config-utils.cpp
+117 −0 src/tests/accessor-wrapper-tests.cpp
+91 −9 src/tests/array-wrapper-tests.cpp
+68 −0 src/tests/better-span-tests.cpp
+13 −3 src/tests/byref-tests.cpp
+1 −0 src/tests/callback-tests.cpp
+37 −0 src/tests/hook-tests.cpp
+57 −0 src/tests/list-wrapper-tests.cpp
+26 −1 src/tests/safeptr-tests.cpp
+121 −0 src/tests/string-tests.cpp
+5 −0 src/tests/test-check.cpp
+146 −0 src/tests/thread-tests.cpp
+96 −0 src/utils/capstone-utils.cpp
+5 −3 src/utils/gc-alloc.cpp
+19 −72 src/utils/hook-tracker.cpp
+814 −934 src/utils/il2cpp-functions.cpp
+78 −17 src/utils/il2cpp-type-check.cpp
+81 −62 src/utils/il2cpp-utils-classes.cpp
+50 −2 src/utils/il2cpp-utils-exceptions.cpp
+8 −8 src/utils/il2cpp-utils-fields.cpp
+391 −94 src/utils/il2cpp-utils-methods.cpp
+8 −7 src/utils/il2cpp-utils-properties.cpp
+76 −103 src/utils/il2cpp-utils.cpp
+0 −1,336 src/utils/instruction-parsing.cpp
+0 −416 src/utils/logging.cpp
+341 −1 src/utils/typedefs-wrapper.cpp
+118 −141 src/utils/utils.cpp
4 changes: 2 additions & 2 deletions inline_hook/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ fn main() {
let target = std::env::var("TARGET").unwrap();
if target == "aarch64-linux-android" {
cc::Build::new()
.file("beatsaber-hook/src/inline-hook/And64InlineHook.cpp")
.file("beatsaber-hook/shared/inline-hook/And64InlineHook.cpp")
.compile("inline_hook");
} else if target == "armv7-linux-androideabi" {
cc::Build::new()
.file("beatsaber-hook/src/inline-hook/inlineHook.c")
.file("beatsaber-hook/shared/inline-hook/inlineHook.c")
.include("beatsaber-hook/shared/inline-hook")
.compile("inline_hook");
}
Expand Down
8 changes: 7 additions & 1 deletion inline_hook/src/detour.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::OnceLock;

use detour::RawDetour;
use retour::RawDetour;

/// A function hook that works across most platforms
#[derive(Debug)]
Expand Down Expand Up @@ -42,3 +42,9 @@ impl Hook {
self.detour.get().map(|d| d.trampoline() as *const ())
}
}

impl Default for Hook {
fn default() -> Self {
Self::new()
}
}
1 change: 0 additions & 1 deletion inline_hook/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(not(target_os = "android"), feature(once_cell))]
#![doc(html_root_url = "https://stackdoubleflow.github.io/quest-hook-rs/inline_hook")]
#![warn(
clippy::all,
Expand Down
3 changes: 3 additions & 0 deletions libil2cpp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
extern/
*.cmake
bindings.rs
11 changes: 8 additions & 3 deletions libil2cpp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ edition = "2021"

[dependencies]
quest_hook_proc_macros = { path = "../proc_macros" }
libloading = "0.7"
thiserror = "1"
libloading = "0.8"
thiserror = "2"
paste = "1"
serde = { version = "1", optional = true }

Expand All @@ -24,7 +24,12 @@ optional = true

[features]
default = []
unity2019 = []
il2cpp_v31 = []
il2cpp_v29 = []
il2cpp_v24 = []
unity2018 = []
cache = []
trace = ["tracing"]

[build-dependencies]
bindgen = "0.71.1"
Loading