mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 21:15:56 +08:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ac0bac555 | ||
|
|
c7d9336b70 | ||
|
|
c11891e718 | ||
|
|
de56fca73d |
No files matched your search
@@ -96,7 +96,7 @@ InjectorNative injectorNative = new InjectorNative();
|
|||||||
injectorNative.inject(<pid>, "<path-to-libloader>", "<path-to-toml-config-dir>");
|
injectorNative.inject(<pid>, "<path-to-libloader>", "<path-to-toml-config-dir>");
|
||||||
```
|
```
|
||||||
### 4. ✅ Done!
|
### 4. ✅ Done!
|
||||||
if injection is successful, target process will load `Entry.jar` (or `EntryClass` in config file) and run `EntryMethod` method(or `start` method in config file)
|
if injection is successful, target process will load `Entry.jar` (or `EntryJarPath` in config file) and run `EntryClass`.`EntryMethod` method(or `start` method in config file)
|
||||||
|
|
||||||
## Hot To Build
|
## Hot To Build
|
||||||
### Environment
|
### Environment
|
||||||
@@ -126,4 +126,4 @@ Disclaimer: This project is intended for learning and research in controlled env
|
|||||||
- [ReflectiveDLLInjection](https://github.com/stephenfewer/ReflectiveDLLInjection) - DLL Inject
|
- [ReflectiveDLLInjection](https://github.com/stephenfewer/ReflectiveDLLInjection) - DLL Inject
|
||||||
- [plog](https://github.com/SergiusTheBest/plog) - portable, simple and extensible C++ logging library
|
- [plog](https://github.com/SergiusTheBest/plog) - portable, simple and extensible C++ logging library
|
||||||
- [tinytoml](https://github.com/mayah/tinytoml) - A header only C++11 library for parsing TOML.
|
- [tinytoml](https://github.com/mayah/tinytoml) - A header only C++11 library for parsing TOML.
|
||||||
|
- [eventpp](https://github.com/wqking/eventpp) - C++ library for event dispatcher and callback list
|
||||||
+3
-2
@@ -132,8 +132,8 @@ injectorNative.inject(<pid>, "<path-to-libloader>", "<path-to-toml-config-dir>")
|
|||||||
|
|
||||||
注入成功后,目标进程将加载:
|
注入成功后,目标进程将加载:
|
||||||
|
|
||||||
- Entry.jar(或配置中的 EntryClass)
|
- Entry.jar(或配置中的 EntryJarPath)
|
||||||
- 并执行 EntryMethod(默认 start)
|
- 并执行 EntryClass.EntryMethod(默认 com.example.Entry.start() )
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -175,3 +175,4 @@ JAR 可在 JuiceAgent-API 项目中构建或下载。
|
|||||||
- ReflectiveDLLInjection — DLL 注入实现
|
- ReflectiveDLLInjection — DLL 注入实现
|
||||||
- plog — 轻量级 C++ 日志库
|
- plog — 轻量级 C++ 日志库
|
||||||
- tinytoml — C++11 TOML 解析库
|
- tinytoml — C++11 TOML 解析库
|
||||||
|
- [eventpp](https://github.com/wqking/eventpp) - 用于事件分发器和回调列表的 C++ 库
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
VERSION = Version 3.0 Build 2
|
VERSION = Version 3.1 Build 3
|
||||||
File renamed without changes.
@@ -14,13 +14,6 @@ namespace JuiceAgent {
|
|||||||
bool Agent::init(JavaVM* jvm, JNIEnv* env, jvmtiEnv* jvmti) {
|
bool Agent::init(JavaVM* jvm, JNIEnv* env, jvmtiEnv* jvmti) {
|
||||||
PLOGI << "JuiceAgent Native EntryPoint Invoked!";
|
PLOGI << "JuiceAgent Native EntryPoint Invoked!";
|
||||||
|
|
||||||
// PreLoad Event
|
|
||||||
eventbus.post(EventPreLoad{
|
|
||||||
.jvm = jvm,
|
|
||||||
.env = env,
|
|
||||||
.jvmti = jvmti
|
|
||||||
});
|
|
||||||
|
|
||||||
// ======== neccessary environment check ========
|
// ======== neccessary environment check ========
|
||||||
if (jvm == nullptr) {
|
if (jvm == nullptr) {
|
||||||
PLOGE << "Failed to initialize JuiceAgent: jvm is null";
|
PLOGE << "Failed to initialize JuiceAgent: jvm is null";
|
||||||
@@ -37,9 +30,15 @@ namespace JuiceAgent {
|
|||||||
|
|
||||||
set_jvm(jvm);
|
set_jvm(jvm);
|
||||||
set_jvmti(jvmti);
|
set_jvmti(jvmti);
|
||||||
|
|
||||||
PLOGD << "env: " << env << ", jvmti: " << jvmti;
|
PLOGD << "env: " << env << ", jvmti: " << jvmti;
|
||||||
|
|
||||||
|
// PreLoad Event
|
||||||
|
eventbus.post(EventPreLoad{
|
||||||
|
.jvm = jvm,
|
||||||
|
.env = env,
|
||||||
|
.jvmti = jvmti
|
||||||
|
});
|
||||||
|
|
||||||
// ======== Application ability ========
|
// ======== Application ability ========
|
||||||
jvmtiCapabilities caps{};
|
jvmtiCapabilities caps{};
|
||||||
caps.can_get_bytecodes = 1;
|
caps.can_get_bytecodes = 1;
|
||||||
|
|||||||
Reference in new issue
Block a user