{"id":46434984,"url":"https://github.com/xiaozhou233/juiceagent","last_synced_at":"2026-04-18T07:03:31.391Z","repository":{"id":315051193,"uuid":"1057817500","full_name":"xiaozhou233/JuiceAgent","owner":"xiaozhou233","description":" a JVMTI-based injection library for loading external JARs and transforming Java bytecode, even when DisableAttachMechanism is enabled.","archived":false,"fork":false,"pushed_at":"2026-04-16T06:58:22.000Z","size":360,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-16T07:28:24.216Z","etag":null,"topics":["bytecode","injection","injector","jvmti"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xiaozhou233.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-16T08:45:34.000Z","updated_at":"2026-04-16T06:58:25.000Z","dependencies_parsed_at":"2026-04-01T12:03:22.162Z","dependency_job_id":null,"html_url":"https://github.com/xiaozhou233/JuiceAgent","commit_stats":null,"previous_names":["xiaozhou233/juiceagent"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/xiaozhou233/JuiceAgent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaozhou233%2FJuiceAgent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaozhou233%2FJuiceAgent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaozhou233%2FJuiceAgent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaozhou233%2FJuiceAgent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiaozhou233","download_url":"https://codeload.github.com/xiaozhou233/JuiceAgent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaozhou233%2FJuiceAgent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31959886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bytecode","injection","injector","jvmti"],"created_at":"2026-03-05T20:03:00.273Z","updated_at":"2026-04-18T07:03:31.385Z","avatar_url":"https://github.com/xiaozhou233.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JuiceAgent\n[English](https://github.com/xiaozhou233/JuiceAgent/blob/main/README.md) | [中文](https://github.com/xiaozhou233/JuiceAgent/blob/main/README_zh.md)\n\nJuiceAgent is a JVMTI-based injection library for loading external JARs and transforming Java bytecode, even when `DisableAttachMechanism` is enabled.\n\n**Notice:** Currently, only **Windows** is supported. **Linux** support may be added in the future.\n\n**Notice:** The current repository version is **Version 3.1 Build 3**.\n\n**Warning:** This project is still experimental and is not recommended for production use. Use it at your own risk.\n\n## Summary\nJuiceAgent is a JVMTI-native injection framework that injects native code into a target JVM to dynamically load external JARs and perform bytecode redefinition or retransformation without requiring a `javaagent`. It can still work when `DisableAttachMechanism=true`.\n\n## Features\nThis project is the native implementation of JuiceAgent-API. For the API definition, see [JuiceAgent.java](https://github.com/xiaozhou233/JuiceAgent-API/blob/master/src/main/java/cn/xiaozhou233/juiceagent/api/JuiceAgent.java).\n\n- `addToBootstrapClassLoaderSearch`\n- `addToSystemClassLoaderSearch`\n- `addToClassLoader`\n- `defineClass`\n- `redefineClass(ByName)`\n- `retransformClass(ByName)`\n- `getLoadedClasses`\n- `getClassByName`\n- `getClassBytes(ByName)`\n\n## How To Use\n\n### 1. Download Files\nDownload the following files from [Releases](https://github.com/xiaozhou233/JuiceAgent/releases) and place them in `YourDir`:\n\n- `libagent.dll`\n- `libinject.dll`\n- `libloader.dll`\n- `injector.exe`\n\nDownload `JuiceAgent-API-X.X.X+build.X.jar` from [JuiceAgent-API Releases](https://github.com/xiaozhou233/JuiceAgent-API/releases) and place it in `YourDir`.\n\n### 2. Write the Config File\nCreate a file named `config.toml` in `YourDir`.\n\n```toml\n[JuiceAgent]\n# Default value: YourDir/JuiceAgent-API.jar\nJuiceAgentAPIJarPath = \"\"\n# Default value: YourDir/libagent.dll\nJuiceAgentNativePath = \"\"\n\n[Entry]\n# Default value: YourDir/Entry.jar\nEntryJarPath = \"\"\n# Default value: com.example.Entry\nEntryClass = \"\"\n# Default value: start\nEntryMethod = \"start\"\n\n[Runtime]\n# Default value: YourDir/injection\nInjectionDir = \"\"\n```\n\n### 3. Run the Injector\n\n#### Method A: Use `injector.exe`\nRun `injector.exe` from `YourDir`.\n\n```text\n\u003cjps output\u003e\nInput PID:\n```\n\nEnter the PID of the target JVM process and press Enter.\n\n#### Method B: Use JNI to call `inject`\nCreate `cn/xiaozhou233/juiceagent/injector/InjectorNative.java` in your project:\n\n```java\npackage cn.xiaozhou233.juiceagent.injector;\n\npublic class InjectorNative {\n    /*\n     * @param pid target process id\n     * @param path injection DLL path\n     */\n    public native boolean inject(int pid, String path);\n\n    /*\n     * @param pid target process id\n     * @param path injection DLL path\n     * @param configDir directory containing config.toml\n     */\n    public native boolean inject(int pid, String path, String configDir);\n}\n```\n\nExample:\n\n```java\nimport cn.xiaozhou233.juiceagent.injector.InjectorNative;\n\nSystem.load(\"\u003cpath-to-libinject\u003e\");\nInjectorNative injectorNative = new InjectorNative();\n\ninjectorNative.inject(\u003cpid\u003e, \"\u003cpath-to-libloader\u003e\", \"\u003cpath-to-config-directory\u003e\");\n```\n\n### 4. Done\nIf the injection succeeds, the target process will load `Entry.jar` (or the file specified by `EntryJarPath`) and invoke `EntryClass.EntryMethod` (default: `com.example.Entry.start`).\n\n## How To Build\n\n### Requirements\n- Java 8+\n- MinGW\n- CMake 3.15+\n- Ninja\n\n### Build with CMake Presets\n```powershell\ngit clone https://github.com/xiaozhou233/JuiceAgent.git\ncd JuiceAgent\n\ncmake --preset ninja-release\ncmake --build build\n```\n\n### Manual Build\n```powershell\ngit clone https://github.com/xiaozhou233/JuiceAgent.git\ncd JuiceAgent\n\ncmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release\ncmake --build build\n```\n\nThe generated binaries will be placed in `build/bin`.\n\n`JuiceAgent-API.jar` can be built from or downloaded from [JuiceAgent-API](https://github.com/xiaozhou233/JuiceAgent-API).\n\n## Full Disclaimer\nThis project is intended for learning and research in controlled environments only. The author is not responsible for any consequences arising from unauthorized use, modification, cracking, or violation of any applicable agreements or laws. Users are responsible for ensuring that their actions are legal and compliant.\n\n## Acknowledgements\n- [ReflectiveDLLInjection](https://github.com/stephenfewer/ReflectiveDLLInjection) - DLL injection implementation\n- [plog](https://github.com/SergiusTheBest/plog) - Portable, simple, and extensible C++ logging library\n- [tinytoml](https://github.com/mayah/tinytoml) - Header-only C++11 TOML parser\n- [eventpp](https://github.com/wqking/eventpp) - C++ library for event dispatchers and callback lists\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaozhou233%2Fjuiceagent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaozhou233%2Fjuiceagent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaozhou233%2Fjuiceagent/lists"}