Skip to content

Commit 3feb7a3

Browse files
committed
Upgrade jni dependency
Update README
1 parent b3ec954 commit 3feb7a3

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ name = "classloader"
1010
crate-type = ["cdylib"]
1111

1212
[dependencies]
13-
jni = "0.20.0"
13+
jni = "0.21.1"
1414
retour = { version = "0.3.1", features = ["static-detour"] }
1515
winapi = { version = "0.3.9", features = ["libloaderapi"] }
1616

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
1-
# How it works
1+
> Rust library for Java to decrypt classes on definition, utilising a hook in the JVM.
2+
3+
# JVM ClassLoader hook
4+
5+
## How it works
26
This library enhances the JVM by creating a hook when loaded in the `JVM_DefineClassWithSource` export in the `jvm` library.<br>
37
This feature gives us the ability to read and modify the bytes of a class before it's constructed, providing greater control and customization options.
48

5-
# Note
9+
## Note
610
Please note that this is a basic implementation of class decryption in Java.<br>
711
While this method may provide a first line of defense against immediate decompiling, it's important to understand that more advanced tools and agents may still be able to read and modify the loaded classes.<br>
812
Keep this in mind as you use this feature in your projects.
913

14+
## Compatibility
15+
### ✅ Java
16+
All Java versions should be supported, as `jni` is only used for the structs and no method calls or such.<br>
17+
Thus far only `Java 8`, `Java 20` and `Java 21` were explicitly tested.
18+
19+
### ⚠️ Operating system
20+
The build targets only windows, as the library heavily relies on functionality of `winapi`.
21+
1022
# How to build
1123
1. [Install rust](https://www.rust-lang.org/tools/install)
1224
2. Install nightly by running `rustup install nightly`
@@ -37,7 +49,8 @@ for (int i = 0; i < classBytes.length; i++) {
3749
}
3850
```
3951

40-
### Override the javas magic value with your custom one
52+
### Override javas magic value with your custom one
53+
This allows the library to detect a custom class, to forward it to the decryption procedure.
4154
```java
4255
System.arraycopy(CUSTOM_MAGIC_VALUE, 0, classBytes, 0, CUSTOM_MAGIC_VALUE.length);
4356
```

0 commit comments

Comments
 (0)