Compare commits

..
256 Commits
Author SHA1 Message Date
xiaozhou233 4b1ca5a490 CI: check out submodules in the Linux build job
- ci: add submodules: recursive to the build-linux checkout; without it the
  ptrace-inject-cpp directory is empty and configure fails on add_subdirectory
2026-10-20 13:37:13 +08:00
xiaozhou233 483a12cd3c Feat: implement the Linux injector with ptrace-inject-cpp
- cmake: build the ptrace-inject-cpp submodule on non-Windows with its CLI and
  examples disabled, and link ptrace_inject::ptrace_inject into the injector
- injector: replace the placeholder injector_linux.c with injector_linux.cpp,
  a CLI that injects a shared library into -p PID or -n NAME and forwards the
  library's log output to stderr
2026-10-20 13:36:22 +08:00
xiaozhou233 416e83f36e [Feat] add ptrace-inject-cpp as submodule 2026-10-20 13:36:22 +08:00
xiaozhou233 4b9d371357 CI: add a Linux build job
- ci: add build-linux on ubuntu-latest (GCC + Ninja): configure, build, package, no tests
- ci: upload dist/JuiceAgent_*.tar.gz as JuiceAgent-linux-x64 (14-day retention)
- docs: describe the Windows and Linux jobs in AGENTS.md
2026-10-19 13:35:22 +08:00
xiaozhou233 c710547cc8 Docs: point Linux users at the Jenkins builds
- readme: note in Quick Start that Linux builds are not attached to GitHub Releases
- readme: add a Download subsection to Linux Support with the Jenkins job URL
- readme-zh: mirror the same changes in Chinese
2026-10-19 13:29:37 +08:00
xiaozhou233 4bb0d6ecd1 Feat: add a Linux packaging script
- script: add package.sh, packing injector/libloader.so/libagent.so into dist/JuiceAgent_vX.Y.Z_x64_linux.tar.gz
- docs: record the Linux package output in AGENTS.md
2026-10-19 13:21:09 +08:00
xiaozhou233 0e1280ef7f Docs: document Linux injection support
- readme: add the Linux platform overview, components and build requirements
- readme: describe ptrace + remote dlopen and the $HOME/.juiceagent config default
- readme-zh: mirror the same changes in Chinese
2026-10-19 13:19:57 +08:00
xiaozhou233 6eb1925ec3 Feat: add Linux libloader entry point
- libloader: add platform/linux/Entry.cpp that starts the loader from a constructor
- libloader: read the config path from JuiceAgent_ConfigPath, falling back to $HOME/.juiceagent
- libloader: default JuiceAgentNativeLibraryPath to libagent.so on non-Windows
- injector: print a notice that the Linux injector is not open source yet
2026-10-18 22:32:14 +08:00
xiaozhou233 59e705510e BugFix: restore ReflectiveDLLInjection link for libloader
- cmake: link ReflectiveDLLInjection into loader on Windows again; the platform split dropped it when jvm moved into the WIN32 branch
2026-10-18 19:18:04 +08:00
xiaozhou233 c548022068 Feat: add Linux build support scaffolding
- cmake: guard Windows-only link dir and projects (ReflectiveDLLInjection, libinject)
- agent/loader: select win32 or linux JVM headers by platform, link jvm only on Windows
- loader: glob platform/linux sources for non-Windows builds
- injector: add a Linux entry point stub selected on non-Windows
- jvm: vendor Linux jni_md.h and jawt_md.h
2026-10-18 19:12:31 +08:00
xiaozhou233 6a43b3437a BugFix: fix playload typo in retransform-class example [skip ci]
- examples: rename playload to payload (directory, class, jar, config, docs)

- payload.jar: rebuild with payload.class
2026-10-17 13:21:42 +08:00
xiaozhou233 8cd4c54c07 Docs: add QuickStartForAgents.md [skip ci]
- docs: add the agent-facing quick start (environment check, requirements, config.toml, injection, verification)
- readme: point new users at the agent guide and show how to prompt an agent
- readme-zh: mirror the same note in Chinese
2026-10-16 20:44:24 +08:00
xiaozhou233 3796cca9a1 Docs: add AGENTS.md [skip ci]
- document the build/test/release flow for agents working in this repo

- record the hard-won rules: libloader must stay exception-free (reflective loading breaks unwind), config reads are non-throwing, no MinGW runtime DLL deps, and tests must be asserted on output
2026-10-16 13:14:09 +08:00
xiaozhou233 80f926fde6 Version 5.0.1 2026-10-16 13:08:25 +08:00
xiaozhou233 9351556cda Docs: add v5.0.1 release notes and changelog
- docs/update: add v5.0.1 release notes (bilingual) for the libloader crash fix, the typed event bus and the new CI

- docs/update: add the 5.0.1 entry to the changelog
2026-10-16 13:08:25 +08:00
xiaozhou233 19b1bfb88a CI: package and upload the release zip as a build artifact
- ci: after the integration tests, run script/package.cmake and upload dist/JuiceAgent_*.zip via actions/upload-artifact (14-day retention)
2026-10-16 13:02:02 +08:00
xiaozhou233 3cd28c9bcb BugFix: keep libloader exception-free so a bad config cannot crash the JVM
- loader: libloader is reflectively loaded, so its unwind tables are never registered with the OS and a C++ exception thrown inside it cannot be caught - it crashed the target JVM with EXCEPTION_ILLEGAL_INSTRUCTION when config.toml was missing a required key. Replace the throwing config reads with contains() + get(key, default) + early return, and drop the ineffective try/catch in entrypoint()

- config: parse config.toml without exceptions (toml++ parse_result) and remove the throwing get()/getPath()/getArray() overloads

- build: compile libloader with -fno-exceptions (+ SPDLOG_NO_EXCEPTIONS) so exception-capable code fails the build instead of crashing at runtime
2026-10-16 12:59:26 +08:00
xiaozhou233 124c656400 BugFix: contain exceptions at the loader entry point
- loader: wrap entrypoint() in try/catch; it runs from DllMain inside the target JVM process, so an uncaught exception (e.g. a missing required key in config.toml) would take the target process down
2026-10-16 12:50:06 +08:00
xiaozhou233 e6da1d6fff CI: statically link the runtime and bundle imported DLLs
- ci: build with -static-libgcc -static-libstdc++ (matching w64devkit, the local toolchain) so the DLLs do not depend on a libstdc++-6.dll that could be shadowed by an incompatible one on the runner

- ci: bundle only the non-system DLLs actually imported, taken from the compiler that built them, and print the import list for diagnosis
2026-10-16 12:43:20 +08:00
xiaozhou233 08fe3a8815 CI: bundle MinGW runtime DLLs and print test output on failure
- ci: copy libstdc++-6/libgcc_s_seh-1/libwinpthread-1 next to the built binaries so the tests can load libagent.dll; without them every test failed with a load error on the runner

- tests: run-tests.ps1 now prints a failing test's captured output, so a failure is diagnosable even though the test program exits 0
2026-10-16 12:38:05 +08:00
xiaozhou233 9aebf29bb5 CI: add Windows workflow and a reusable integration-test runner
- ci: build with MinGW-w64 (MSYS2) + Ninja on windows-latest and run the integration tests

- tests: add run-tests.ps1, which compiles the modules, refreshes tests/resources, then runs every test and asserts on its output (the tests exit 0 even on failure, so exit codes are not enough)
2026-10-16 12:29:31 +08:00
xiaozhou233 13145f77c9 Feat: add front-insertion listener registration to the event bus
- libagent: add EventBus::subscribeFront to insert a listener ahead of the existing ones for the same event

- libagent: add IService::listenFront, tracked like listen() so unlistenAll() still cleans it up; for cases where listener ordering matters (e.g. a transformer pipeline)
2026-10-15 21:03:03 +08:00
xiaozhou233 5b0a26d49e Refactor: replace eventpp with a small typed event bus
- libagent: rewrite EventBus as a type-safe dispatcher keyed by event type; listeners are invoked with the concrete event type instead of 'const void*', and the bus is mutex-protected

- libagent: services subscribe/unsubscribe by event type (IService::listen no longer takes an EventId)

- libagent: remove the unused MethodEntry/MethodExit events and EventMethodEntry/EventMethodExit structs

- build: drop the in-tree eventpp headers (23 files) and its license
2026-10-15 20:58:23 +08:00
xiaozhou233 4c3798735b Docs: add v5.0.0 release notes and changelog
- docs/update: add v5.0.0 release notes (bilingual) covering the v1 -> v2 breaking config change, migration steps and the BuiltIn / CustomJar modes

- docs/update: add CHANGELOG starting from v4.1.2
2026-10-15 20:09:37 +08:00
xiaozhou233 5cf0d6ebd8 Version 5.0.0 2026-10-15 20:06:34 +08:00
xiaozhou233 fd6fe0abdb Refactor: remove unused loader config helpers
- config: drop get_loader_config / print_loader_config and the LoaderConfig struct, which were unused and still referenced the v1 key JuiceAgent.Loader.JuiceAgentNativeLibraryPath

- config: drop the now-unneeded ConfigStruct.hpp and Utils.hpp includes (consumers include Utils.hpp directly)
2026-10-15 20:06:22 +08:00
xiaozhou233 5170d50517 Docs: update config docs to v2 schema and add config.md
- docs: add config.md documenting the v2 schema ([JuiceAgent] / [JarLoader]), key defaults and the BuiltIn / CustomJar modes

- docs: rewrite advanced.md around the JarLoader.Mode = CustomJar workflow instead of the removed JUICEAGENT_API_* environment variables

- readme: migrate the Quick Start config example from v1 to v2 and link docs/config.md, list inject-via-java-api under Examples

- examples: update inject-via-java-api HowToUse docs (.md/.txt, EN/ZH) to the v2 config
2026-10-15 20:02:32 +08:00
xiaozhou233 af22f80b23 BugFix: fix integration test setup and GetClassBytesByName test
- tests: rewrite copy-bin.bat with native COPY /Y, cwd-independent paths and error handling so it no longer fails silently when a test JVM is locking resources\libagent.dll

- tests: load Target before calling getClassBytesByName, which only resolves classes that are already loaded
2026-10-14 21:46:22 +08:00
xiaozhou233 56a1c32f49 Feat: add Enabled flag for JarLoader module
- libagent: gate JarLoaderService::onLoaded on the JarLoader.Enabled key (default false) so the module can be turned off from config

- examples: set Enabled = true in inject-via-java-api, load-via-injector-exe and retransform-class config.toml
2026-10-14 21:46:18 +08:00
xiaozhou233 f38a28e8b3 Refactor: migrate config to v2 format across examples and libagent
- examples: update config.toml to the v2 schema ([JarLoader] with Mode / InjectionDir / JarPath / EntryClass / EntryMethod) for inject-via-java-api, load-via-injector-exe and retransform-class

- libagent: read JarLoader.* instead of JuiceAgent.Modules.JarLoader.*, use Config::isValid() and the new get()/getPath() accessors

- libagent: rename call_java_impl to call_static_java_method
2026-10-14 21:21:02 +08:00
xiaozhou233 eb7fd31817 Feat: initialize built-in / custom jar loader and fix entry class lookup
- Loader: dispatch initialize() on JarLoader.Mode; BuiltIn serializes the config and calls JuiceAgentBootstrap.start, CustomJar calls the configured EntryClass.EntryMethod

- Utils: normalize class names to the JNI internal form ('.' -> '/') so JNI FindClass accepts Java binary names like Example.Main (fixes NoClassDefFoundError on custom jar entry)

- Utils: rework Serializer, drop the unused Deserializer/LocalRef, add to_java_string_array / toDelimitedString and a no-argument call_static_java_method overload

- Config: remove the unused serialize_loader_config helper
2026-10-14 21:01:14 +08:00
xiaozhou233 92ad21003f Feat: support built-in and custom jar loading modes
- Split jar loading into load_builtin (extract and register the bundled JuiceAgent API jar) and load_custom (register a user-supplied jar) in a new JarLoader.cpp

- Check JuiceAgent.Version against CONFIG_VERSION and dispatch on JarLoader.Mode (BuiltIn / CustomJar) during preload

- Pass the parsed Config into Loader::initialize and add CONFIG_VERSION in JuiceAgent.hpp

- Restore Config::Utils loader-config helpers on top of the new getPath API
2026-10-14 19:23:41 +08:00
xiaozhou233 11cf47c4c2 Feat: add logging for config parse and access errors
- Log parse failures in the Config constructor via spdlog::error

- Log missing keys and type mismatches (error when throwing, warn when falling back to defaults)
2026-10-14 16:25:29 +08:00
xiaozhou233 3626abb35a Refactor: migrate TOML parser from toml11 to toml++
- Replace vendored single-header toml11 (includes/toml.hpp) with the toml++ library (includes/toml++)

- Rewrite Config to use toml::parse_file and expose typed get/getArray/getPath/contains accessors, storing parse errors instead of logging them

- Update bundled license to toml++
2026-10-14 16:21:48 +08:00
xiaozhou233 382bfb7fed Version 4.1.2 2026-10-11 14:23:16 +08:00
xiaozhou233 560215c0ae Feat: add version-based packaging script
Add script/package.bat and script/package.cmake to package build/bin artifacts into a versioned zip under dist/.

Version.txt now uses Major/Minor/Patch key-value format so the script can parse it, and dist/ is ignored.
2026-10-10 22:16:09 +08:00
xiaozhou233 55303b7dc9 BugFix: fix getClassBytesByName cannot get class in some environments 2026-08-25 20:32:56 +08:00
xiaozhou233 41049f1852 Docs: Fix doc path 2026-08-19 19:03:05 +08:00
xiaozhou233 396ec1a96f Docs: Update Inject.md 2026-08-19 19:01:25 +08:00
xiaozhou233 10ec330480 Version 4.1.1 2026-08-19 18:36:07 +08:00
xiaozhou233 0ddcfcd7c8 Remove remapper whitelist JNI declarations 2026-08-19 18:30:58 +08:00
xiaozhou233 87a91376c5 Remove JuiceRemapper module
Remove the runtime class remapping feature including its JNI bindings, service, config example, and Remapper singleton from global.hpp.
2026-08-19 18:29:38 +08:00
xiaozhou233 dbae5e5258 Fix: do not auto-read config when runtime dir is empty
Config no longer falls back to the current working directory when no
runtime directory is specified, so an empty runtime dir leaves the config
invalid instead of silently parsing config.toml from the CWD.
2026-08-18 20:11:00 +08:00
xiaozhou233 ff216aabee Fix: harden remapper filters and agent init guard
- skip empty include/exclude entries in Remapper::shouldRemap to avoid
  calling back() on an empty std::string (undefined behavior)
- null-check new_class_data_len/new_classbytes in JuiceRemapperService
  before writing remapped bytes back to the JVMTI callback
- add Agent::initialized_ guard so init() is a no-op on second call,
  preventing duplicate service instantiation and listeners
2026-08-18 16:51:21 +08:00
xiaozhou233 18a923373b Merge branch 'feat/remapper' into main 2026-08-18 16:43:47 +08:00
xiaozhou233 6fe467bccf Feat: add include/exclude filters for JuiceRemapper
- add thread-safe include/exclude sets to Remapper; shouldRemap matches
  exact name, package prefix (trailing '/'), or nested class ('\$' after
  the prefix), with exclude taking priority
- remapping stays OFF by default: an empty include set remaps nothing;
  it is only enabled once addInclude is called (no config include)
- implement addInclude/addExclude/removeInclude/removeExclude/
  clearIncludes/clearExcludes JNI bindings
- apply shouldRemap filter in JuiceRemapperService::onClassFileLoadHook
2026-08-18 16:41:55 +08:00
xiaozhou233 4bed99f417 Feat: add JuiceRemapper runtime class remapping
- add JuiceRemapperService that listens for ClassFileLoadHook and calls
  the Java static Remap.remap(String, byte[]) via cached JNI declarations,
  then writes the returned bytes back to the JVMTI callback
- add JNI bindings (initNative, add/remove/clear include/exclude) with
  Remapper singleton init state and cached jclass/jmethodID stored in
  Remapper (global.hpp)
- cache static class/method declarations lazily in initNative to avoid
  repeated FindClass/GetStaticMethodID
- add generated JuiceRemapper JNI header and runtime-remap example config
2026-08-18 16:28:29 +08:00
xiaozhou233 81905d6c3f Merge branch 'dev' into main 2026-08-17 20:07:11 +08:00
xiaozhou233 6822c1dc63 Version 4.1.0 2026-08-17 20:06:34 +08:00
xiaozhou233 27abc2bf6a Fix: propagate preload/init failure from JNI init entry
Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_init now checks the return
values of Agent::preload and Agent::init and returns JNI_FALSE when either
fails, instead of always reporting success to Java.
2026-08-17 20:04:40 +08:00
xiaozhou233 4f433bc6ee Fix: init lifecycle event payloads and clean up service listeners
- fill EventPreLoad/EventLoaded struct members instead of leaving them
  as uninitialized garbage; post PreLoad only after the agent environment
  (JavaVM/JNIEnv/JVMTI) is set so listeners can query Agent state
- store (EventId, Handle) pairs in IService and add unlistenAll() to
  remove registered listeners on shutdown, preventing dangling callbacks
  into destroyed services; BytecodeService and JarLoaderService now call
  it from onShutdown
2026-08-17 20:02:39 +08:00
xiaozhou233 20747124d1 Feat: add JarLoaderService that loads jar on EventLoaded
- add JarLoaderService registered via JUICEAGENT_REGISTER_SERVICE; it
  listens for EventId::Loaded, reads JuiceAgent.Modules.JarLoader config
  from config.toml, serializes it and calls the Java JarLoader.loadJar
  module to inject the jar into the JVM
- post EventPreLoad during Agent::preload and EventLoaded after services
  initialize so services can react to agent lifecycle
2026-08-17 19:59:23 +08:00
xiaozhou233 4833b512f5 Test: add bytecode API integration tests
- add Java tests for getClassBytes(ByName), redefineClass(ByName),
  retransformClass(ByName) and defineClass
- ignore tests/tmp/ directory for captured bytecode output
2026-08-17 19:42:12 +08:00
xiaozhou233 63dd69abc6 Fix: use FindClass in getClassBytesByName to resolve class lookup 2026-08-17 19:27:15 +08:00
xiaozhou233 f38743e863 Feat: add JNI bytecode API and BytecodeStore
- introduce thread-safe BytecodeStore singleton for pending captures,
  captured bytecode cache, and pending patches; replaces ad-hoc global
  mutex/map pairs
- implement BytecodeService capture/patch listeners that operate on
  the store; keep JVMTI Allocate outside of store locks and put failed
  patches back so they can be retried
- add JNI bindings: getClassBytes(ByName), redefineClass(ByName),
  retransformClass(ByName); use JVMTI GetLoadedClasses for name-based
  lookup instead of JNI FindClass, validate array length vs declared
  length in redefineClass
2026-08-17 19:19:26 +08:00
xiaozhou233 8e1b8b38e4 Refactor: auto-register services and inline BytecodeService
- add ServiceRegistry and JUICEAGENT_REGISTER_SERVICE macro so each
  service self-registers at static init; initializeAll() no longer
  includes concrete service headers
- move BytecodeService class entirely into its .cpp (no header needed,
  only accessed via IService)
- split ClassFileLoadHook handling into captureBytecodes and
  patchBytecodes listeners, registered in order
2026-08-17 18:54:36 +08:00
xiaozhou233 6962c4a477 Feat: add event bus and service framework
- introduce EventBus singleton wrapping eventpp::EventDispatcher with
  typed event ids and const void* payloads
- post EventClassFileLoadHook from ClassFileLoadHook callback
- add IService base with typed listen<>() helper that binds a member
  function directly to an event, no virtual onEvent dispatch
- add ServiceManager to register, initialize and shutdown services
- add BytecodeService that subscribes to ClassFileLoadHook
- wire Services::initializeAll() into Agent::init()
2026-08-17 15:45:39 +08:00
xiaozhou233 6bf2d31798 Feat: add IntelliJ integration tests for native API
- Add test JVM sources (Loop, Target) and API tests
  (AddToBootstrap/SystemClassLoaderSearch, AddToClassLoader,
  GetClassByName, GetLoadedClasses)
- Add injection module (Injection jar) for classloader tests
- Add copy-bin.bat to refresh resources/ from build output
- Remove obsolete java-loop/java-system-load tests
- Ignore IDE dirs and resources/ build artifacts
2026-08-17 00:16:24 +08:00
xiaozhou233 6afa44f90a Feat: add classloader JNI layer for the new agent
- Re-add addToBootstrap/SystemClassLoaderSearch, addToClassLoader, defineClass,
  getLoadedClasses, getClassByName on the new Agent singleton
- Add utils.hpp with check_env/get_class_name helpers
- Pull utils.hpp into jni_common.hpp umbrella header
2026-08-16 22:49:13 +08:00
xiaozhou233 2ab1c134ed Feat: load config in libagent to prepare for modules
- Make runtime_dir optional in JuiceAgent.init (tolerate null jstring)
- Load config.toml into Agent and expose getConfig/setConfig
- Warn instead of failing when runtime directory or config is missing
2026-08-16 22:38:08 +08:00
xiaozhou233 51bcfbd549 Refactor: rebuild libagent with simplified lifecycle
- Replace eventbus/services with Agent preload/init lifecycle
- Move JNI header to shared includes; add jni_common.hpp umbrella header
- Reduce ClassFileLoadHook to a stub for later implementation
- Add eventpp dependency
- Document custom API JAR workflow (WIP)
2026-08-16 21:14:44 +08:00
xiaozhou233 3b180e7199 Fix: harden libloader config handling
- Guard Config against NULL runtime_dir
- Read JuiceAgent.Version from config instead of hardcoding 2
- Move LoaderConfig to ConfigStruct.hpp; remove obsolete JuiceAgent.hpp
2026-08-16 21:08:13 +08:00
xiaozhou233 b34377d447 Refactor: restructure libloader and drop config parsing
- Move loader logic to core/ and rename plantform/ to platform/
- Remove config.toml parsing from loader; pass runtime_dir to Bootstrap directly
- Rewrite JvmAttach: RAII detach, drop dead thread_local, merge acquire helpers
- Fix initialize() missing namespace qualification
- Make GLOB sources pick up new files with CONFIGURE_DEPENDS
2026-08-16 18:53:31 +08:00
xiaozhou233 f2ce4e6a5a Fix: simplify DllMain attach logic and add pause to java-system-load test 2026-08-16 16:13:26 +08:00
xiaozhou233 757c5f70f0 Fix: Delete unuse config 2026-08-16 16:03:28 +08:00
xiaozhou233 78160a33a9 Feat: add java-system-load test with copy-and-build and run scripts 2026-08-16 16:02:43 +08:00
xiaozhou233 092110672a Fix: avoid running agent/loader logic on plain System.load 2026-08-16 15:32:23 +08:00
xiaozhou233 c5acf2aba0 Docs: add examples markdown docs (EN/CN) and index 2026-08-15 22:15:13 +08:00
xiaozhou233 316735cfef Version 4.0.1 Build 2 2026-08-15 22:01:28 +08:00
xiaozhou233 a1b0eb8b84 Feat: add inject-via-java-api example with JNI refactor
- Rename JNI class from InjectorNative to Injector in libinject.c

- Add JNI header for cn.xiaozhou233.juiceagent.injector.Injector

- Add inject-via-java-api example with HowToUse.txt and 如何使用.txt
2026-08-15 21:51:48 +08:00
xiaozhou233 32e9199d4a Docs: add community links and examples reference to READMEs 2026-08-15 16:10:01 +08:00
xiaozhou233 56ebafd48d Docs: add examples link to Quick Start section 2026-08-15 15:59:08 +08:00
xiaozhou233 d304ededd5 Docs: sync README with current project structure 2026-08-15 14:20:00 +08:00
xiaozhou233 7a4d8cb101 Feat: add license 2026-08-15 14:04:43 +08:00
xiaozhou233 3303630a45 Docs: Add Chinese README and improve AV notice 2026-08-15 14:03:37 +08:00
xiaozhou233 20fd69d239 Docs: fix link and build script 2026-08-15 14:00:45 +08:00
xiaozhou233 b8a4b805c7 Docs: Add antivirus false positive notice 2026-08-15 13:58:58 +08:00
xiaozhou233 a56caffe09 Version 4.0.0 Build 1 2026-08-15 13:48:09 +08:00
xiaozhou233 b08656daa6 Feat: add retransform-class example with build/run scripts and docs 2026-08-15 13:41:26 +08:00
xiaozhou233 57405e810c Restore: re-add README, examples and tools 2026-08-15 13:17:50 +08:00
xiaozhou233 6e417035b6 Merge branch 'refactor' into main 2026-08-15 13:15:02 +08:00
xiaozhou233 1d3755952f Feat: migrate libagent from JuiceAgent and port to spdlog 2026-08-15 13:13:55 +08:00
xiaozhou233 bcc1ecbf0e Refactor: simplify injector/libinject/loader code
- libinject: drop debug cruft, dedup JNI overloads into jni_inject, const-correct inject()
- loader: reuse Utils::call_java_impl for JNI bootstrap
- JvmAttach: collapse acquire_jvm/env/jvmti retry loops into one template
- injector: remove redundant copy_arg wrapper
- DllMain: remove no-op DLL_THREAD cases, merge attach logs
- libagent: guard add_library so empty source dir does not break configure
2026-08-15 12:55:27 +08:00
xiaozhou233 a251b8996e Feat: add libagent CMakeLists.txt 2026-08-15 12:48:23 +08:00
xiaozhou233 1931072b96 Fix: harden injector/libinject/loader against UB, format bugs and leaks 2026-08-15 12:30:49 +08:00
xiaozhou233 ce08b19170 Feat: add Config/Utils headers and Loader module, wire entrypoint into DllMain 2026-08-15 12:26:12 +08:00
xiaozhou233 998f4d139e Fix: switch Logger to truncating file sink with flush-on-trace 2026-08-15 11:42:15 +08:00
xiaozhou233 5023ecf90c Feat: add reflective DLL injection library, JVM headers and libinject JNI module 2026-08-15 11:37:15 +08:00
xiaozhou233 6479966472 Test: add java-loop demo with build and run scripts, ignore class artifacts 2026-08-15 11:31:21 +08:00
xiaozhou233 841c0e5c2f Refactor: add injector CLI with PID/DLL args, jps listing and keep-alive prompt 2026-08-15 11:26:47 +08:00
xiaozhou233 01f966c5f2 Refactor: add spdlog vendored headers, Logger wrapper and libloader module skeleton 2026-08-15 11:20:36 +08:00
xiaozhou233 d711838948 Build: add CMake project skeleton with release/debug presets and .gitignore 2026-08-15 10:31:54 +08:00
xiaozhou233 fe64308942 DELETE: all code 2026-08-15 10:23:15 +08:00
xiaozhou233 56b6ab7e98 Refactor: remove x86_64-w64-mingw32 toolchain configuration 2026-08-15 08:55:56 +08:00
xiaozhou233 5f9fb7f1b4 Refactor: rename CMake presets and remove Docker/Jenkins build pipeline 2026-08-15 08:45:45 +08:00
xiaozhou233 1dcad52e15 Revert "Perf & Fix: reduce ClassFileLoadHook overhead and fix retransform patch path"
This reverts commit bb5b215a33.
2026-08-14 23:09:40 +08:00
xiaozhou233 cadd3679e9 Docs: update Todo.md to mark issues fixed by ai branch merge 2026-08-14 22:45:34 +08:00
xiaozhou233 97b100bbbb Merge branch 'ai' into main 2026-08-14 22:32:29 +08:00
xiaozhou233 8b5ea4cf28 Docs: rewrite README to match current module structure and config 2026-08-14 17:47:02 +08:00
xiaozhou233 b17ce02ae1 Docs: record code issues found before optimization as pending fixes 2026-08-14 17:44:30 +08:00
xiaozhou233 bb5b215a33 Perf & Fix: reduce ClassFileLoadHook overhead and fix retransform patch path
- Skip mutable event dispatch when no mutable listeners exist (hot path)
- Wire retransformClass bytecode into pendingRetransform so patches are applied
- Guard pendingRetransform with its mutex; check jvmti Allocate result
- Store global refs in captured ClassFileData and release on re-capture
- Add null/exception checks in defineClass/getLoadedClasses
- Extract shared find_class_by_internal_name helper
- Use CONFIGURE_DEPENDS for CMake globs; guard InitLogger; delete leaked jArgs
2026-08-14 17:07:36 +08:00
xiaozhou233 8cf2b8330c CI: build native binaries with MinGW before packaging
The runtime binaries are no longer committed, so compile them in the
builder container (example JARs stay committed) and package both artifacts.
2026-08-12 20:59:58 +08:00
xiaozhou233 f11687481f Examples: stop tracking prebuilt runtime binaries
Ignore and untrack injector.exe and lib*.dll in load-via-injector-exe;
these are copied in by the developer and should not be committed.
2026-08-12 20:53:18 +08:00
xiaozhou233 c5889cb338 CI: package committed binaries and example into two release artifacts
Drop on-the-fly compilation; the binaries and example JARs are now
committed to the repo. Jenkinsfile packages and archives:
  - JuiceAgent-windows-x64.zip (pure binaries)
  - JuiceAgent-windows-x64-examples.zip (binaries + runnable example)
Update examples/.gitignore to track prebuilt artifacts.
2026-08-12 20:50:43 +08:00
xiaozhou233 1f80df0af0 Examples: replace loop demo with load-via-injector-exe demo
Add a complete load-via-injector-exe example with injection/target sources,
build scripts, config and bilingual docs. Remove the old loop example and
config_empty.toml. Add examples-specific .gitignore for build artifacts.
2026-08-12 20:45:49 +08:00
xiaozhou233 2d1492f3e4 CI: Add zip package and archive artifacts as single zip file 2026-08-12 15:04:58 +08:00
xiaozhou233 b8e2ace91c CI: Use plain docker CLI, drop docker-workflow plugin dependency 2026-08-12 14:55:18 +08:00
xiaozhou233 4fde6477c6 CI: Add Jenkins pipeline building image and archiving artifacts 2026-08-12 14:53:04 +08:00
xiaozhou233 9ecd2e4e03 Build: Use MinGW posix thread variant for std::mutex support
The gcc/g++-mingw-w64-x86-64 metapackages pull in both posix and win32
variants, and update-alternatives defaults to win32 whose libstdc++ lacks
std::mutex. Install only the posix variants and add an apt retry loop for
flaky mirrors.
2026-08-12 14:49:33 +08:00
xiaozhou233 3842585777 Build: Add MinGW cross-compilation support 2026-08-12 09:49:34 +08:00
xiaozhou233 18726e59f4 Update: Link JVM lib from local lib directory 2026-08-12 09:43:05 +08:00
xiaozhou233 02c0583b34 Feat: Add Example Loop Jar 2026-06-13 11:50:18 +08:00
xiaozhou233 9ed7df8476 Feat: Add example loop 2026-06-13 11:40:00 +08:00
xiaozhou233 f49ac4dff7 Docs: Remove Dumper 2026-05-07 20:43:54 +08:00
xiaozhou233 16a36ef22a Update: Version 3.4.0 Build 1 2026-05-07 20:41:04 +08:00
xiaozhou233 4305000bf7 Feat: entrypoint_with_env 2026-05-07 15:54:02 +08:00
xiaozhou233 65824934d1 Refactor: Rename libagent -> JuiceAgent 2026-05-07 15:38:03 +08:00
xiaozhou233 992fbd9f8d Refactor: Remove Remapper 2026-05-07 15:36:19 +08:00
xiaozhou233 882c19ad8f Refactor: Move bytecodes_opt -> BytecodeService 2026-05-07 15:34:59 +08:00
xiaozhou233 637640b938 Refactor: Remove unused module files and streamline service management 2026-05-07 15:25:40 +08:00
xiaozhou233 490e4ce2ac Merge branch 'feat/Remapper' 2026-05-07 00:39:26 +08:00
xiaozhou233 30ecc82ca2 Feat: Update Remapper configuration to include JuiceRemapperJarPath 2026-05-06 14:15:11 +08:00
xiaozhou233 bf4ebd0e5b Docs: Update README with new features and installation instructions 2026-05-06 13:33:20 +08:00
xiaozhou233 ec7d221b08 Docs: Add Note 2026-05-06 13:27:51 +08:00
xiaozhou233 e5b054fcfc Docs: README.mc 2026-05-06 13:22:37 +08:00
xiaozhou233 b3ec5b6eb5 Feat: Remapper balcklist/whitelist 2026-05-05 16:17:08 +08:00
xiaozhou233 d5a49a5ce7 Merge branch 'feat/Remapper2' into feat/Remapper
Merge feat/Remapper2
2026-05-05 16:07:41 +08:00
xiaozhou233 90689f306b Feat: remapper blacklist/whitelist 2026-05-05 16:02:46 +08:00
xiaozhou233 1e2e5afd07 Feat: Add Remapper 2026-05-05 13:39:08 +08:00
xiaozhou233 d9d44f029f Fix: TemplateModule 2026-05-05 13:11:38 +08:00
xiaozhou233 cc1c2bff30 BugFix: The path for JuiceAgentNativeLibraryPath could not be resolved 2026-05-04 20:46:15 +08:00
xiaozhou233 7352f8d872 Update: Version 3.3.2 Build 2 2026-04-29 23:27:54 +08:00
xiaozhou233 4be6324cf3 BugFix: Handle path 2026-04-29 19:47:02 +08:00
xiaozhou233 0169e5e133 Update: Version 3.3.2 Build 1 2026-04-29 17:44:07 +08:00
xiaozhou233 fc5d23109d feat: remove Remapper module and associated JNI functions 2026-04-29 17:24:40 +08:00
xiaozhou233andCopilot 2493a9243f feat: refactor module structure to use ModuleBase class and improve initialization logic
Co-authored-by: Copilot <copilot@github.com>
2026-04-29 16:45:13 +08:00
xiaozhou233 28804c0af3 feat: implement Dumper module for class file handling and storage 2026-04-28 22:59:08 +08:00
xiaozhou233andCopilot 9d0fdecf92 feat: add Dumper module configuration to config_empty.toml
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 22:50:40 +08:00
xiaozhou233andCopilot dfc5886812 feat: implement Agent_OnLoad and VMInit callback for JuiceAgent
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 22:47:23 +08:00
xiaozhou233 9a582addc3 Update: Version 3.3.1 Build 1 2026-04-28 22:09:32 +08:00
xiaozhou233 41a8572c55 feat: update tempfile creation to use SHA-256 hash in filename for JuiceAgent-API 2026-04-28 22:04:30 +08:00
xiaozhou233andCopilot 01c46c6b98 feat: remove timestamp generation from tempfile creation and improve error logging
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 21:54:14 +08:00
xiaozhou233 bb6f5d50bb feat: remove JuiceAgentAPIJarPath from config_empty.toml 2026-04-28 21:34:41 +08:00
xiaozhou233andCopilot e2d6dcaa25 feat: remove JuiceAgentAPIJarPath from LoaderConfig and update loader logic to use temporary file
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 21:31:21 +08:00
xiaozhou233 75062b805c refactor: add JuiceAgent-API bytes/ write_to_tempfile / make_timestamp_filename 2026-04-28 21:25:02 +08:00
xiaozhou233 853002e70a feat: enhance file2bytes tool with MIME detection, SHA-256 hash generation, and namespace support 2026-04-28 21:10:49 +08:00
xiaozhou233andCopilot 962cbbe25d feat: file2bytes tools
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 20:51:24 +08:00
xiaozhou233 97e3b44130 feat: refactor class file load hook for improved readability and error handling 2026-04-26 16:38:47 +08:00
xiaozhou233 8002386230 feat: enhance Remapper module with class file load handling and method hooks 2026-04-25 00:06:17 +08:00
xiaozhou233andCopilot f84e13c14d feat: impl remapper whitelist manage
Co-authored-by: Copilot <copilot@github.com>
2026-04-24 16:36:06 +08:00
xiaozhou233 ee382817d3 feat: Remove remapper blacklist 2026-04-24 16:32:46 +08:00
xiaozhou233andCopilot a834584b9d feat: wip - add remapper manager function
Co-authored-by: Copilot <copilot@github.com>
2026-04-24 16:28:13 +08:00
xiaozhou233 49f737ec2f feat: update module initialization and starting logic to continue on failure 2026-04-24 16:09:55 +08:00
xiaozhou233 7bf6d486c3 feat: add remapper module 2026-04-24 16:08:56 +08:00
xiaozhou233 bf75790921 feat: Refactor EventBus to use priority-based listener management and improve unsubscribe functionality 2026-04-24 16:06:58 +08:00
xiaozhou233 5b253ddd5d feat: Implement MethodEntry and MethodExit callbacks with event posting 2026-04-24 15:50:43 +08:00
xiaozhou233 4c940c848b Version 3.3 Build 2 2026-04-23 22:06:11 +08:00
xiaozhou233 6564a0e020 feat: Update logger to use ColorConsoleAppender for improved output 2026-04-22 21:37:23 +08:00
xiaozhou233 c6dd965a9a feat: Delete tinytoml licenses 2026-04-22 21:17:42 +08:00
xiaozhou233 d87972242a feat: Add Template Module 2026-04-22 13:22:14 +08:00
xiaozhou233 50eb73d4e8 feat: Refactor module management and introduce ModuleRegistry for dynamic module loading 2026-04-22 13:19:39 +08:00
xiaozhou233 08ec414094 [Revert] Restore project state to 79ae4b6 2026-04-22 13:08:39 +08:00
xiaozhou233 601c999023 feat: Add Example module implementation and registration 2026-04-21 18:47:42 +08:00
xiaozhou233 e1577d4fae feat: Implement module registration and loading functionality 2026-04-21 18:34:32 +08:00
xiaozhou233 79ae4b62a3 Fix: Docs 2026-04-21 15:05:37 +08:00
xiaozhou233 f90582d24f modified: README.md 2026-04-21 14:56:52 +08:00
xiaozhou233 bc2440eeab Docs: Readme 2026-04-21 14:55:24 +08:00
xiaozhou233 92837c9597 Docs: Readme 2026-04-21 14:44:35 +08:00
xiaozhou233 b348757416 Version 3.3 Build 1 2026-04-20 16:48:54 +08:00
xiaozhou233 f5912f8040 [Doc] Update Version & Example Config 2026-04-20 16:48:29 +08:00
xiaozhou233 95f5604bfe Merge pull request #9 from xiaozhou233/refactor
Enhance configuration handling and implement module system
2026-04-20 14:06:38 +08:00
xiaozhou233 1ae65dd516 [Doc] TODO 2026-04-20 14:05:14 +08:00
xiaozhou233 50773f5456 Feat: Call Java Implementation 2026-04-20 14:04:53 +08:00
xiaozhou233 ccb332cb42 [Feat] Serializer 2026-04-20 13:18:58 +08:00
xiaozhou233 9a2dd217f1 [Refactor] Update configuration handling in JarLoader and enhance Config class 2026-04-19 22:26:51 +08:00
xiaozhou233 3fe9f5a573 Feat: Modules System 2026-04-19 19:03:48 +08:00
xiaozhou233 6858a35754 Feat: Simple module system 2026-04-19 18:57:32 +08:00
xiaozhou233 e7ce54188b [Refactor] Enhance Config class with type-safe get method and value reading 2026-04-19 18:44:59 +08:00
xiaozhou233 9f366645c9 Feat: libagent can now read the config 2026-04-19 18:36:26 +08:00
xiaozhou233 6a7e5a1d38 [Refactor] Config and Loader
[Add] toml11 library
[Refactor] Config
[Refactor] Data Struct
[Refactor] Loader
2026-04-19 16:41:39 +08:00
xiaozhou233 17bc993296 Example: empty example config 2026-04-19 15:44:06 +08:00
xiaozhou233 c348529e65 Style: Rename 2026-04-18 19:53:59 +08:00
xiaozhou233 cc52a25db4 Style: Rename 2026-04-18 19:28:47 +08:00
xiaozhou233 8b0bf8f211 Style: move LocalRef to header / move check_and_clear_exception to header 2026-04-18 19:24:49 +08:00
xiaozhou233 455986b08c Docs: todo 2026-04-17 14:24:48 +08:00
xiaozhou233 5b2c3c77ef Docs: Todo 2026-04-16 21:32:31 +08:00
xiaozhou233 11aaac0f0b Style: Config 2026-04-16 21:29:13 +08:00
xiaozhou233 6d3e29db03 Docs: todo 2026-04-16 19:16:07 +08:00
xiaozhou233 655039745a Fix: Doc 2026-04-16 15:35:41 +08:00
xiaozhou233 09f44f1aff Update Doc 2026-04-16 14:58:12 +08:00
xiaozhou233 5ac0bac555 Doc & Update to Version 3.0 Build 2 2026-04-16 13:26:36 +08:00
xiaozhou233 c7d9336b70 Refactor: preload event 2026-04-05 14:26:33 +08:00
xiaozhou233 c11891e718 Style: rename 2026-04-05 13:48:59 +08:00
xiaozhou233 de56fca73d Doc: README Acknowledgements 2026-04-05 11:28:20 +08:00
xiaozhou233 c20ec1e839 Merge pull request #7 - Feat/separation: 添加事件系统、分离Capture/Patch bytecodes
Feat/separation: 添加事件系统、分离Capture/Patch bytecodes
2026-04-04 21:59:10 +08:00
xiaozhou233 f8be8cb795 Feat: Event of preload & loaded 2026-04-04 21:51:12 +08:00
xiaozhou233 eb3a76769d Refactor: move eventbus.hpp/event_type to includes/event 2026-04-04 21:44:03 +08:00
xiaozhou233 49d2499f73 Feat: EventBus 2026-04-04 21:42:15 +08:00
xiaozhou233 a64bbb8bb8 Update: Add eventpp library 2026-04-04 21:02:04 +08:00
xiaozhou233 011fafb5b0 BugFix 2026-04-04 14:24:47 +08:00
xiaozhou233 748b118fb1 Feat: Custom path support 2026-04-03 16:35:24 +08:00
xiaozhou233 b78839a8d4 Feat: Config support ".xxx.xx" or "./xxx.xx" 2026-04-03 16:30:27 +08:00
xiaozhou233 8894a819f2 Doc: Updated documentation to support 3.0 Build 2 2026-04-02 19:07:14 +08:00
xiaozhou233 e25f0c304a update config.hpp
update config.hpp
2026-04-02 18:12:39 +08:00
xiaozhou233 bbea7b72c3 update config.hpp 2026-04-02 17:56:21 +08:00
xiaozhou233 896a856c57 Update: Version 3.0 Build 2
Update: Version 3.0 Build 2
2026-04-02 16:10:12 +08:00
xiaozhou233 c80851adb7 Version 3.0 Build 2 2026-04-02 16:09:29 +08:00
xiaozhou233 49ac4a51a1 Delete useless code 2026-04-02 16:09:04 +08:00
xiaozhou233 0d9e5fe836 Breaking Update: Version 3.0 Build 1
Breaking Update: Version 3.0 Build 1
Rename modules
Refactor all function form C to C++
Support JuiceAgent-API
2026-04-02 14:23:27 +08:00
xiaozhou233 34c8ccd497 Breaking Update: Version 3.0 Build 1 2026-04-02 14:20:33 +08:00
xiaozhou233 f73265ac3e Impl: retransform 2026-04-02 14:19:13 +08:00
xiaozhou233 5e7972779f Impl: getLoadedClasses and getClassByName 2026-04-02 13:57:26 +08:00
xiaozhou233 8ad8f45545 impl: Redefine class 2026-04-02 13:42:19 +08:00
xiaozhou233 71965165b9 Refactor: bytecode.cpp 2026-04-02 13:25:57 +08:00
xiaozhou233 34dbd82a59 Impl: getClassBytes/getClassBytesByName 2026-04-02 13:19:07 +08:00
xiaozhou233 9aa77848d7 BugFix and Update: C++ 20 2026-04-02 12:51:23 +08:00
xiaozhou233 ad69f9d11a Impl: Data Structures and set/map 2026-04-02 12:37:31 +08:00
xiaozhou233 faeaf052b9 WIP: ClassFileLoadHook 2026-04-01 18:14:44 +08:00
xiaozhou233 b0d8b5901f Impl: define / redefine class 2026-04-01 18:00:42 +08:00
xiaozhou233 4496931bdf Impl: addToClassLoader 2026-04-01 10:36:39 +08:00
xiaozhou233 34cb16d385 Refactor & Impl: JuiceAgent and init function and AddToClassLoader 2026-04-01 10:19:40 +08:00
xiaozhou233 bad147d898 modified: src/libagent/CMakeLists.txt 2026-03-31 22:48:55 +08:00
xiaozhou233 289b0311bf break: delete agent src 2026-03-31 22:24:14 +08:00
xiaozhou233 1714f7603d Refactor: header file 2026-03-31 22:18:52 +08:00
xiaozhou233 d6d17aac35 BugFix: null jstring 2026-03-30 19:03:10 +08:00
xiaozhou233 6350bfb0ec Refactor: Rename key 2026-03-30 18:51:19 +08:00
xiaozhou233 8421d3817a Fix: #pragma once 2026-03-30 17:40:14 +08:00
xiaozhou233 3362e2071c Patch: AI Fix 2026-03-30 17:38:46 +08:00
xiaozhou233 72c0518ebc BugFix: No default value was retrieved when the configuration value was empty 2026-03-30 14:19:38 +08:00
xiaozhou233 0a4ec5e97a Impl: Invoke JuiceAgentAPI start 2026-03-30 14:14:40 +08:00
xiaozhou233 15d7f0295a Patch: AI Fix 2026-03-30 13:49:47 +08:00
xiaozhou233 c5817a3b06 Impl: Inject JuiceLoaderAPI 2026-03-30 13:37:51 +08:00
xiaozhou233 e5ac60d476 BugFix: Wrong config key 2026-03-30 13:37:30 +08:00
xiaozhou233 3e3f9d1c14 Impl: Attach JavaVM 2026-03-30 13:28:32 +08:00
xiaozhou233 3ce1bccf02 Impl: Read config and print 2026-03-24 19:56:51 +08:00
xiaozhou233 205e608d60 Refactor: Config System 2026-03-24 19:24:37 +08:00
xiaozhou233 9dab75b5fd [Refactor] Config System 2026-03-24 13:53:54 +08:00
xiaozhou233 c9c10686ab [Refactor] Delete 2026-03-08 10:05:03 +08:00
xiaozhou233 a110e675c6 [Refactor] API 2026-03-07 22:38:36 +08:00
xiaozhou233 9b24ea0ae4 [Refactor] libloader 2026-03-07 17:44:27 +08:00
xiaozhou233 172f354b04 [Refactor] Config 2026-03-07 16:41:20 +08:00
xiaozhou233 cf49ed0a7b [Refactor] Rename 2026-03-01 13:07:00 +08:00
xiaozhou233 ea5ce8258d [Refactor] Rename 2026-03-01 13:03:32 +08:00
xiaozhou233 ab9369d8b7 [Refactor] rename and remove useless log 2026-03-01 13:02:33 +08:00
xiaozhou233 2ce6a8e192 [Refactor] Modify the loader structure 2026-03-01 12:50:33 +08:00
xiaozhou233 d8bed79f84 [Refactor] Rename 2026-03-01 12:38:12 +08:00
xiaozhou233 6ab3c279aa [Doc] Update link 2026-01-30 15:36:42 +08:00
xiaozhou233 a8c2496292 Version 2.3 Build 1 2026-01-30 15:32:49 +08:00
xiaozhou233 94d881fe63 [Feat] AddToClassLoader/AddToSystemClassLoaderSearch/AddToBootstrapClassLoaderSearch 2026-01-15 14:36:55 +08:00
xiaozhou233 d98e3e818e [Refactor] Remove unused code 2026-01-15 14:24:57 +08:00
xiaozhou233 58f76009e4 [Refactor] Class 2026-01-15 14:23:43 +08:00
xiaozhou233 64ca48dfc8 [BugFix] Fix class bytecode retrieval under multi-classloader 2026-01-15 14:16:02 +08:00
xiaozhou233 4ef94b5ac2 [Feat] define 2026-01-15 14:13:29 +08:00
xiaozhou233 339b68c8af [Update] jni header 2026-01-15 14:09:37 +08:00
xiaozhou233 623445aa5e Version 2.2 Build 2 2026-01-09 19:52:49 +08:00
xiaozhou233 cacdb6a1cd [Update] Injector 2025-12-12 11:48:07 +08:00
338 changed files with 57348 additions and 6145 deletions

No files matched your search

+136
View File
@@ -0,0 +1,136 @@
name: CI
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
jobs:
build-and-test:
name: Build & integration tests (Windows, MinGW)
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '25'
- name: Set up MinGW-w64 toolchain
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-binutils
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
- name: Configure
shell: msys2 {0}
run: |
# Link the C/C++ runtime statically, like w64devkit (the toolchain the
# project is built with locally). Without this the DLLs depend on
# libstdc++-6/libgcc_s_seh-1, which can be shadowed by a different
# version elsewhere on the machine and fail to load.
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++" \
-DCMAKE_SHARED_LINKER_FLAGS="-static-libgcc -static-libstdc++"
- name: Build
shell: msys2 {0}
run: |
cmake --build build
echo "compiler: $(command -v g++)"
echo "target: $(gcc -dumpmachine)"
echo "--- imports (non-system DLLs) ---"
objdump -p build/bin/libagent.dll build/bin/libloader.dll build/bin/libinject.dll \
| grep 'DLL Name:' | sed 's/.*DLL Name:[[:space:]]*//' | sort -u
# Bundle whatever non-system DLLs are still imported, taken from the
# toolchain that built them, so the tests can load libagent.dll
# without depending on PATH.
GCC_BIN="$(dirname "$(command -v gcc)")"
deps="$(objdump -p build/bin/libagent.dll build/bin/libloader.dll build/bin/libinject.dll \
| grep 'DLL Name:' | sed 's/.*DLL Name:[[:space:]]*//' | sort -u \
| grep -viE '^(kernel32|user32|advapi32|ws2_32|shell32|ole32|gdi32|msvcrt|ucrtbase|ntdll|comdlg32|comctl32|psapi|version|iphlpapi|bcrypt|secur32|crypt32|winmm|imm32|netapi32|userenv|rpcrt4|setupapi|mswsock|dnsapi|normaliz)[.]dll$' \
| grep -viE '^api-ms-win-')"
for dll in $deps; do
if [ -f "$GCC_BIN/$dll" ]; then
cp -f "$GCC_BIN/$dll" build/bin/
echo "bundled $dll"
else
echo "MISSING $dll (not found in $GCC_BIN)"
fi
done
echo "--- build/bin ---"
ls -1 build/bin
- name: Run integration tests
shell: pwsh
run: |
# Fallback for any remaining runtime DLLs.
$env:PATH = "C:\msys64\mingw64\bin;$env:PATH"
./tests/run-tests.ps1
- name: Package release zip
shell: msys2 {0}
run: cmake -P script/package.cmake
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: JuiceAgent-windows-x64
path: dist/JuiceAgent_*.zip
if-no-files-found: error
retention-days: 14
build-linux:
name: Build (Linux, GCC)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential cmake ninja-build
- name: Configure
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
- name: Build
run: |
cmake --build build
echo "compiler: $(command -v g++)"
echo "target: $(gcc -dumpmachine)"
echo "--- build/bin ---"
ls -1 build/bin
- name: Package release tarball
run: ./script/package.sh
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: JuiceAgent-linux-x64
path: dist/JuiceAgent_*.tar.gz
if-no-files-found: error
retention-days: 14
+4 -5
View File
@@ -1,5 +1,4 @@
.vscode/*
build/*
debug/*
UserDir/*
CMakeCache.txt
build/
.cache/
*.log
dist/
+3
View File
@@ -0,0 +1,3 @@
[submodule "ptrace-inject-cpp"]
path = ptrace-inject-cpp
url = https://github.com/xiaozhou233/ptrace-inject-cpp
+222
View File
@@ -0,0 +1,222 @@
# AGENTS.md
Guidance for AI coding agents (and humans) working in this repository.
## Project at a glance
JuiceAgent is a JVMTI-based runtime injection framework for Windows. It injects
into a running JVM (even with `DisableAttachMechanism=true`, no `-javaagent`),
loads a JAR and calls an entry point, and exposes native APIs to
redefine/retransform classes, query loaded classes and read bytecode.
Four binaries:
| Target | Output | Role |
| --- | --- | --- |
| `injector` | `injector.exe` | CLI driver: loads `libinject.dll` and injects `libloader.dll` into a target PID |
| `libinject` | `libinject.dll` | Reflective DLL injector (exports `inject`, plus JNI bindings) |
| `libloader` | `libloader.dll` | **Reflectively loaded** into the target JVM. Attaches to the JVM, reads `config.toml`, registers the embedded JuiceAgent-API jar, bootstraps the agent |
| `libagent` | `libagent.dll` | The JVMTI agent. Registers `ClassFileLoadHook` and implements the native side of the JuiceAgent-API |
## Toolchain
- Windows x64, MinGW-w64 GCC (the maintainer uses [w64devkit](https://github.com/skeeto/w64devkit)), Ninja, CMake 3.15+
- C++20
- JDK 17+ for the Java side. `--enable-native-access=ALL-UNNAMED` is required from
JDK 22 on to keep `System.load` warning-free (a future JDK will deny native
access without it).
## Build
```powershell
cmake --preset release # or: --preset debug
cmake --build build
```
Binaries land in `build/bin`.
Alternatively, without presets:
```powershell
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build
```
## Test
Integration tests live in `tests/`. They are plain `main()` programs (not JUnit)
that `System.load("resources/libagent.dll")` and call `JuiceAgent.init("")`.
Two of them need the `injection` module compiled into `out/production/injection`.
Build first, then:
```powershell
pwsh tests/run-tests.ps1
# or point it at a specific JDK:
pwsh tests/run-tests.ps1 -JdkHome "C:\Program Files\Zulu\zulu-25"
```
The runner compiles the modules, refreshes `tests/resources` from `build/bin`
(via `tests/copy-bin.bat`), compiles the tests, then runs every test and
**asserts on its output**.
> Running the tests rebuilds the tracked file `tests/injection.jar`. After a local
> run, restore it with `git checkout -- tests/injection.jar` before committing.
## Release
1. Bump `Version.txt` (`Major` / `Minor` / `Patch`).
2. Add `docs/update/vX.Y.Z.md` (bilingual release notes) and an entry in
`docs/update/CHANGELOG.md`.
3. Commit the docs, then commit `Version X.Y.Z`, then tag `vX.Y.Z`.
4. Build the package and attach it to a GitHub Release:
```powershell
cmake -P script/package.cmake # -> dist/JuiceAgent_vX.Y.Z_x64.zip
```
(`script/package.bat` wraps this but ends with `pause`.)
On Linux, `script/package.sh` packs `injector`, `libloader.so` and
`libagent.so` into `dist/JuiceAgent_vX.Y.Z_x64_linux.tar.gz`:
```bash
./script/package.sh
```
`tests/`, `build/`, `dist/` and `*.log` are gitignored; `dist/*.zip` and
`dist/*.tar.gz` are **not** committed.
## Hard rules (each of these was learned by breaking the build or a target JVM)
### 1. `libloader` must never throw a C++ exception
`libloader.dll` is loaded by a **reflective loader (manual mapping)**, so its
unwind tables are never registered with the OS. A C++ exception thrown inside it
**cannot be unwound or caught** - it crashes the target JVM with
`EXCEPTION_ILLEGAL_INSTRUCTION` (a `try/catch` there is useless, not a fix).
- The `loader` target is compiled with `-fno-exceptions` (and
`SPDLOG_NO_EXCEPTIONS`) on purpose: any exception-capable code fails the build.
- Report problems with `spdlog` + an early `return`, never with `throw`.
- This also means library code that can throw (`toml::parse_file`,
`std::filesystem`, allocations) must be used in a non-throwing way. toml++
switches to the non-throwing `toml::parse_result` API automatically when
exceptions are disabled.
### 2. Config reads are non-throwing
`includes/JuiceAgent/Config.hpp` intentionally has **no throwing getters**. Use:
```cpp
if (!cfg.contains("JarLoader.Mode")) { spdlog::error("Missing key: JarLoader.Mode"); return; }
const std::string mode = cfg.get<std::string>("JarLoader.Mode", "");
```
For required values, check `contains()` first and then `get(path, default)`.
### 3. Config schema changes are a coordinated edit
The current schema is v2 (`CONFIG_VERSION` in `includes/JuiceAgent/JuiceAgent.hpp`).
It is validated at load time, so a mismatch makes the loader refuse to start.
Changing the schema requires updating, together:
- `CONFIG_VERSION`
- `docs/config.md`
- the three `examples/*/config.toml`
- the config block in `README.md` **and** `README_ZH.md`
### 4. Keep the MinGW runtime out of the shipped DLLs
Do not introduce a dependency on `libstdc++-6.dll` / `libgcc_s_seh-1.dll` /
`libwinpthread-1.dll`. A DLL that needs them can pick up an incompatible copy
from elsewhere on the machine and fail to load (`UnsatisfiedLinkError: The
specified procedure could not be found`). w64devkit links the runtime statically;
CI passes `-static-libgcc -static-libstdc++` to match.
### 5. Tests assert on output, not exit codes
The test programs print diagnostics and **still exit 0** when a step fails. Match
an expected marker (e.g. `Bytes: 399`, `Modified!`, `Injection Invoked!`) -
checking `$LASTEXITCODE` alone will silently pass broken builds.
Notes when adding tests:
- `GetClassBytesByName` only resolves **already loaded** classes; load the target
first (`Class.forName("Target")`).
- Tests that print to stderr make Windows PowerShell 5.1 unhappy; the runner sets
`$ErrorActionPreference = "Continue"` and relies on explicit checks.
## Layout
```
src/injector injector.exe
src/libinject libinject.dll (reflective injector)
src/libloader libloader.dll (runs in the target; exception-free)
src/libagent libagent.dll (JVMTI agent)
services/ IService implementations, self-registered via JUICEAGENT_REGISTER_SERVICE
includes/eventbus.hpp typed EventBus
includes/JuiceAgent Config.hpp / Logger.hpp / Utils.hpp / JuiceAgent.hpp (CONFIG_VERSION)
includes/toml++ vendored
includes/spdlog vendored
tests/ integration tests + run-tests.ps1 + copy-bin.bat
docs/ config.md, advanced.md, Inject.md, update/ (release notes + changelog)
examples/ runnable end-to-end examples (each has config.toml + HowToUse)
script/ package.cmake / package.bat
```
## Conventions
### Services and the event bus
A service derives from `IService` (`src/libagent/includes/services/base.hpp`) and
self-registers at file scope:
```cpp
JUICEAGENT_REGISTER_SERVICE(::JuiceAgent::Services::MyService)
```
Subscribe with the typed bus - there is no `EventId` and no `void*` casting:
```cpp
listen<MyService, EventLoaded>(&MyService::onLoaded); // append
listenFront<MyService, EventLoaded>(&MyService::onLoaded); // run before others
```
Publish with `EventBus::getInstance().post(event)`. Call `unlistenAll()` in
`onShutdown()`.
### Commit messages
`Type: subject`, then `- component: detail` bullets. Types used here:
`Feat`, `BugFix`, `Refactor`, `Docs`, `CI`, and `Version X.Y.Z` for the release
commit.
### Docs
`README.md` and `README_ZH.md` are kept in sync; keep both updated. Prose docs
live in `docs/` (English). Release notes and the changelog live in `docs/update/`.
### Line endings
Tracked text files are **LF in the index, CRLF in the working tree** (no
`.gitattributes`). When creating files, write CRLF to avoid noisy diffs.
## CI
`.github/workflows/ci.yml` has two jobs:
- `build-and-test` on `windows-latest`: JDK 25 (Temurin) + MinGW-w64 (MSYS2) +
Ninja, then `configure -> build -> tests -> package`, uploading
`dist/JuiceAgent_*.zip` as an artifact (14-day retention).
- `build-linux` on `ubuntu-latest`: GCC + Ninja, then
`configure -> build -> package` only — the integration tests are Windows-only —
uploading `dist/JuiceAgent_*.tar.gz`.
CI-specific notes:
- It builds with `-static-libgcc -static-libstdc++` and also copies any remaining
non-system imported DLLs next to the binaries (see rule 4).
- The workflow prints the DLL import list - useful when a load error appears.
- GitHub's unauthenticated REST API is limited to 60 requests/hour, so avoid
polling workflow status in a loop; install `gh` or use a token instead.
+19 -5
View File
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.15)
project(JuiceAgent LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# output directories
@@ -10,12 +10,26 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(SRC_DIR ${CMAKE_SOURCE_DIR}/src)
link_directories("$ENV{JAVA_HOME}/lib")
if(WIN32)
link_directories("${CMAKE_SOURCE_DIR}/lib")
endif()
# libraries
add_subdirectory(${CMAKE_SOURCE_DIR}/includes/ReflectiveDLLInjection)
if (WIN32)
add_subdirectory(${CMAKE_SOURCE_DIR}/includes/ReflectiveDLLInjection)
else()
set(PTRACE_INJECT_BUILD_CLI OFF CACHE BOOL "" FORCE)
set(PTRACE_INJECT_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory(ptrace-inject-cpp)
endif()
# modules
add_subdirectory(${SRC_DIR}/libloader)
add_subdirectory(${SRC_DIR}/injector)
if(WIN32)
add_subdirectory(${SRC_DIR}/libinject)
endif()
add_subdirectory(${SRC_DIR}/libagent)
add_subdirectory(${SRC_DIR}/libinjector)
add_subdirectory(${SRC_DIR}/libjuiceloader)
+3 -4
View File
@@ -2,16 +2,15 @@
"version": 3,
"configurePresets": [
{
"name": "ninja-release",
"name": "release",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"RELEASE_BUILD": "ON"
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "ninja-debug",
"name": "debug",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
+403
View File
@@ -0,0 +1,403 @@
# Quick Start for Agents
This guide tells an **agent** how to set up a JuiceAgent injection for a user:
ask the right questions, generate the files, run the injection, and verify it.
Work through the steps in order. The result is a self-contained runtime
directory called `app`, plus a short report to the user.
## Ground rules
- Only inject into a JVM that the user owns or is authorized to test. If that is
unclear, stop and ask before doing anything else.
- Do not modify the JuiceAgent native sources. Configuration and payload changes
cover almost every request.
- Keep every file in one runtime directory: `config.toml`, both JARs and the
four binaries. Relative paths only behave predictably when they sit next to
each other (see [Step 4](#step-4--write-configtoml)).
- Never guess a PID. Confirm it with the user or read it from the process list.
## Project overview
JuiceAgent is a JVMTI-based runtime injection framework for Windows. It injects
into a running JVM even when `DisableAttachMechanism=true` and without a
`-javaagent` flag, loads a JAR and calls an entry point, and exposes native APIs
to redefine/retransform classes, query loaded classes and read bytecode.
## Step 1 — Check the environment (do this yourself, do not ask the user)
**1.1 JDK.** `javac`, `jar` and `jps` ship with the JDK, so a full JDK is
required — a bare JRE is not enough.
```
java -version
```
If the JDK is missing or older than 1.8, ask the user to install JDK 1.8 or
higher.
**1.2 JuiceAgent binaries.** When built from source they are in `build/bin`
(release archives put them wherever they were extracted):
```
ls build/bin
```
Expected files:
```
injector.exe libinject.dll libloader.dll libagent.dll
```
If they are missing, ask the user to pick one of:
- **Method 1 (recommended):** download the latest release from
https://github.com/xiaozhou233/JuiceAgent/releases/latest
- **Method 2:** build from source — see the "How To Build" section of `README.md`
**1.3 Create the runtime directory.** Copy the four files into one directory and
call it `app` for the rest of this guide. A complete `app` looks like:
```
app/
├─ injector.exe libinject.dll libloader.dll libagent.dll
├─ config.toml # Step 4
├─ payload.jar # Step 3 (Q3)
├─ injection/ # Step 3 (Q5), dependency JARs; BuiltIn mode only
├─ src/ # payload source, if you generate it
└─ build/ # compiler output, one subdirectory per artifact
├─ target/ # demo target classes
└─ payload/ # payload classes
```
## Step 2 — Gather requirements (ask the user)
Ask these six questions and translate them into the user's language. Each
answer maps to a concrete decision, so do not skip any of them.
| # | Question | Decides |
| --- | --- | --- |
| Q1 | Which process do you want to inject into? (PID / process name / start a demo target — recommended) | the target and its working directory |
| Q2 | Is the target a standard, unmodified JVM? | whether injection will work at all |
| Q3 | What should the injected code do? (verify the link / your own code / modify bytecode) | the payload JAR, entry class and method |
| Q4 | Does the payload need JuiceAgent-API? (yes / no / don't know) | `JarLoader.Mode` |
| Q5 | Does the payload depend on other libraries? (yes / no) | `JarLoader.InjectionDir` |
| Q6 | How should the injection be triggered? (`injector.exe` / JNI JavaInjector) | the commands in Step 5 |
## Step 3 — Apply the answers
### Q1 — Target process
- **PID:** remember it for Step 5.
- **Process name:** resolve it to a PID with `jps -l`. Every JVM appears as
`java.exe`, so match the main class or JAR path in the `jps -l` output, or use
`Get-Process <name>` on Windows.
- **Start a demo target (recommended when the user has no target):** write
`app/target.java`:
```java
import java.lang.management.ManagementFactory;
public class target {
public static void main(String[] args) {
String pid = ManagementFactory.getRuntimeMXBean().getName().split("@")[0];
try {
while (true) {
System.out.println("[Target] I am the target JVM (PID: " + pid + ")");
Thread.sleep(1000);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
```
Compile and run it, **with `app` as the working directory**:
```
javac -encoding UTF-8 --release 8 -d app/build/target app/target.java
```
```powershell
Start-Process -FilePath java -ArgumentList "-cp","build/target","target" -WorkingDirectory "<path-to-app>"
```
The target prints its PID every second; `jps -l` also lists it.
> Starting the target with `app` as its working directory is not cosmetic. See
> [Step 4](#step-4--write-configtoml) for why the working directory decides which
> `config.toml` the injected loader finds.
### Q2 — Standard JVM
- **Standard JVM / `DisableAttachMechanism=true`:** continue — JuiceAgent is
designed for exactly this case.
- **Custom or modified JVM:** continue, but warn the user that JuiceAgent is
only tested against a regular JVM and may not work.
### Q3 — Payload
**Verify the link.** Write `app/src/Main.java`:
```java
public class Main {
public static void run() {
System.out.println("[Demo] Injection succeeded! Hello from JuiceAgent.");
System.out.println("[Demo] Current thread: " + Thread.currentThread().getName());
}
}
```
Build it into `app/payload.jar`. Each artifact gets its own output directory, so
packaging the payload never picks up the demo target's classes:
```
javac -encoding UTF-8 --release 8 -d app/build/payload app/src/Main.java
jar --create --file app/payload.jar -C app/build/payload .
```
The class name `Main` and method name `run` are needed in Step 4.
**Own code.** Ask the user for the payload JAR and record its fully qualified
entry class and method. The entry method must be `public`, `static` and take no
arguments (the project documents this as `public static void`; the return value
is ignored). It is resolved by reflection, so a non-public, non-static or
parameterized method is only reported as a failure at invocation time — the JAR
itself still loads.
**Modify bytecode.** Point the user at `examples/retransform-class`. Payloads
that redefine or retransform classes use JuiceAgent-API, so Q4 must resolve to
`BuiltIn`.
### Q4 — JuiceAgent-API
| Answer | `JarLoader.Mode` |
| --- | --- |
| Yes | `BuiltIn` |
| No | `CustomJar` |
| I don't know | `BuiltIn` |
`BuiltIn` (recommended) runs in two stages, and **both stages read
`config.toml` from the runtime directory**:
1. `libloader` extracts the embedded JuiceAgent-API JAR into `%TEMP%`, adds it
to the system class loader and calls `JuiceAgentBootstrap.start`, which loads
`libagent.dll` (from `JuiceAgentNativeLibraryPath`) and initializes the JVMTI
agent.
2. The agent's `JarLoaderService` reads the `JarLoader.*` keys again, then the
`JarLoader` module adds every `*.jar` in `InjectionDir` to the system class
loader, loads `JarPath` and invokes `EntryClass.EntryMethod`.
`Enabled` and `InjectionDir` are used in `BuiltIn` mode only. Omitting a key
silently falls back to a default, which is a common source of confusion:
`InjectionDir` defaults to `./injection`, `JarPath` to `./Entry.jar`,
`EntryClass` to `Example.Main` and `EntryMethod` to `start`.
`CustomJar` skips JuiceAgent-API and `libagent.dll` entirely: `libloader` adds
`JarPath` itself to the system class loader and invokes the entry method. In this
mode `Enabled` and `InjectionDir` are ignored, so any library the payload needs
must be bundled inside the payload JAR (or already on the target's classpath).
### Q5 — Other libraries
- **Yes:** create `app/injection/` and copy the dependency JARs into it. Every
`*.jar` there is loaded before the payload (`BuiltIn` mode only).
- **No:** still create the empty directory if the config references it, or drop
`InjectionDir` from the config.
### Q6 — Injection way
- **`injector.exe`:** nothing to prepare, continue to Step 4.
- **JNI JavaInjector:** copy the whole `examples/inject-via-java-api/injector`
directory to `app/injector/`, then build it:
```
app\injector\build.bat
```
That directory ships a prebuilt `JuiceAgent-JavaInjector-1.0-SNAPSHOT.jar`;
`build.bat` merges the example's `JavaInjector.class` into it and sets the main
class, so keep the JAR in place.
## Step 4 — Write config.toml
The file must be named exactly `config.toml` and placed in the directory that
`libloader` treats as the **runtime directory** (see the table below). Do not
rename it and do not scatter it across directories.
```toml
# See docs/config.md for more information:
# https://github.com/xiaozhou233/JuiceAgent/blob/main/docs/config.md
[JuiceAgent]
Version = 2
JuiceAgentNativeLibraryPath = ""
[JarLoader]
# BuiltIn: use the built-in jar loader (recommended; supports JuiceAgent-API)
# CustomJar: load the JAR directly, without JuiceAgent-API
# https://github.com/xiaozhou233/JuiceAgent/blob/main/docs/advanced.md#load-custom-api--directly-load-jar
Enabled = true
# Q4
Mode = "BuiltIn"
# BuiltIn mode only; Q5
InjectionDir = "./injection"
# Q3
JarPath = "./payload.jar"
EntryClass = "Main"
EntryMethod = "run"
```
- `Version` must stay `2`. A mismatch makes the loader refuse to start.
- `JuiceAgentNativeLibraryPath = ""` means "`libagent.dll` in the runtime
directory". Change it to an absolute path only if `libagent.dll` lives
elsewhere.
- `Mode = "CustomJar"` requires `JarPath`, `EntryClass` and `EntryMethod`
(there are no defaults in that mode); `Enabled` and `InjectionDir` are unused.
- Paths starting with `./` are resolved against the runtime directory; absolute
paths are used as-is.
### Which directory is the runtime directory?
This is where most failed setups go wrong: `libloader` does not take the config
directory from the `injector.exe` command line.
| How you inject | Directory `config.toml` is read from |
| --- | --- |
| Interactive `injector.exe` (type the PID) | the **injector process's** current directory — so `cd app` first |
| `injector.exe <pid> <libloader.dll> [libinject.dll]` | the **target JVM's** current directory (no directory is passed) |
| JavaInjector (JNI) | the `config_path` you enter; an empty value falls back to the target JVM's working directory |
Consequences:
- With the argument form, `config.toml` **and** every `./` path inside it
(`JarPath`, `InjectionDir`, `libagent.dll`) resolve against the target JVM's
working directory.
- If the user cannot control the target's working directory, use absolute paths
in `config.toml` — including `JuiceAgentNativeLibraryPath`.
- JNI injection is the most predictable option, because the config directory is
passed explicitly.
## Step 5 — Run the injection
### 5.1 Use `injector.exe`
```
cd app
```
`cd app` matters: `injector.exe` loads `libinject.dll` **by name from the
current directory**, and in interactive mode the current directory is also the
runtime directory.
**Interactive:**
```
.\injector.exe
```
It prints the `jps -l` output, then `Input PID:`. Type the PID of the target JVM
and press Enter.
> The program always ends with `Press any key to exit...` and waits for stdin.
> If you drive it from a script, feed it a newline after the PID and do not wait
> for the process to exit on its own.
**With arguments:**
```
.\injector.exe <PID> "<path-to-app>\libloader.dll" "<path-to-app>\libinject.dll"
```
The third argument is the path to **`libinject.dll`**, not a config directory.
Omit it to let `injector.exe` load `libinject.dll` from the current directory.
Remember that this form reads `config.toml` from the *target's* working
directory (Step 4).
### 5.2 Use JNI JavaInjector
Run it from `app`, because the example loads `./libinject.dll`:
```
java -cp injector\JuiceAgent-JavaInjector-1.0-SNAPSHOT.jar JavaInjector
```
```
PID: 1234
Dll: <path-to-app>\libloader.dll
config_path: <path-to-app>
```
Enter the target PID, the path to `libloader.dll`, and the directory containing
`config.toml`. Leaving `config_path` empty behaves like the argument form above:
the runtime directory falls back to the **target JVM's** working directory, so
always pass the directory explicitly.
## Step 6 — Verify
Verification has two independent sources. Do not confuse them: the
`[JuiceAgent JarLoader]` progress lines are printed to the **target's stdout**,
while the diagnostic logs are written to **files**.
**1. Target stdout** — this is the user-visible proof:
```
[JuiceAgent API] RuntimeDir : <the directory actually used>
[JuiceAgent JarLoader] Loading entry jar: ...
[JuiceAgent JarLoader] Resolving class: Main
[JuiceAgent JarLoader] Invoking method: Main.run
[JuiceAgent JarLoader] Entry method invoked successfully.
[Demo] Injection succeeded! Hello from JuiceAgent.
```
The `[JuiceAgent API]` banner prints the effective runtime directory and the
native library path, which is the fastest way to confirm the Step 4 rules.
**2. Log files** — two files are written **relative to the target JVM's working
directory** and truncated on every injection:
| File | Look for |
| --- | --- |
| `libloader.log` | `DllMain: DLL_PROCESS_ATTACH, runtime_dir:` and `[PreLoad] Runtime directory:` |
| `libagent.log` | `[JuiceAgent] Added JVMTI capabilities`, `[JarLoaderService] Loaded jar:`, and `JNI Exception occurred at:` when the payload itself throws |
If the target has no console (a service or a detached window), the stdout
markers are invisible — verify through the log files instead.
Report the outcome to the user, including the exact `app` path, the injection
command used, and the observed output.
## Troubleshooting
| Symptom | Likely cause |
| --- | --- |
| Injection reports success but nothing happens | `config.toml` is not in the directory `libloader` actually used — see Step 4 |
| `RuntimeDir :` in the banner is not `app` | The runtime directory fell back to the target JVM's working directory — see Step 4 |
| `[JuiceAgent API] JuiceAgent library not found at: <path>` | `libagent.dll` could not be resolved — set an absolute `JuiceAgentNativeLibraryPath`, or fix the runtime directory |
| `Failed to load injector library` / error 2 | `injector.exe` was not started from `app`, and no `libinject.dll` path was passed |
| `Failed to open DLL file` | The `libloader.dll` path is wrong |
| `libloader.log` / `libagent.log` seem missing | They are written in the target JVM's working directory, not your shell's |
| Loader refuses to start | `[JuiceAgent] Version` is not `2` |
| `Missing required config key: JarLoader.Mode` | `JarLoader.Mode` was omitted |
| Errors about missing `JarPath` / `EntryClass` / `EntryMethod` | `Mode = "CustomJar"` requires all three |
| `Failed to load jar: ...\Entry.jar` | `JarPath` was omitted and the default was used |
| The JAR loads but the entry call fails | The method is not `public static` with no parameters, or `EntryClass` is not fully qualified |
| `JNI Exception occurred at: CallStaticVoidMethod failed` | The payload threw — read the stack trace printed next to it |
| The injected process hangs for ~30 s, then `Failed to attach to JVM!` | The target process is not a JVM (the loader retries 30 × 1 s before giving up) |
| `jps` does not list the target | The target is 32-bit (JuiceAgent ships x64 only) or runs with different privileges |
| Injection fails on an elevated target | Run `injector.exe` elevated too |
| Antivirus flags the binaries | Expected false positive — see `docs/Antivirus-False-Positive.md` |
| Native-access warning on JDK 22+ | The payload loads a native library; the target JVM needs `--enable-native-access=ALL-UNNAMED` |
## Done checklist
- [ ] A JDK 1.8+ with `javac`, `jar` and `jps` is available
- [ ] `app/` contains all four JuiceAgent binaries
- [ ] The payload JAR exists and its entry method is `public static` and takes no arguments
- [ ] `config.toml` is in the directory `libloader` actually uses (Step 4), `Version = 2`, and every key matches the Q3–Q5 answers
- [ ] The injection command reported success
- [ ] The `[JuiceAgent API]` banner shows the expected `RuntimeDir`, and the payload output appears with no errors in the logs
+307 -100
View File
@@ -1,127 +1,334 @@
# JuiceAgent
[English]() | [中文]()
JuiceAgent — a JVMTI-based injection library for loading external JARs and transforming Java bytecode, even when DisableAttachMechanism is enabled.
[English](README.md) | [简体中文](README_ZH.md)
**NOTICE:** Currently only supports **Windows**, and plans to support **Linux** in the future.
JuiceAgent is an advanced JVMTI-based injection framework for runtime JAR loading, bytecode transformation, and runtime JVM instrumentation. It injects into a running JVM process even when `DisableAttachMechanism=true`, without requiring `-javaagent` startup arguments or the attach mechanism.
**WARNING:** This project is still in the experimental stage and is not recommended for production use.
**Use this at your own risk.**
Two platforms are supported:
- **Windows x64** — reflective DLL injection (`injector.exe` + `libinject.dll`).
- **Linux x64** — `ptrace` attach plus a remote `dlopen` call that makes the target JVM load `libloader.so` itself.
**Warning**: This project is still experimental and is not recommended for production use. Use it at your own risk.
> **Tips**: Some antivirus software may flag JuiceAgent as malware. See [Antivirus False Positive Notice](docs/Antivirus-False-Positive.md) for details.
**Note**: This project is designed for a regular JVM. Custom JVMs may not be able to run it.
Welcome to join our QQ/Discord group for more information and support:
- Discord: [JuiceDev](https://discord.gg/AQTnUyWNNJ)
- QQ Group: 1103504356
> **New to JuiceAgent?** You do not have to wire up the injection by hand. A
> coding agent such as OpenCode can do it for you: open this repository in the
> agent and ask it to read [`QuickStartForAgents.md`](QuickStartForAgents.md) and
> follow it. That guide covers the whole process — environment check, requirement
> gathering, `config.toml`, injection and verification — and is written to be
> executed by an agent. Simply tell the agent:
> "Read `QuickStartForAgents.md` and follow it to inject my JAR."
![License](https://img.shields.io/github/license/xiaozhou233/JuiceAgent)
![Release](https://img.shields.io/github/v/release/xiaozhou233/JuiceAgent)
![GitHub last commit](https://img.shields.io/github/last-commit/xiaozhou233/JuiceAgent)
![GitHub repo size](https://img.shields.io/github/repo-size/xiaozhou233/JuiceAgent)
![Downloads](https://img.shields.io/github/downloads/xiaozhou233/JuiceAgent/total)
![Java](https://img.shields.io/badge/Java-8+-orange)
![C++](https://img.shields.io/badge/C++-20-blue)
![JNI](https://img.shields.io/badge/JNI-Native-green)
![CMake](https://img.shields.io/badge/CMake-Build-red)
![Platform](https://img.shields.io/badge/Platform-Windows%20%7C%20Linux-lightgrey)
![JVMTI](https://img.shields.io/badge/JVMTI-Agent-success)
![Injection](https://img.shields.io/badge/Runtime-Injection-blueviolet)
![Bytecode](https://img.shields.io/badge/Bytecode-Transform-blue)
![Attach](https://img.shields.io/badge/DisableAttach-Bypass-important)
## Index
- [JuiceAgent](#juiceagent)
- [Introduction](#introduction)
- [How It Works](#how-it-works)
- [Features](#features)
- [Project Structure](#project-structure)
- [Quick Start](#quick-start)
- [Linux Support](#linux-support)
- [JuiceAgent API](#juiceagent-api)
- [Examples](#examples)
- [How To Build](#how-to-build)
- [Full Disclaimer](#full-disclaimer)
- [Acknowledgements](#acknowledgements)
## Introduction
JuiceAgent is the native implementation of the [JuiceAgent-API](https://github.com/xiaozhou233/JuiceAgent-API). It loads external JARs into a running JVM, invokes a specified entry class/method, and redefines or retransforms already-loaded classes — all without a `-javaagent` startup flag and even when `DisableAttachMechanism=true`.
With JuiceAgent, developers can:
- Dynamically load external JARs into a running JVM process
- Invoke a specified entry class and method after injection
- Redefine already loaded classes at runtime
- Retransform bytecode for instrumentation or modification
- Query loaded classes and read class bytecode
**If you have any questions or suggestions, please feel free to open an issue or submit a pull request. =D**
## How It Works
1. `injector.exe` (or `libinject.dll` via JNI) reflectively injects `libloader.dll` into the target JVM process.
2. `libloader.dll` attaches to the JVM, reads `config.toml`, extracts the embedded `JuiceAgent-API` jar, and adds it to the system class loader search path.
3. The loader bootstraps the agent: it loads `libagent.dll` and initializes the JVMTI agent (`JuiceAgent::Agent`).
4. The agent registers JVMTI callbacks and starts the configured modules (e.g. `JarLoader`), which loads the target JAR and invokes the entry class/method.
The `JuiceAgent-API` jar is embedded in the native binaries, so no separate download is required.
On Linux the pipeline is the same, only the injection step changes. The injector
attaches to the target process with `ptrace`, saves its registers, and performs a
remote `dlopen` so the JVM loads `libloader.so` in-process (no `LD_PRELOAD`, no
`-javaagent`). `libloader.so` then starts from an ELF constructor, resolves its
runtime directory (`JuiceAgent_ConfigPath`, or `$HOME/.juiceagent` by default),
and drives the agent exactly like the Windows loader. See
[Linux Support](#linux-support).
## Summary
JuiceAgent is a JVMTI-native injection framework that injects native code into a target JVM to dynamically load external JARs and perform bytecode redefinition/transformations without requiring a javaagent (works when DisableAttachMechanism=true).
## Features
### JuiceAgent (src/libagent)
- Initialize JuiceLoader
- Lightweight Library (No Javaagent)
- Read Config File and Load JARs
- Invoke JuiceLoader Bootstrap API
### libinjector (src/libinjector)
- Provides JNI functions for injecting DLLs into target processes
- Get PID by process name
- Load external JARs into the Bootstrap or System ClassLoader
- Add JARs to an arbitrary class loader
- Define classes dynamically
- Redefine classes by name or class reference
- Retransform classes by name or class reference
- Get all loaded classes
- Find a class by name
- Get class bytecode by name or class reference
- Automatic JVM attachment that works with `DisableAttachMechanism=true`
### JuiceLoader Native (src/juiceloader)
Native library for [JuiceLoader](https://github.com/xiaozhou233/JuiceLoader) , Inject Jars/ Redefine class Low-level implementation.
- Implements JuiceLoader's native API
- init
- injectJar
- redefineClass (redefineClassByName)
- retransformClass (retransformClassByName)
- getLoadedClasses
- getClassBytes (getClassBytesByName)
- getClassByName
- nativeGetThreadByName* (test function, myself-use)
- nativeInjectJarToThread (test function, myself-use)
## How To Use (For Version 2.2 Build 1)
## Project Structure
### 1. Download Files
- Download `libagent`, `libinjector`, and `libjuiceloader` from the Release to the same directory.
- Download JARs `bootstrap-api.jar`, `JuiceLoader.jar`, and `Entry.jar` (or your own JAR) to the same directory.
- `src/libloader` — `libloader.dll` (Windows) / `libloader.so` (Linux). Injected into the target JVM. Attaches to the JVM, parses `config.toml`, injects the embedded `JuiceAgent-API`, and bootstraps the agent.
- `src/libagent` — `libagent.dll` (Windows) / `libagent.so` (Linux). The JVMTI agent. Registers callbacks (e.g. `ClassFileLoadHook`) and implements the native side of `JuiceAgent-API`.
- `src/injector` — `injector.exe` (Windows) / `injector` (Linux). Command-line driver that loads the loader into the target process.
- `src/libinject` — `libinject.dll` (Windows only). Reflective DLL injector. Exposes a native `inject` function and JNI bindings (`cn.xiaozhou233.juiceagent.injector.InjectorNative`).
### 2. Write Config File
Create a config file named `AgentConfig.toml` in the same directory. Example:
## Quick Start
**You can also see the [examples](https://github.com/xiaozhou233/JuiceAgent/tree/main/examples) directory for more detailed usage examples.**
### 1. Download Release
Download `JuiceAgent_vx.x.x_x64.zip` from the [releases](https://github.com/xiaozhou233/JuiceAgent/releases) page.
> **Linux users**: Linux builds are **not** attached to GitHub Releases. Download
> them from the [Jenkins job](https://jenkins.xiaozhou233.cn/job/JuiceAgent/)
> instead — see [Linux Support](#linux-support).
Extract the ZIP file to a directory:
- YourDir
- libagent.dll
- libinject.dll
- libloader.dll
- injector.exe
### 2. Copy your Custom JAR / Dependencies
- YourDir
- libagent.dll
- libinject.dll
- libloader.dll
- injector.exe
- **MyCustomJar.jar**
- **injection**
- **Dependencies1.jar**
- **Dependencies2.jar**
### 3. Write Config
```toml
# Leave empty to use default values
# Default values: <Current Directory>/default-name
[JuiceAgent]
Version = 2
# Path to libagent.dll, default is "./libagent.dll" (relative to the runtime directory)
JuiceAgentNativeLibraryPath = ""
# Example: JuiceLoaderJarPath = "D:\\Development\\JuiceSky\\build\\libs\\JuiceLoader-1.0.jar"
# Default: <Current Directory>/JuiceLoader.jar
JuiceLoaderJarPath = ""
# Default: <Current Directory>/libjuiceloader.dll
JuiceLoaderLibraryPath = ""
# Default: <Current Directory>/injection/
InjectionDir = ""
# Default: <Current Directory>/Entry.jar
EntryJarPath = "D:\\Development\\JuiceSky\\build\\libs\\JuiceSky-1.0-Hooked.jar"
EntryClass = "cn.xiaozhou233.juicesky.LoaderEntry"
EntryMethod = "start"
```
| Method| Usage|
| - | -|
| **Reflective Inject** | Uses `libinjector`. Pass the config directory as a parameter. </br></br> Example: config file at `<YourDir>/AgentConfig.toml`, </br></br>pass `<YourDir>` as parameter.</br></br> Example:</br>`C/C++: libinjector.dll -> inject(pid, agentpath, configpath)`</br>`Java: See 3. Invoke Inject Function`|
| **Normal Inject** | Uses `LoadLibraryA + CreateRemoteThread`. Keep `AgentConfig.toml` and all DLLs/JARs in the same directory.</br>
### 3. Invoke Inject Function
C/C++ Use libinjector and invoke inject(int pid, char* path, InjectParameters *params)
Java Use `Injecor.jar`: `java -jar Injecor.jar` or
```
package cn.xiaozhou233.juiceagent.injector;
public class InjectorNative {
/*
* @param pid target process id
*/
public native boolean inject(int pid, String path);
/*
* @param pid target process id
* @param path injection dll path
* @param configPath config file path
*/
public native boolean inject(int pid, String path, String configPath);
}
```
```
// Your class
import cn.xiaozhou233.juiceagent.injector.InjectorNative;
System.load("<path-to-libinjector>");
InjectorNative injectorNative = new InjectorNative();
injectorNative.inject(<pid>, "<path-to-libagent>", "<path-to-toml-config-dir>");
[JarLoader]
Enabled = true
# Mode: BuiltIn | CustomJar
Mode = "BuiltIn"
# Directory containing dependency JARs to load first (BuiltIn mode)
InjectionDir = "./injection"
# Path to the JAR file to be loaded
JarPath = "./MyCustomJar.jar"
# Entry class to be executed after loading the JAR
EntryClass = "Example.Main"
# Entry method, must be: public static void run()
EntryMethod = "run"
```
### 4. Done!
If the injection is successful, EntryClass .EntryMethod() of <EntryJarPath> will be executed.
## Hot To Build
### Environment
Save the file as `config.toml` in the same directory (the runtime directory). Relative paths are resolved against the runtime directory. See [Configuration](docs/config.md) for the complete reference.
- YourDir
- **config.toml**
- libagent.dll
- libinject.dll
- libloader.dll
- injector.exe
- MyCustomJar.jar
- injection
- Dependencies1.jar
- Dependencies2.jar
### 4. Run the Injector
#### Method A: Use `injector.exe`
Run `injector.exe` from `YourDir`:
```text
<jps output>
Input PID:
```
Enter the PID of the target JVM process and press Enter.
You can also pass arguments directly: `injector.exe <pid> <libloader.dll path> [libinject.dll path]`.
#### Method B: Use JNI to call `inject`
See [Inject](docs/Inject.md)
### 5. Done
The target JVM will load the specified JAR and execute the specified entry class and method.
## Linux Support
JuiceAgent also works on Linux x64. Instead of reflective DLL injection, the
Linux injector uses `ptrace` to attach to the target process and then performs a
**remote `dlopen`**: it saves the thread state, makes the target call
`dlopen("libloader.so", RTLD_NOW)`, restores the state and detaches. The JVM
therefore loads the loader itself — no `LD_PRELOAD` and no `-javaagent` — and the
rest of the pipeline is identical to Windows.
### Download
Linux builds are **not** published on GitHub Releases. Download the latest
successful build from the Jenkins job:
```text
https://jenkins.xiaozhou233.cn/job/JuiceAgent/
```
Grab the build artifact (`JuiceAgent_vX.Y.Z_x64_linux.tar.gz`) from the most
recent successful build, then extract `injector`, `libloader.so` and
`libagent.so` from it.
### Components
- `libloader.so` — loaded into the target JVM, starts from an ELF constructor.
- `libagent.so` — the JVMTI agent. This is the default
`JuiceAgentNativeLibraryPath` on Linux (instead of `libagent.dll`).
- `injector` — attaches to the target PID and performs the remote `dlopen`.
### Configuration location
On Linux the loader does **not** look in the current working directory. It
resolves the runtime directory in this order:
1. `JuiceAgent_ConfigPath` — if the environment variable is set and non-empty, it
is used as-is.
2. `$HOME/.juiceagent` — the default; created automatically if it does not exist.
`config.toml` is read from that directory. The schema is identical to Windows
and relative paths (`JarPath`, `InjectionDir`, ...) are resolved against it, so a
typical layout is:
```text
~/.juiceagent/
├── config.toml
├── MyCustomJar.jar
└── injection/
└── Dependencies.jar
```
To point the loader at another directory:
```bash
export JuiceAgent_ConfigPath=/opt/juiceagent
```
### Requirements
- Run the injector as the same user as the target JVM (or as `root`), and make
sure `ptrace` is permitted. If injection fails with `EPERM`, check
`/proc/sys/kernel/yama/ptrace_scope`.
- The target JVM and the loader must both be x64.
> **Note**: The Linux injector binary is not open source yet. The `injector`
> target in this repository is a placeholder that only prints a notice; the
> loader and the agent are fully open source and build from this tree.
## JuiceAgent API
The following native functions are exposed to Java through the `cn.xiaozhou233.juiceagent.api.JuiceAgent` class (see the [JuiceAgent-API](https://github.com/xiaozhou233/JuiceAgent-API) project for the Java API definition):
- `init(String runtimeDir)` — initialize the agent from Java
- `addToBootstrapClassLoaderSearch(String jarPath)`
- `addToSystemClassLoaderSearch(String jarPath)`
- `addToClassLoader(String jarPath, ClassLoader targetClassLoader)`
- `defineClass(ClassLoader targetClassLoader, byte[] bytes)` — returns `Class<?>`
- `redefineClass(Class<?> clazz, byte[] classBytes, int length)`
- `redefineClassByName(String className, byte[] classBytes, int length)`
- `retransformClass(Class<?> clazz, byte[] bytecodes, int length)`
- `retransformClassByName(String className, byte[] bytecodes, int length)`
- `getLoadedClasses()` — returns `Class<?>[]`
- `getClassByName(String name)` — returns `Class<?>`
- `getClassBytes(Class<?> clazz)` — returns `byte[]`
- `getClassBytesByName(String name)` — returns `byte[]`
## Examples
- `examples/inject-via-java-api` — injects JuiceAgent into a running JVM through the Java API (JNI), without needing `injector.exe`.
- `examples/load-via-injector-exe` — loads a JAR into a target JVM via `injector.exe` and runs an entry point.
- `examples/retransform-class` — demonstrates class retransformation with a target JVM and a modified copy of the class.
## How To Build
### Requirements
- Java 8+
- MinGW
- CMake
- MinGW-w64 (Windows) or GCC/Clang (Linux)
- CMake 3.15+
- Ninja
```
### Build with CMake Presets
```powershell
git clone https://github.com/xiaozhou233/JuiceAgent.git
cd JuiceAgent
mkdir -p build
cmake --build build --
cmake --preset release
cmake --build build
```
dlls: build/bin/
jars: see [JuiceLoader](https://github.com/xiaozhou233/JuiceLoader)
### Manual Build
## Full Disclaimer/ 完整免责声明
Disclaimer: This 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 their actions are legal and compliant.
```powershell
git clone https://github.com/xiaozhou233/JuiceAgent.git
cd JuiceAgent
免责声明: 本项目仅建议在受控环境中用于学习与研究。任何利用本项目实施破解、篡改、未经授权获取源码或其他违反目标协议或法律的行为所导致的一切后果,作者概不负责。使用者应自行确保其行为合法合规,并对相应后果承担全部责任。
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build
```
The generated binaries will be placed in `build/bin`. On Linux this produces
`libloader.so`, `libagent.so` and `injector`; on Windows the `.dll` / `.exe`
equivalents.
## Full Disclaimer
This 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.
## Acknowledgements
- [ReflectiveDLLInjection](https://github.com/stephenfewer/ReflectiveDLLInjection) - DLL Inject
- [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.
- [ReflectiveDLLInjection](https://github.com/stephenfewer/ReflectiveDLLInjection) — DLL injection implementation
- [spdlog](https://github.com/gabime/spdlog) — Fast C++ logging library
- [toml11](https://github.com/ToruNiina/toml11) — TOML for Modern C++
+307
View File
@@ -0,0 +1,307 @@
# JuiceAgent
[English](README.md) | [简体中文](README_ZH.md)
> **注意**:本文档由 AI 自动翻译,可能存在不准确或不通顺之处,请以 [英文版 README](README.md) 为准。如有疑问欢迎提 issue 或 PR 修正。
JuiceAgent 是一个基于 JVMTI 的高级注入框架,用于运行时 JAR 加载、字节码变换和运行时 JVM 插桩。它可以在 `DisableAttachMechanism=true` 的情况下注入到正在运行的 JVM 进程中,无需 `-javaagent` 启动参数,也无需使用 attach 机制。
目前支持两个平台:
- **Windows x64**——反射式 DLL 注入(`injector.exe` + `libinject.dll`)。
- **Linux x64**——通过 `ptrace` 附加目标进程,再用一次远程 `dlopen` 让目标 JVM 自己加载 `libloader.so`。
**警告**:本项目仍处于实验阶段,不建议用于生产环境。使用风险自负。
> **提示**:部分杀毒软件可能将 JuiceAgent 误报为恶意软件。详情见[杀毒软件误报说明](docs/Antivirus-False-Positive.md)。
**注意**:本项目针对标准 JVM 设计,自定义 JVM 可能无法运行。
欢迎加入我们的 QQ / Discord 群组获取更多信息和支持:
- Discord:[JuiceDev](https://discord.gg/AQTnUyWNNJ)
- QQ 群:1103504356
> **不知道该怎么用?** 不必手动折腾注入流程:用支持读写文件和执行命令的 AI Agent(例如 OpenCode)即可。在本仓库中打开 Agent,让它先阅读 [`QuickStartForAgents.md`](QuickStartForAgents.md) 并照着执行——该文档覆盖了完整流程(环境检查、需求确认、`config.toml`、注入与验证),并且是专门写给 Agent 执行的。你只需要告诉它:
> "请阅读 `QuickStartForAgents.md`,并照着里面的步骤把我的 JAR 注入到目标 JVM。"
![License](https://img.shields.io/github/license/xiaozhou233/JuiceAgent)
![Release](https://img.shields.io/github/v/release/xiaozhou233/JuiceAgent)
![GitHub last commit](https://img.shields.io/github/last-commit/xiaozhou233/JuiceAgent)
![GitHub repo size](https://img.shields.io/github/repo-size/xiaozhou233/JuiceAgent)
![Downloads](https://img.shields.io/github/downloads/xiaozhou233/JuiceAgent/total)
![Java](https://img.shields.io/badge/Java-8+-orange)
![C++](https://img.shields.io/badge/C++-20-blue)
![JNI](https://img.shields.io/badge/JNI-Native-green)
![CMake](https://img.shields.io/badge/CMake-Build-red)
![Platform](https://img.shields.io/badge/Platform-Windows%20%7C%20Linux-lightgrey)
![JVMTI](https://img.shields.io/badge/JVMTI-Agent-success)
![Injection](https://img.shields.io/badge/Runtime-Injection-blueviolet)
![Bytecode](https://img.shields.io/badge/Bytecode-Transform-blue)
![Attach](https://img.shields.io/badge/DisableAttach-Bypass-important)
## 目录
- [JuiceAgent](#juiceagent)
- [简介](#简介)
- [工作原理](#工作原理)
- [特性](#特性)
- [项目结构](#项目结构)
- [快速开始](#快速开始)
- [Linux 支持](#linux-支持)
- [JuiceAgent API](#juiceagent-api)
- [示例](#示例)
- [如何构建](#如何构建)
- [完整免责声明](#完整免责声明)
- [致谢](#致谢)
## 简介
JuiceAgent 是 [JuiceAgent-API](https://github.com/xiaozhou233/JuiceAgent-API) 的原生实现。它可以将外部 JAR 加载到正在运行的 JVM 中、调用指定的入口类/方法,并重新定义或重变换已加载的类——全程无需 `-javaagent` 启动参数,即使 `DisableAttachMechanism=true` 也能工作。
使用 JuiceAgent 可以做到:
- 将外部 JAR 动态加载到正在运行的 JVM 进程
- 注入后调用指定的入口类和入口方法
- 在运行时重新定义已加载的类
- 重变换字节码以进行插桩或修改
- 查询已加载的类并读取类的字节码
**如果你有任何问题或建议,欢迎提 issue 或提交 pull request。=D**
## 工作原理
1. `injector.exe`(或通过 JNI 调用 `libinject.dll`)将 `libloader.dll` 反射注入到目标 JVM 进程。
2. `libloader.dll` 附加到 JVM,读取 `config.toml`,解出内嵌的 `JuiceAgent-API` jar 并将其加入系统类加载器的搜索路径。
3. 加载器引导 agent:加载 `libagent.dll` 并初始化 JVMTI agent(`JuiceAgent::Agent`)。
4. agent 注册 JVMTI 回调并启动配置的模块(例如 `JarLoader`),加载目标 JAR 并调用入口类/方法。
`JuiceAgent-API` jar 内嵌于原生二进制中,无需单独下载。
Linux 上的流程与此相同,只有注入这一步不同。注入器通过 `ptrace` 附加到目标进程,保存线程状态,发起一次远程 `dlopen` 让 JVM 在自身进程内加载 `libloader.so`(无需 `LD_PRELOAD`,也无需 `-javaagent`)。随后 `libloader.so` 从 ELF constructor 启动,解析运行时目录(`JuiceAgent_ConfigPath`,默认 `$HOME/.juiceagent`),之后与 Windows 加载器完全一致地驱动 agent。详见 [Linux 支持](#linux-支持)。
## 特性
- 将外部 JAR 加载到 Bootstrap 或 System ClassLoader
- 将 JAR 添加到任意类加载器
- 动态定义类
- 按名称或类引用重新定义类
- 按名称或类引用重变换类
- 获取所有已加载的类
- 按名称查找类
- 按名称或类引用获取类的字节码
- 自动附加 JVM,支持 `DisableAttachMechanism=true`
## 项目结构
- `src/libloader` — `libloader.dll`(Windows)/ `libloader.so`(Linux)。注入到目标 JVM,附加 JVM、解析 `config.toml`、注入内嵌的 `JuiceAgent-API` 并引导 agent。
- `src/libagent` — `libagent.dll`(Windows)/ `libagent.so`(Linux)。JVMTI agent。注册回调(例如 `ClassFileLoadHook`)并实现 `JuiceAgent-API` 的原生侧。
- `src/injector` — `injector.exe`(Windows)/ `injector`(Linux)。命令行驱动,将加载器注入到目标进程。
- `src/libinject` — `libinject.dll`(仅 Windows)。反射式 DLL 注入器,导出原生 `inject` 函数并提供 JNI 绑定(`cn.xiaozhou233.juiceagent.injector.InjectorNative`)。
## 快速开始
**你也可以查看 [examples](https://github.com/xiaozhou233/JuiceAgent/tree/main/examples) 目录获取更详细的使用示例。**
### 1. 下载 Release
从 [releases](https://github.com/xiaozhou233/JuiceAgent/releases) 页面下载 `JuiceAgent_vx.x.x_x64.zip`。
> **Linux 用户注意**:Linux 构建**不会**发布在 GitHub Release 上,请从
> [Jenkins](https://jenkins.xiaozhou233.cn/job/JuiceAgent/) 下载,详见
> [Linux 支持](#linux-支持)。
解压 ZIP 到一个目录:
- YourDir
- libagent.dll
- libinject.dll
- libloader.dll
- injector.exe
### 2. 拷贝自定义 JAR / 依赖
- YourDir
- libagent.dll
- libinject.dll
- libloader.dll
- injector.exe
- **MyCustomJar.jar**
- **injection**
- **Dependencies1.jar**
- **Dependencies2.jar**
### 3. 编写配置
```toml
[JuiceAgent]
Version = 2
# libagent.dll 的路径,默认是 "./libagent.dll"(相对于运行时目录)
JuiceAgentNativeLibraryPath = ""
[JarLoader]
Enabled = true
# Mode:BuiltIn | CustomJar
Mode = "BuiltIn"
# 需要优先加载的依赖 JAR 所在目录(BuiltIn 模式)
InjectionDir = "./injection"
# 要加载的 JAR 文件路径
JarPath = "./MyCustomJar.jar"
# 加载 JAR 后要执行的入口类
EntryClass = "Example.Main"
# 入口方法,必须是:public static void run()
EntryMethod = "run"
```
将文件保存为 `config.toml` 并放在同一目录(运行时目录)中。相对路径以运行时目录为基准解析。完整配置说明见 [Configuration](docs/config.md)。
- YourDir
- **config.toml**
- libagent.dll
- libinject.dll
- libloader.dll
- injector.exe
- MyCustomJar.jar
- injection
- Dependencies1.jar
- Dependencies2.jar
### 4. 运行注入器
#### 方法 A:使用 `injector.exe`
在 `YourDir` 下运行 `injector.exe`:
```text
<jps output>
Input PID:
```
输入目标 JVM 进程的 PID 并按回车。
也可以直接传参:`injector.exe <pid> <libloader.dll 路径> [libinject.dll 路径]`。
#### 方法 B:通过 JNI 调用 `inject`
看 [Inject](docs/Inject.md)
### 5. 完成
目标 JVM 将加载指定的 JAR 并执行指定的入口类和入口方法。
## Linux 支持
JuiceAgent 同样支持 Linux x64。与反射式 DLL 注入不同,Linux 注入器使用 `ptrace` 附加目标进程,然后执行一次**远程 `dlopen`**:保存线程状态,让目标进程调用 `dlopen("libloader.so", RTLD_NOW)`,恢复状态并 detach。这样由 JVM 自己加载加载器——无需 `LD_PRELOAD`,也无需 `-javaagent`——其后的流程与 Windows 完全一致。
### 下载
Linux 构建**不会**发布在 GitHub Release 上,请从 Jenkins 任务下载最新一次成功的构建:
```text
https://jenkins.xiaozhou233.cn/job/JuiceAgent/
```
选择最近一次成功的构建,下载其产物(`JuiceAgent_vX.Y.Z_x64_linux.tar.gz`),从中解出
`injector`、`libloader.so` 和 `libagent.so`。
### 组件
- `libloader.so` —— 加载进目标 JVM,从 ELF constructor 启动。
- `libagent.so` —— JVMTI agent。在 Linux 上它是 `JuiceAgentNativeLibraryPath` 的默认值(而不是 `libagent.dll`)。
- `injector` —— 附加到目标 PID 并执行远程 `dlopen`。
### 配置位置
Linux 上加载器**不会**在当前工作目录中查找配置,而是按以下顺序确定运行时目录:
1. `JuiceAgent_ConfigPath` —— 环境变量存在且非空时直接使用。
2. `$HOME/.juiceagent` —— 默认值,目录不存在时会自动创建。
`config.toml` 从该目录读取,配置结构(schema)与 Windows 完全一致,相对路径(`JarPath`、`InjectionDir` 等)也以该目录为基准解析。典型目录结构:
```text
~/.juiceagent/
├── config.toml
├── MyCustomJar.jar
└── injection/
└── Dependencies.jar
```
如需指定其他目录:
```bash
export JuiceAgent_ConfigPath=/opt/juiceagent
```
### 环境要求
- 以与目标 JVM 相同的用户(或 `root`)运行注入器,并确保允许 `ptrace`。如果注入失败并返回 `EPERM`,请检查 `/proc/sys/kernel/yama/ptrace_scope`。
- 目标 JVM 与加载器都必须是 x64。
> **注意**:Linux 注入器二进制目前尚未开源。本仓库中的 `injector` 目标只是一个占位程序,仅打印提示信息;加载器与 agent 完全开源,可直接从本仓库构建。
## JuiceAgent API
以下原生函数通过 `cn.xiaozhou233.juiceagent.api.JuiceAgent` 类暴露给 Java(Java API 定义见 [JuiceAgent-API](https://github.com/xiaozhou233/JuiceAgent-API) 项目):
- `init(String runtimeDir)` — 从 Java 初始化 agent
- `addToBootstrapClassLoaderSearch(String jarPath)`
- `addToSystemClassLoaderSearch(String jarPath)`
- `addToClassLoader(String jarPath, ClassLoader targetClassLoader)`
- `defineClass(ClassLoader targetClassLoader, byte[] bytes)` — 返回 `Class<?>`
- `redefineClass(Class<?> clazz, byte[] classBytes, int length)`
- `redefineClassByName(String className, byte[] classBytes, int length)`
- `retransformClass(Class<?> clazz, byte[] bytecodes, int length)`
- `retransformClassByName(String className, byte[] bytecodes, int length)`
- `getLoadedClasses()` — 返回 `Class<?>[]`
- `getClassByName(String name)` — 返回 `Class<?>`
- `getClassBytes(Class<?> clazz)` — 返回 `byte[]`
- `getClassBytesByName(String name)` — 返回 `byte[]`
## 示例
- `examples/inject-via-java-api` — 通过 Java API(JNI)将 JuiceAgent 注入到正在运行的 JVM,无需 `injector.exe`。
- `examples/load-via-injector-exe` — 通过 `injector.exe` 将 JAR 加载到目标 JVM 并运行入口点。
- `examples/retransform-class` — 演示使用目标 JVM 和修改后的类副本进行类重变换。
## 如何构建
### 环境要求
- Java 8+
- MinGW-w64(Windows)或 GCC/Clang(Linux)
- CMake 3.15+
- Ninja
### 使用 CMake Presets 构建
```powershell
git clone https://github.com/xiaozhou233/JuiceAgent.git
cd JuiceAgent
cmake --preset release
cmake --build build
```
### 手动构建
```powershell
git clone https://github.com/xiaozhou233/JuiceAgent.git
cd JuiceAgent
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build
```
生成的二进制文件将放在 `build/bin` 中。Linux 下会生成 `libloader.so`、`libagent.so` 和 `injector`;Windows 下为对应的 `.dll` / `.exe`。
## 完整免责声明
本项目仅用于受控环境下的学习与研究。作者不对因未授权使用、修改、破解或违反任何适用协议或法律所造成的后果负责。用户有责任确保其行为合法合规。
## 致谢
- [ReflectiveDLLInjection](https://github.com/stephenfewer/ReflectiveDLLInjection) — DLL 注入实现
- [spdlog](https://github.com/gabime/spdlog) — 高性能 C++ 日志库
- [toml11](https://github.com/ToruNiina/toml11) — 现代 C++ 的 TOML 库
+3
View File
@@ -0,0 +1,3 @@
Major=5
Minor=0
Patch=1
+21
View File
@@ -0,0 +1,21 @@
# 杀毒软件误报说明 / Antivirus False Positive Notice
## 中文
JuiceAgent 的 `libloader.dll` 在部分杀毒软件中可能被误报为恶意程序。原因如下:
1. **进程注入技术**:本项目需通过远程线程将 DLL 注入到目标 JVM 进程(`VirtualAllocEx` + `WriteProcessMemory` + `CreateRemoteThread`),这是杀软对"进程注入"行为的常见告警特征。
2. **反射加载(Reflective Loading)**:`libloader.dll` 使用反射加载器在内存中手动解析 PE 并加载,不经过常规的 `LoadLibrary` 加载流程,与部分恶意软件(无文件攻击)的技术高度相似。
3. **API 哈希**:为规避导入表,代码使用哈希解析 `LoadLibrary`/`GetProcAddress` 等 API,该手法也是杀软重点检测的静态特征。
以上技术均为实现 JVMTI 运行时注入所必需,项目本身不包含任何恶意行为。由于这些行为与恶意软件特征高度重合,**无法完全消除误报**。请在使用前自行判断风险,或将其加入杀软白名单。
## English
`libloader.dll` in JuiceAgent may be flagged as malware by some antivirus software. The reasons are as follows:
1. **Process Injection**: This project injects a DLL into the target JVM process via a remote thread (`VirtualAllocEx` + `WriteProcessMemory` + `CreateRemoteThread`). Process injection is a common behavior signature that antivirus engines flag.
2. **Reflective Loading**: `libloader.dll` uses a reflective loader to manually parse and map a PE image in memory, bypassing the normal `LoadLibrary` loading flow. This closely resembles fileless malware techniques.
3. **API Hashing**: The code resolves APIs such as `LoadLibrary`/`GetProcAddress` by hash instead of using an import table, a static feature also heavily targeted by AV engines.
These techniques are all required to implement JVMTI runtime injection. The project itself contains no malicious behavior. However, because these behaviors closely overlap with malware signatures, **false positives cannot be completely eliminated**. Please assess the risk before use, or add the binaries to your antivirus whitelist.
+26
View File
@@ -0,0 +1,26 @@
# Inject Method
## Method A: Use `injector.exe`
Run `injector.exe` from `YourDir`.
```text
<jps output>
Input PID:
```
Enter the PID of the target JVM process and press Enter.
## Method B: Use JNI to call `inject`
Download the JuiceAgent-JavaInjector-x.x-xxxx.jar from [here](https://github.com/xiaozhou233/JuiceAgent-JavaInjector/releases).
Add JuiceAgent-JavaInjector-x.x-xxxx.jar to your classpath.
Example:
```java
import cn.xiaozhou233.juiceagent.injector.Injector;
System.load("<path-to-libinject>");
Injector.inject(<pid>, "<path-to-libloader>", "<path-to-config-directory>");
```
+34
View File
@@ -0,0 +1,34 @@
# Advanced
## Load Custom API / Directly Load Jar
JuiceAgent runs in **BuiltIn** mode by default: `libloader` registers the embedded
JuiceAgent-API jar, the agent bootstraps it, and the JarLoader module loads your JAR
and invokes its entry method.
If you don't need JuiceAgent-API — for example you want to provide your own bootstrap
and call an arbitrary class/method — set `JarLoader.Mode` to **`CustomJar`**:
```toml
[JuiceAgent]
Version = 2
[JarLoader]
Mode = "CustomJar"
JarPath = "./my-agent.jar"
EntryClass = "com.example.MyBootstrap"
EntryMethod = "start"
```
Workflow in `CustomJar` mode:
1. `libloader` attaches to the target JVM and reads `config.toml`.
2. It adds `JarPath` to the system class loader search path. JuiceAgent-API is **not** loaded.
3. It invokes `EntryClass.EntryMethod`.
`EntryMethod` must be a `public static void` method that takes no arguments.
> `JarLoader.Enabled` and `JarLoader.InjectionDir` only apply to `BuiltIn` mode; they are
> ignored in `CustomJar` mode.
See [Configuration](config.md) for the complete list of keys.
+65
View File
@@ -0,0 +1,65 @@
# Configuration (`config.toml`)
JuiceAgent reads a single `config.toml` from the **runtime directory** (the directory
passed to the injector / loader; the current working directory is used when none is
given). Paths that start with `./` are resolved against the runtime directory;
absolute paths are used as-is.
The current schema version is **2**. `JuiceAgent.Version` must match the version
expected by the binaries, otherwise the loader stops with a version mismatch error.
## Example
```toml
[JuiceAgent]
Version = 2
JuiceAgentNativeLibraryPath = ""
[JarLoader]
Enabled = true
Mode = "BuiltIn"
InjectionDir = "./injection"
JarPath = "./MyCustomJar.jar"
EntryClass = "Example.Main"
EntryMethod = "run"
```
## `[JuiceAgent]`
| Key | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `Version` | integer | yes | — | Configuration schema version. Must be `2`. |
| `JuiceAgentNativeLibraryPath` | string (path) | no | `./libagent.dll` | Path to `libagent.dll`, loaded by the bootstrap after injection. |
## `[JarLoader]`
| Key | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `Mode` | string | yes | — | How the target JAR is registered: `BuiltIn` or `CustomJar`. |
| `Enabled` | boolean | no | `false` | Run the JarLoader module after the agent is initialized (`BuiltIn` mode only). When `false`, no JAR is loaded and no entry method is invoked. |
| `InjectionDir` | string (path) | no | `./injection` | Directory of dependency JARs loaded before the main JAR (`BuiltIn` mode). |
| `JarPath` | string (path) | see below | `./Entry.jar` (`BuiltIn`) | The JAR to load. |
| `EntryClass` | string | see below | `Example.Main` (`BuiltIn`) | Entry class to invoke after loading the JAR. |
| `EntryMethod` | string | see below | `start` (`BuiltIn`) | Entry method, must be a `public static void` method with no parameters. |
> In `CustomJar` mode, `JarPath`, `EntryClass` and `EntryMethod` are required (there are
> no defaults); `Enabled` and `InjectionDir` are not used.
## Modes
### `BuiltIn` (recommended)
1. `libloader` extracts the embedded **JuiceAgent-API** jar and adds it to the system class loader.
2. The agent bootstraps JuiceAgent-API (`JuiceAgentBootstrap.start`).
3. If `Enabled = true`, the JarLoader module loads every `*.jar` from `InjectionDir`, then loads `JarPath`, and invokes `EntryClass.EntryMethod`.
This is the mode used by most users: keep JuiceAgent-API and just supply the JAR and
entry point to run.
### `CustomJar`
1. `libloader` adds `JarPath` itself to the system class loader. **JuiceAgent-API is not used.**
2. It invokes `EntryClass.EntryMethod` directly.
Use this when you want to bring your own bootstrap and call an arbitrary class/method.
See [Advanced](advanced.md#load-custom-api--directly-load-jar) for details.
+143
View File
@@ -0,0 +1,143 @@
# Changelog / 更新日志
本文件记录 JuiceAgent 的版本变更。更早的版本请见 [GitHub Releases](https://github.com/xiaozhou233/JuiceAgent/releases)。
This file records notable changes to JuiceAgent. For older releases, see [GitHub Releases](https://github.com/xiaozhou233/JuiceAgent/releases).
## 中文
### [5.0.1] - 2026-10-16
#### 🐛 修复
- 修复配置错误导致目标 JVM 崩溃:`libloader.dll` 是反射加载的,其展开表未被登记,C++ 异常在其中既无法 unwind 也无法捕获。现改为配置读取非抛出 + 解析走无异常模式,并以 `-fno-exceptions` 编译 libloader,任何会抛异常的代码在编译期即失败。
#### ✨ 新功能
- 事件总线新增 `subscribeFront` / `listenFront`(监听者顺序能力)。
#### 🔧 内部改动
- 用约 60 行类型安全事件总线替换 `eventpp`(移除 23 个 in-tree 头文件,约 144 KB)。
- 移除无引用的 `MethodEntry` / `MethodExit` 事件定义。
#### 📝 文档
- 新增 `docs/config.md` 与 `docs/update/`;重写 `docs/advanced.md`;README 配置示例升级到 v2。
#### 🔁 CI
- 新增 GitHub Actions 工作流(构建 + 集成测试 + 打包 + 上传 artifact)与 `tests/run-tests.ps1`。
- 构建改为静态链接 C/C++ 运行时。
### [5.0.0] - 2026-10-15
#### ⚠️ 破坏性变更
- 配置 schema 由 v1 升级到 v2(`CONFIG_VERSION = 2`):旧配置会被版本校验拒绝,需按 [v5.0.0 发布说明](v5.0.0.md) 迁移。
#### ✨ 新功能
- 新增 `JarLoader.Mode`:`BuiltIn`(内置 JuiceAgent-API)与 `CustomJar`(直接加载自定义 JAR)两种加载模式。
- 新增 `JarLoader.Enabled` 开关,可在 `BuiltIn` 模式下关闭 JarLoader 模块。
- 新增配置解析与访问的错误日志。
#### 🐛 修复
- 自定义 JAR 入口类名规范化(`.` → `/`),修复 `NoClassDefFoundError`。
- `tests/copy-bin.bat` 在被占用时会静默失败的问题。
- `GetClassBytesByName` 集成测试未先加载目标类的问题。
#### 🔧 内部改动
- TOML 解析器由 `toml11` 迁移到 `toml++`。
- 移除未使用的 `LoaderConfig` 相关辅助函数。
#### 📝 文档
- 新增 `docs/config.md`(v2 配置参考)。
- 重写 `docs/advanced.md`;README 与示例文档升级到 v2。
### [4.1.2] - 2026-10-11
#### ✨ 新功能
- 新增基于版本的打包脚本(`script/package.bat` + `script/package.cmake`)。
- `Version.txt` 改为 `Major` / `Minor` / `Patch` 结构化格式。
#### 🐛 修复
- 修复 `getClassBytesByName` 在部分环境下无法获取类的问题(改用 JVMTI 的 `findLoadedClass`)。
#### 📝 文档
- 新增 `docs/Inject.md`;修正文档路径。
## English
### [5.0.1] - 2026-10-16
#### 🐛 Fixes
- Fix a config error crashing the target JVM: `libloader.dll` is reflectively loaded, so its unwind tables are never registered and a C++ exception cannot be unwound or caught there. Config reads are now non-throwing, parsing runs in non-throwing mode, and libloader is compiled with `-fno-exceptions` so exception-capable code fails the build.
#### ✨ Features
- New `subscribeFront` / `listenFront` listener-ordering support on the event bus.
#### 🔧 Internal
- Replace `eventpp` with a ~60-line type-safe event bus (removes 23 in-tree headers, ~144 KB).
- Remove the unreferenced `MethodEntry` / `MethodExit` event definitions.
#### 📝 Docs
- Add `docs/config.md` and `docs/update/`; rewrite `docs/advanced.md`; update the README config examples to v2.
#### 🔁 CI
- Add a GitHub Actions workflow (build + integration tests + package + artifact upload) and `tests/run-tests.ps1`.
- Link the C/C++ runtime statically.
### [5.0.0] - 2026-10-15
#### ⚠️ Breaking Changes
- Configuration schema upgraded from v1 to v2 (`CONFIG_VERSION = 2`): older configs are rejected by the version check and must be migrated (see the [v5.0.0 release notes](v5.0.0.md)).
#### ✨ Features
- New `JarLoader.Mode`: `BuiltIn` (embedded JuiceAgent-API) and `CustomJar` (load your own JAR directly).
- New `JarLoader.Enabled` switch to turn the JarLoader module off in `BuiltIn` mode.
- Added logging for config parse and access errors.
#### 🐛 Fixes
- Normalize custom-jar entry class names (`.` → `/`), fixing `NoClassDefFoundError`.
- `tests/copy-bin.bat` no longer fails silently when a target file is locked.
- `GetClassBytesByName` integration test now loads the target class first.
#### 🔧 Internal
- Migrate the TOML parser from `toml11` to `toml++`.
- Remove the unused `LoaderConfig` helpers.
#### 📝 Docs
- Add `docs/config.md` (v2 configuration reference).
- Rewrite `docs/advanced.md`; update the READMEs and example guides to v2.
### [4.1.2] - 2026-10-11
#### ✨ Features
- Add a version-based packaging script (`script/package.bat` + `script/package.cmake`).
- `Version.txt` now uses a structured `Major` / `Minor` / `Patch` format.
#### 🐛 Fixes
- Fix `getClassBytesByName` failing in some environments (use JVMTI `findLoadedClass`).
#### 📝 Docs
- Add `docs/Inject.md`; fix documentation paths.
+163
View File
@@ -0,0 +1,163 @@
# JuiceAgent 5.0.0 Release Notes
## 中文
### ⚠️ 破坏性变更
- **配置文件升级到 v2**:`CONFIG_VERSION` 提升为 `2`。加载器启动时会校验 `JuiceAgent.Version`,版本不匹配将直接拒绝加载,因此旧版 v1 配置必须先迁移。
v1(不再支持):
```toml
[JuiceAgent]
Version = 1
[JuiceAgent.Loader]
JuiceAgentNativeLibraryPath = ""
[JuiceAgent.Modules]
[JuiceAgent.Modules.JarLoader]
Enabled = true
InjectionDir = "./injection"
JarPath = "./MyCustomJar.jar"
EntryClass = "Example.Main"
EntryMethod = "run"
```
v2(当前):
```toml
[JuiceAgent]
Version = 2
JuiceAgentNativeLibraryPath = ""
[JarLoader]
Enabled = true
Mode = "BuiltIn"
InjectionDir = "./injection"
JarPath = "./MyCustomJar.jar"
EntryClass = "Example.Main"
EntryMethod = "run"
```
迁移要点:
- `Version` 由 `1` 改为 `2`。
- `JuiceAgentNativeLibraryPath` 由 `[JuiceAgent.Loader]` 移到 `[JuiceAgent]`。
- 原 `[JuiceAgent.Modules.JarLoader]` 展平为顶层 `[JarLoader]`。
- 新增必填项 `Mode`(`BuiltIn` 或 `CustomJar`)。
- 完整说明见 [docs/config.md](../config.md)。
### ✨ 新功能
- 新增两种 JAR 加载模式(`JarLoader.Mode`):
- `BuiltIn`(推荐):加载器解出内嵌的 JuiceAgent-API jar 并注入系统类加载器,agent 通过 API 引导,再由 JarLoader 模块加载目标 JAR 并调用入口方法。
- `CustomJar`:不再使用 JuiceAgent-API,加载器直接把 `JarPath` 加入系统类加载器并调用 `EntryClass.EntryMethod`,便于接入自定义引导。
- 新增 `JarLoader.Enabled` 开关(默认 `false`),可在 `BuiltIn` 模式下关闭 JarLoader 模块。
- 新增配置解析与访问的错误日志:配置缺失或类型不匹配时会给出明确提示。
### 🐛 修复
- 修复自定义 JAR 入口类查找失败:将类名规范化为 JNI 内部形式(`.` → `/`),`FindClass` 现在能正确解析 `Example.Main` 这类 Java 二进制名(修复 `NoClassDefFoundError`)。
- 修复集成测试的二进制拷贝脚本 `tests/copy-bin.bat`:改用原生 `COPY /Y`,在目标文件被占用时明确报错,不再静默失败导致测试使用旧二进制。
- 修复 `GetClassBytesByName` 集成测试:先加载目标类再按名获取字节码(该 API 只解析已加载的类)。
### 🔧 内部改动
- TOML 解析器由 `toml11` 迁移到 `toml++`。
- 移除未使用的 `LoaderConfig` / `get_loader_config` / `print_loader_config`(其中仍引用着 v1 的配置键)。
### 📝 文档
- 新增 [docs/config.md](../config.md):完整的 v2 配置参考(含两种模式流程与各键默认值)。
- 重写 [docs/advanced.md](../advanced.md):改为描述 `JarLoader.Mode = "CustomJar"`,移除已废弃的 `JUICEAGENT_API_*` 环境变量说明。
- README(中/英)的 Quick Start 配置示例升级到 v2 并链接 `docs/config.md`;示例列表补充 `inject-via-java-api`。
- 同步更新 `examples/inject-via-java-api` 的说明文档(中/英,md/txt)。
---
## English
### ⚠️ Breaking Changes
- **Configuration upgraded to v2**: `CONFIG_VERSION` is now `2`. The loader validates `JuiceAgent.Version` at startup and refuses to load on a mismatch, so existing v1 configs must be migrated first.
v1 (no longer supported):
```toml
[JuiceAgent]
Version = 1
[JuiceAgent.Loader]
JuiceAgentNativeLibraryPath = ""
[JuiceAgent.Modules]
[JuiceAgent.Modules.JarLoader]
Enabled = true
InjectionDir = "./injection"
JarPath = "./MyCustomJar.jar"
EntryClass = "Example.Main"
EntryMethod = "run"
```
v2 (current):
```toml
[JuiceAgent]
Version = 2
JuiceAgentNativeLibraryPath = ""
[JarLoader]
Enabled = true
Mode = "BuiltIn"
InjectionDir = "./injection"
JarPath = "./MyCustomJar.jar"
EntryClass = "Example.Main"
EntryMethod = "run"
```
Migration:
- `Version`: `1` → `2`.
- `JuiceAgentNativeLibraryPath` moved from `[JuiceAgent.Loader]` to `[JuiceAgent]`.
- `[JuiceAgent.Modules.JarLoader]` flattened to a top-level `[JarLoader]`.
- New required key `Mode` (`BuiltIn` or `CustomJar`).
- Full reference: [docs/config.md](../config.md).
### ✨ Features
- Two JAR loading modes (`JarLoader.Mode`):
- `BuiltIn` (recommended): the loader extracts the embedded JuiceAgent-API jar and adds it to the system class loader, the agent bootstraps it, and the JarLoader module loads the target JAR and invokes its entry method.
- `CustomJar`: JuiceAgent-API is not used; the loader adds `JarPath` to the system class loader and invokes `EntryClass.EntryMethod`, so you can plug in your own bootstrap.
- New `JarLoader.Enabled` switch (default `false`) to turn the JarLoader module off in `BuiltIn` mode.
- New logging for config parse and access errors, with clear messages when a key is missing or has the wrong type.
### 🐛 Fixes
- Fix entry class lookup for custom jars: class names are normalized to the JNI internal form (`.` → `/`) so `FindClass` resolves Java binary names like `Example.Main` (fixes `NoClassDefFoundError`).
- Fix the integration test helper `tests/copy-bin.bat`: it now uses native `COPY /Y` and reports a clear error when a target file is locked, instead of failing silently and testing against stale binaries.
- Fix the `GetClassBytesByName` integration test: load the target class before looking it up by name (the API only resolves already-loaded classes).
### 🔧 Internal
- Migrate the TOML parser from `toml11` to `toml++`.
- Remove the unused `LoaderConfig` / `get_loader_config` / `print_loader_config` (which still referenced a v1 config key).
### 📝 Docs
- Add [docs/config.md](../config.md): the complete v2 configuration reference (mode workflows and key defaults).
- Rewrite [docs/advanced.md](../advanced.md) around `JarLoader.Mode = "CustomJar"`, dropping the removed `JUICEAGENT_API_*` environment variables.
- Update the Quick Start config example in both READMEs to v2 and link `docs/config.md`; add `inject-via-java-api` to the examples list.
- Update the `examples/inject-via-java-api` guides (EN/ZH, md/txt).
---
如果您在使用过程中遇到问题,可以加入我们的QQ/Discord群组
If you encounter any issues during use, you can join our QQ/Discord group
Discord: [JuiceDev](https://discord.gg/AQTnUyWNNJ)
QQ群: 1103504356
**Full Changelog**: https://github.com/xiaozhou233/JuiceAgent/compare/v4.1.2...v5.0.0
+77
View File
@@ -0,0 +1,77 @@
# JuiceAgent 5.0.1 Release Notes
## 中文
### 🐛 修复
- **修复配置错误导致目标 JVM 崩溃**:当 `config.toml` 缺少必填项(例如 `JarLoader.Mode`)或语法不合法时,被注入的目标 JVM 会以 `EXCEPTION_ILLEGAL_INSTRUCTION` 崩溃。
根因是 `libloader.dll` 采用**反射加载(手动映射)**,其展开表(unwind tables)不会被系统登记,因此在其中抛出的 C++ 异常**既无法 unwind 也无法被 catch**——`try/catch` 在这里是无效的。修复方式:
- 配置读取全部改为**非抛出**:缺 key / 类型不符只记日志并**提前返回**,报错精确到具体 key;
- 配置解析在**无异常模式**下进行(`toml::parse_result`),畸形 TOML 也只报错、不崩;
- `libloader` 目标以 **`-fno-exceptions`** 编译,以后任何会抛异常的代码都会在**编译期**失败。
### ✨ 新功能
- 事件总线新增 `subscribeFront` / `listenFront`:可将监听者插入队首优先执行(为后续 transformer 管线预留的顺序能力)。
### 🔧 内部改动
- 用约 60 行的**类型安全**事件总线替换第三方库 `eventpp`:监听者按事件类型注册与调用,不再有 `const void*` 强转;同时移除 in-tree 的 eventpp 头文件(23 个文件,约 144 KB)及其 license。
- 移除无引用的 `MethodEntry` / `MethodExit` 事件定义。
### 📝 文档
- 新增 [docs/config.md](../config.md)(v2 配置完整参考)与 [docs/update/](../update/)(发布说明 + CHANGELOG)。
- 重写 [docs/advanced.md](../advanced.md);README(中/英)配置示例升级到 v2。
### 🔁 CI
- 新增 GitHub Actions 工作流 `.github/workflows/ci.yml`:在 `windows-latest` 上用 MinGW-w64 + Ninja 构建、运行集成测试、打包,并把 `JuiceAgent_v*.zip` 作为 artifact 上传(保留 14 天)。
- 新增可复用的测试脚本 `tests/run-tests.ps1`:编译 → 刷新 `tests/resources` → 逐条运行并按**输出断言**(测试程序即使失败也返回 0,所以只看退出码不够)。
- 构建改为**静态链接** C/C++ 运行时(与本地 w64devkit 一致),避免运行时 DLL 版本不匹配导致 `UnsatisfiedLinkError`。
---
## English
### 🐛 Fixes
- **Fix a config error crashing the target JVM**: when `config.toml` was missing a required key (e.g. `JarLoader.Mode`) or was malformed, the injected target JVM crashed with `EXCEPTION_ILLEGAL_INSTRUCTION`.
The root cause is that `libloader.dll` is **reflectively loaded (manually mapped)**, so its unwind tables are never registered with the OS and a C++ exception thrown inside it can be neither unwound nor caught - `try/catch` simply cannot work there. The fix:
- configuration reads are now **non-throwing**: a missing key or type mismatch is logged and the loader **returns early**, with the error naming the exact key;
- config parsing happens in **non-throwing mode** (`toml::parse_result`), so malformed TOML is reported instead of crashing;
- the `libloader` target is compiled with **`-fno-exceptions`**, so any exception-capable code added later fails the **build** instead of crashing at runtime.
### ✨ Features
- New `subscribeFront` / `listenFront` on the event bus, to register a listener ahead of the existing ones (ordering support for a future transformer pipeline).
### 🔧 Internal
- Replace the `eventpp` dependency with a ~60-line, **type-safe** event bus: listeners are registered and invoked by concrete event type, with no `const void*` casting; the in-tree eventpp headers (23 files, ~144 KB) and their license are removed.
- Remove the unreferenced `MethodEntry` / `MethodExit` event definitions.
### 📝 Docs
- Add [docs/config.md](../config.md) (full v2 configuration reference) and [docs/update/](../update/) (release notes + changelog).
- Rewrite [docs/advanced.md](../advanced.md); update the config examples in both READMEs to v2.
### 🔁 CI
- Add a GitHub Actions workflow (`.github/workflows/ci.yml`) that builds with MinGW-w64 + Ninja on `windows-latest`, runs the integration tests, packages the release, and uploads `JuiceAgent_v*.zip` as a build artifact (14-day retention).
- Add a reusable test runner, `tests/run-tests.ps1`, which compiles the modules, refreshes `tests/resources`, then runs every test and asserts on its **output** (the test programs exit 0 even on failure, so exit codes are not enough).
- Link the C/C++ runtime **statically** (matching the local w64devkit build) so the DLLs do not fail to load because of a mismatched runtime DLL on the machine.
---
如果您在使用过程中遇到问题,可以加入我们的QQ/Discord群组
If you encounter any issues during use, you can join our QQ/Discord group
Discord: [JuiceDev](https://discord.gg/AQTnUyWNNJ)
QQ群: 1103504356
**Full Changelog**: https://github.com/xiaozhou233/JuiceAgent/compare/v5.0.0...v5.0.1
+9
View File
@@ -0,0 +1,9 @@
# Temporary build directories
**/out/*
**/*.class
# JuiceAgent runtime binaries copied into the example (not committed)
**/injector.exe
**/libagent.dll
**/libinject.dll
**/libloader.dll
+25
View File
@@ -0,0 +1,25 @@
# Examples
A collection of JuiceAgent examples demonstrating different ways to inject
JuiceAgent into a running JVM process.
## 1. inject-via-java-api
Inject JuiceAgent into a running JVM using the Java API (JNI), without needing `injector.exe`.
- [HowToUse.md](./inject-via-java-api/HowToUse.md)
- [如何使用.md](./inject-via-java-api/如何使用.md)
## 2. load-via-injector-exe
Inject a JAR into a running JVM using `injector.exe`.
- [HowToUse.md](./load-via-injector-exe/HowToUse.md)
- [如何使用.md](./load-via-injector-exe/如何使用.md)
## 3. retransform-class
Retransform an already-loaded class at runtime after injection, without restarting the JVM.
- [HowToUse.md](./retransform-class/HowToUse.md)
- [如何使用.md](./retransform-class/如何使用.md)
+24
View File
@@ -0,0 +1,24 @@
# Examples
JuiceAgent 示例集合,演示将 JuiceAgent 注入到正在运行的 JVM 进程的不同方式。
## 1. inject-via-java-api
使用 Java API(JNI)将 JuiceAgent 注入正在运行的 JVM,无需使用 `injector.exe`。
- [HowToUse.md](./inject-via-java-api/HowToUse.md)
- [如何使用.md](./inject-via-java-api/如何使用.md)
## 2. load-via-injector-exe
使用 `injector.exe` 将 JAR 注入正在运行的 JVM。
- [HowToUse.md](./load-via-injector-exe/HowToUse.md)
- [如何使用.md](./load-via-injector-exe/如何使用.md)
## 3. retransform-class
注入后在运行时热替换(retransform)已加载的类,无需重启 JVM。
- [HowToUse.md](./retransform-class/HowToUse.md)
- [如何使用.md](./retransform-class/如何使用.md)
+94
View File
@@ -0,0 +1,94 @@
# How to Use — inject-via-java-api (JuiceAgent)
This example demonstrates injecting JuiceAgent into a running JVM process
using the Java API (JNI), without needing `injector.exe`.
## Prerequisites
- Java 8+ installed and available in `PATH`
- JuiceAgent native DLLs (`libinject.dll`, `libloader.dll`, `libagent.dll`)
placed in the same directory as this example
- A `config.toml` file configured for your use case
## Quick Start
### Step 1: Build
Run `build.bat` to compile both the injector and the target jars:
```
> build.bat
```
### Step 2: Run the Target JVM
Open a terminal and start the target JVM:
```
> run.bat
```
The target JVM will start and print its PID periodically. Keep it running.
### Step 3: Run the Injector
Open another terminal and run the injector:
```
> run_injector.bat
```
You will be prompted to enter:
- `PID` : the target JVM process ID (shown in the target terminal)
- `DLL` : path to `libinject.dll` (e.g. `.\libinject.dll`)
- `config_path` : directory containing `config.toml` (leave empty for current dir)
### Step 4: Verify
If the injection is successful, the target JVM will load the JAR specified
in `config.toml` and execute its entry method.
## Files
| File | Description |
| --- | --- |
| `build.bat` | Build all jars (injector + target) |
| `run.bat` | Start the target JVM |
| `run_injector.bat` | Run the JavaInjector to inject into the target JVM |
| `config.toml` | JuiceAgent configuration file |
| `injector/` | JavaInjector source code and build script |
| `target/` | Target JVM source code and build script |
## Configuration (config.toml)
```toml
[JuiceAgent]
Version = 2
JuiceAgentNativeLibraryPath = ""
[JarLoader]
Enabled = true
Mode = "BuiltIn"
InjectionDir = "./injection"
JarPath = "./demo.jar"
EntryClass = "Example.Main"
EntryMethod = "run"
```
- `JarPath`: the JAR to load into the target JVM
- `EntryClass`: the fully qualified class name with the entry method
- `EntryMethod`: must be a `public static void` method with no parameters
- `InjectionDir`: directory containing dependency JARs loaded before the main JAR
## Troubleshooting
- `Error: JuiceAgent-JavaInjector-1.0-SNAPSHOT.jar not found`:
Run `build.bat` first to compile the injector.
- `java.lang.UnsatisfiedLinkError`:
Ensure `libinject.dll` is in the current directory or provide the full path.
- Injection has no effect:
Verify that `config.toml` is in the directory you specified as `config_path`,
and that the paths inside `config.toml` are correct relative to that directory.
+77
View File
@@ -0,0 +1,77 @@
How to Use -- inject-via-java-api (JuiceAgent)
This example demonstrates injecting JuiceAgent into a running JVM process
using the Java API (JNI), without needing injector.exe.
Prerequisites:
- Java 8+ installed and available in PATH
- JuiceAgent native DLLs (libinject.dll, libloader.dll, libagent.dll)
placed in the same directory as this example
- A config.toml file configured for your use case
Quick Start
============
Step 1: Build
Run build.bat to compile both the injector and the target jars:
> build.bat
Step 2: Run the Target JVM
Open a terminal and start the target JVM:
> run.bat
The target JVM will start and print its PID periodically. Keep it running.
Step 3: Run the Injector
Open another terminal and run the injector:
> run_injector.bat
You will be prompted to enter:
- PID : the target JVM process ID (shown in the target terminal)
- DLL : path to libinject.dll (e.g. .\libinject.dll)
- config_path : directory containing config.toml (leave empty for current dir)
Step 4: Verify
If the injection is successful, the target JVM will load the JAR specified
in config.toml and execute its entry method.
Files
======
build.bat - Build all jars (injector + target)
run.bat - Start the target JVM
run_injector.bat - Run the JavaInjector to inject into the target JVM
config.toml - JuiceAgent configuration file
injector/ - JavaInjector source code and build script
target/ - Target JVM source code and build script
Configuration (config.toml)
============================
[JuiceAgent]
Version = 2
JuiceAgentNativeLibraryPath = ""
[JarLoader]
Enabled = true
Mode = "BuiltIn"
InjectionDir = "./injection"
JarPath = "./demo.jar"
EntryClass = "Example.Main"
EntryMethod = "run"
- JarPath: the JAR to load into the target JVM
- EntryClass: the fully qualified class name with the entry method
- EntryMethod: must be a public static void method with no parameters
- InjectionDir: directory containing dependency JARs loaded before the main JAR
Troubleshooting
================
- "Error: JuiceAgent-JavaInjector-1.0-SNAPSHOT.jar not found":
Run build.bat first to compile the injector.
- "java.lang.UnsatisfiedLinkError":
Ensure libinject.dll is in the current directory or provide the full path.
- Injection has no effect:
Verify that config.toml is in the directory you specified as config_path,
and that the paths inside config.toml are correct relative to that directory.
+23
View File
@@ -0,0 +1,23 @@
@echo off
echo === Building injector jar ===
pushd injector
call build.bat
popd
if errorlevel 1 goto :error
echo.
echo === Building target jar ===
pushd target
call build.bat
popd
if errorlevel 1 goto :error
echo.
echo Build finished: JuiceAgent-JavaInjector-1.0-SNAPSHOT.jar and target.jar are ready.
goto :end
:error
echo Build failed.
exit /b 1
:end
+19
View File
@@ -0,0 +1,19 @@
# See config.md for more information https://github.com/xiaozhou233/JuiceAgent/blob/main/docs/config.md
[JuiceAgent]
Version = 2
JuiceAgentNativeLibraryPath = ""
[JarLoader]
# Mode: BuiltIn, CustomJar
# BuiltIn: Use the built-in jar loader (recommended, support JuiceAgent-API ( https://github.com/xiaozhou233/JuiceAgent#juiceagent-api ))
# CustomJar: Load the Jar directly, without using JuiceAgent-API
# For more information, please refer to the documentation: https://github.com/xiaozhou233/JuiceAgent/blob/main/docs/advanced.md#load-custom-api--directly-load-jar
Enabled = true
Mode = "BuiltIn"
# InjectionDir only works when Mode is BuiltIn
InjectionDir = "./injection"
JarPath = "./demo.jar"
EntryClass = "Example.Main"
EntryMethod = "run"
@@ -0,0 +1,35 @@
import cn.xiaozhou233.juiceagent.injector.Injector;
import cn.xiaozhou233.juiceagent.injector.WindowInfo;
import java.util.Scanner;
import java.io.File;
public class JavaInjector {
public static void main(String[] args) {
// Load the native library
System.load(new File("./libinject.dll").getAbsolutePath());
// Find windows by title
for (WindowInfo window : Injector.findWindowsByTitle("cmd")) {
System.out.println(window.toString());
}
System.out.println("----------------");
Scanner scanner = new Scanner(System.in);
// Input
System.out.println("PID: ");
String pid = scanner.nextLine();
System.out.println("Dll: ");
String dll = scanner.nextLine();
System.out.println("config_path: ");
String config_path = scanner.nextLine();
if (config_path == null || config_path.isEmpty()) {
// config_path is empty
Injector.inject(Integer.parseInt(pid), dll);
} else {
Injector.inject(Integer.parseInt(pid), dll, config_path);
}
}
}
@@ -0,0 +1,51 @@
@echo off
setlocal
set "OUT=out"
set "JAR=JuiceAgent-JavaInjector-1.0-SNAPSHOT.jar"
set "TMP=tmp_jar"
if not exist "%JAR%" (
echo Error: %JAR% not found. Please restore the original jar.
exit /b 1
)
if exist "%OUT%" rmdir /s /q "%OUT%"
if exist "%TMP%" rmdir /s /q "%TMP%"
mkdir "%OUT%"
mkdir "%TMP%"
javac -encoding UTF-8 --release 8 -cp "%JAR%" -d "%OUT%" JavaInjector.java
if errorlevel 1 goto :error
rem Extract existing jar (contains Injector/WindowInfo classes) into temp dir
rem -J-XX:-UsePerfData prevents JVM from creating locked hsperfdata files in CWD
pushd "%TMP%"
jar -J-XX:-UsePerfData xf "..\%JAR%"
popd
if errorlevel 1 goto :error
rem Remove any hsperfdata folder that may have leaked into the jar
for /d %%D in ("%TMP%\hsperfdata_*") do rmdir /s /q "%%D"
rem Merge compiled JavaInjector.class into temp dir
copy /y "%OUT%\JavaInjector.class" "%TMP%\JavaInjector.class" >nul
if errorlevel 1 goto :error
rem Repackage with Main-Class
jar -J-XX:-UsePerfData --create --file "%JAR%" --main-class JavaInjector -C "%TMP%" .
if errorlevel 1 goto :error
rmdir /s /q "%OUT%"
rmdir /s /q "%TMP%"
echo Build succeeded: %JAR%
goto :end
:error
echo Build failed.
exit /b 1
:end
endlocal
+4
View File
@@ -0,0 +1,4 @@
@echo off
cd /d "%~dp0"
java -jar target.jar
pause
@@ -0,0 +1,17 @@
@echo off
cd /d "%~dp0"
set "INJECTOR_JAR=injector\JuiceAgent-JavaInjector-1.0-SNAPSHOT.jar"
echo === Java API Injector ===
echo.
echo Make sure the target JVM is running (run.bat).
echo.
echo Usage: This script runs the JavaInjector which will prompt for:
echo - PID: target JVM process ID
echo - DLL: path to libloader.dll
echo - config_path: directory containing config.toml (leave empty to use current dir)
echo.
java -cp "%INJECTOR_JAR%" JavaInjector
pause
Binary file not shown.
@@ -0,0 +1,28 @@
@echo off
setlocal
set "SRC=target.java"
set "OUT=out"
set "JAR=..\target.jar"
if exist "%OUT%" rmdir /s /q "%OUT%"
if exist "%JAR%" del /q "%JAR%"
mkdir "%OUT%"
javac -encoding UTF-8 --release 8 -d "%OUT%" "%SRC%"
if errorlevel 1 goto :error
jar --create --file "%JAR%" --main-class target -C "%OUT%" .
if errorlevel 1 goto :error
rmdir /s /q "%OUT%"
echo Build succeeded: target.jar
goto :end
:error
echo Build failed.
exit /b 1
:end
endlocal
@@ -0,0 +1,15 @@
import java.lang.management.ManagementFactory;
public class target {
public static void main(String[] args) {
String pid = ManagementFactory.getRuntimeMXBean().getName().split("@")[0];
try {
while (true) {
System.out.println("[Target] I am the target JVM (PID: " + pid + ")");
Thread.sleep(1000);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -0,0 +1,93 @@
# 如何使用 — inject-via-java-api (JuiceAgent)
本示例演示如何使用 Java API(JNI)将 JuiceAgent 注入到正在运行的 JVM 进程中,
无需使用 `injector.exe`。
## 环境要求
- Java 8+ 已安装并在 `PATH` 中可用
- JuiceAgent 原生 DLL(`libinject.dll`、`libloader.dll`、`libagent.dll`)
已放置在本示例所在目录
- 已根据实际需求配置好 `config.toml`
## 快速开始
### 步骤 1:构建
运行 `build.bat` 编译 injector 和 target 两个 jar:
```
> build.bat
```
### 步骤 2:启动目标 JVM
打开一个终端,启动目标 JVM:
```
> run.bat
```
目标 JVM 将启动并周期性打印其 PID。保持该窗口运行。
### 步骤 3:运行注入器
打开另一个终端,运行注入器:
```
> run_injector.bat
```
程序会提示你输入以下信息:
- `PID` — 目标 JVM 进程 ID(在目标 JVM 终端中显示)
- `DLL` — `libinject.dll` 的路径(例如 `.\libinject.dll`)
- `config_path` — `config.toml` 所在目录(留空则使用当前目录)
### 步骤 4:验证
注入成功后,目标 JVM 将加载 `config.toml` 中指定的 JAR 并执行其入口方法。
## 文件说明
| 文件 | 说明 |
| --- | --- |
| `build.bat` | 构建所有 jar(injector + target) |
| `run.bat` | 启动目标 JVM |
| `run_injector.bat` | 运行 JavaInjector,将 agent 注入目标 JVM |
| `config.toml` | JuiceAgent 配置文件 |
| `injector/` | JavaInjector 源码及构建脚本 |
| `target/` | 目标 JVM 源码及构建脚本 |
## 配置说明(config.toml)
```toml
[JuiceAgent]
Version = 2
JuiceAgentNativeLibraryPath = ""
[JarLoader]
Enabled = true
Mode = "BuiltIn"
InjectionDir = "./injection"
JarPath = "./demo.jar"
EntryClass = "Example.Main"
EntryMethod = "run"
```
- `JarPath`:要加载到目标 JVM 的 JAR 文件
- `EntryClass`:包含入口方法的完整类名
- `EntryMethod`:必须是 `public static void` 且无参数的方法
- `InjectionDir`:依赖 JAR 所在的目录,这些 JAR 会在主 JAR 之前加载
## 常见问题
- `Error: JuiceAgent-JavaInjector-1.0-SNAPSHOT.jar not found`:
请先运行 `build.bat` 编译 injector。
- `java.lang.UnsatisfiedLinkError`:
请确保 `libinject.dll` 在当前目录下,或提供完整路径。
- 注入后无效果:
请确认 `config.toml` 在你指定的 `config_path` 目录中,且 `config.toml`
中的路径相对于该目录是正确的。
@@ -0,0 +1,76 @@
如何使用 -- inject-via-java-api (JuiceAgent)
本示例演示如何使用 Java API(JNI)将 JuiceAgent 注入到正在运行的 JVM 进程中,
无需使用 injector.exe。
环境要求:
- Java 8+ 已安装并在 PATH 中可用
- JuiceAgent 原生 DLL(libinject.dll、libloader.dll、libagent.dll)
已放置在本示例所在目录
- 已根据实际需求配置好 config.toml
快速开始
========
步骤 1:构建
运行 build.bat 编译 injector 和 target 两个 jar:
> build.bat
步骤 2:启动目标 JVM
打开一个终端,启动目标 JVM:
> run.bat
目标 JVM 将启动并周期性打印其 PID。保持该窗口运行。
步骤 3:运行注入器
打开另一个终端,运行注入器:
> run_injector.bat
程序会提示你输入以下信息:
- PID :目标 JVM 进程 ID(在目标 JVM 终端中显示)
- DLL :libinject.dll 的路径(例如 .\libinject.dll)
- config_path :config.toml 所在目录(留空则使用当前目录)
步骤 4:验证
注入成功后,目标 JVM 将加载 config.toml 中指定的 JAR 并执行其入口方法。
文件说明
========
build.bat - 构建所有 jar(injector + target)
run.bat - 启动目标 JVM
run_injector.bat - 运行 JavaInjector,将 agent 注入目标 JVM
config.toml - JuiceAgent 配置文件
injector/ - JavaInjector 源码及构建脚本
target/ - 目标 JVM 源码及构建脚本
配置说明(config.toml)
=======================
[JuiceAgent]
Version = 2
JuiceAgentNativeLibraryPath = ""
[JarLoader]
Enabled = true
Mode = "BuiltIn"
InjectionDir = "./injection"
JarPath = "./demo.jar"
EntryClass = "Example.Main"
EntryMethod = "run"
- JarPath:要加载到目标 JVM 的 JAR 文件
- EntryClass:包含入口方法的完整类名
- EntryMethod:必须是 public static void 且无参数的方法
- InjectionDir:依赖 JAR 所在的目录,这些 JAR 会在主 JAR 之前加载
常见问题
========
- "Error: JuiceAgent-JavaInjector-1.0-SNAPSHOT.jar not found":
请先运行 build.bat 编译 injector。
- "java.lang.UnsatisfiedLinkError":
请确保 libinject.dll 在当前目录下,或提供完整路径。
- 注入后无效果:
请确认 config.toml 在你指定的 config_path 目录中,且 config.toml
中的路径相对于该目录是正确的。
@@ -0,0 +1,80 @@
# HowToUse — load-via-injector-exe
**Prerequisites:** Java 8+ (`javac`/`jar` for building, `jps` for injection)
## Directory Files
| File | Description |
| --- | --- |
| `injector.exe` `libagent.dll` `libinject.dll` `libloader.dll` | JuiceAgent runtime |
| `config.toml` | Injection config |
| `demo.jar` | JAR to inject (built by `build.bat`) |
| `target.jar` | Target JVM program (built by `build.bat`) |
| `injection/` | Injection source |
| `target/` | Target source |
| `build.bat` | Rebuild `demo.jar` / `target.jar` |
| `run.bat` | Run target JVM (`target.jar`) |
## Usage Steps
### 1. Build (optional)
`demo.jar` and `target.jar` are already included by default.
If you modified `injection/Main.java` or `target/target.java`, run:
```
build.bat
```
to regenerate `demo.jar` and `target.jar` in this directory.
### 2. Run the target JVM
Double-click `run.bat` (or run: `java -jar target.jar`). A black window
appears and prints:
```
[Target] I am the target JVM (PID: <PID>)
```
... (once per second)
### 3. Inject
Double-click `injector.exe`, type the target PID and press Enter:
```
6644 target.jar
10504 jdk.jcmd/sun.tools.jps.Jps
Input PID: 6644
```
### 4. Verify
Go back to the target window. Injection succeeded if you see:
```
[Demo] Injection succeeded! Hello from JuiceAgent.
[Demo] Current thread: Thread-0
```
## Config / config.toml
| Key | Description |
| --- | --- |
| `JarPath` | JAR path to inject (default: `./demo.jar`) |
| `EntryClass` | Entry class (default: `Example.Main`) |
| `EntryMethod` | Entry method, must be `public static void run()` |
| `InjectionDir` | Dependency JAR directory (only `*.jar` is loaded) |
## Troubleshooting
- `java/javac/jar is not recognized`:
Install a JDK and add its `bin` directory to `PATH`.
- `injector.exe` reports injection failure:
Make sure the target JVM is running and the PID is correct.
- No `[Demo]` output appears:
The target window prints many log lines which may affect reading.
Check the `[JuiceAgent JarLoader]` lines to locate the cause.
If it still fails, copy the full log and submit an Issue, or paste
it directly to an AI.
@@ -0,0 +1,65 @@
============================================
HowToUse
============================================
Prerequisites: Java 8+ (javac/jar for building, jps for injection)
Directory Files:
injector.exe libagent.dll libinject.dll libloader.dll - JuiceAgent runtime
config.toml - injection config
demo.jar - JAR to inject (built by build.bat)
target.jar - target JVM program (built by build.bat)
injection/ - injection source
target/ - target source
build.bat - rebuild demo.jar / target.jar
run.bat - run target JVM (target.jar)
============================================
Usage Steps
============================================
1. Build (optional)
demo.jar and target.jar are already included by default.
If you modified injection/Main.java or target/target.java, run:
build.bat
to regenerate demo.jar and target.jar in this directory.
2. Run the target JVM
Double-click run.bat (or run: java -jar target.jar). A black window
appears and prints:
[Target] I am the target JVM (PID: <PID>)
...... (once per second)
3. Inject
Double-click injector.exe, type the target PID and press Enter:
6644 target.jar
10504 jdk.jcmd/sun.tools.jps.Jps
Input PID: 6644
4. Verify
Go back to the target window. Injection succeeded if you see:
[Demo] Injection succeeded! Hello from JuiceAgent.
[Demo] Current thread: Thread-0
============================================
Config / config.toml
============================================
JarPath - JAR path to inject (default: ./demo.jar)
EntryClass - Entry class (default: Example.Main)
EntryMethod - Entry method, must be public static void run()
InjectionDir - Dependency JAR directory (only *.jar is loaded)
============================================
Troubleshooting
============================================
- "java/javac/jar is not recognized":
Install a JDK and add its bin directory to PATH.
- injector.exe reports injection failure:
Make sure the target JVM is running and the PID is correct.
- No [Demo] output appears:
The target window prints many log lines which may affect reading.
Check the [JuiceAgent JarLoader] lines to locate the cause.
If it still fails, copy the full log and submit an Issue, or paste
it directly to an AI.
+23
View File
@@ -0,0 +1,23 @@
@echo off
echo === Building injection jar ===
pushd injection
call build.bat
popd
if errorlevel 1 goto :error
echo.
echo === Building target jar ===
pushd target
call build.bat
popd
if errorlevel 1 goto :error
echo.
echo Build finished: demo.jar and target.jar are in this directory.
goto :end
:error
echo Build failed.
exit /b 1
:end
@@ -0,0 +1,19 @@
# See config.md for more information https://github.com/xiaozhou233/JuiceAgent/blob/main/docs/config.md
[JuiceAgent]
Version = 2
JuiceAgentNativeLibraryPath = ""
[JarLoader]
# Mode: BuiltIn, CustomJar
# BuiltIn: Use the built-in jar loader (recommended, support JuiceAgent-API ( https://github.com/xiaozhou233/JuiceAgent#juiceagent-api ))
# CustomJar: Load the Jar directly, without using JuiceAgent-API
# For more information, please refer to the documentation: https://github.com/xiaozhou233/JuiceAgent/blob/main/docs/advanced.md#load-custom-api--directly-load-jar
Enabled = true
Mode = "BuiltIn"
# InjectionDir only works when Mode is BuiltIn
InjectionDir = "./injection"
JarPath = "./demo.jar"
EntryClass = "Example.Main"
EntryMethod = "run"
Binary file not shown.
@@ -0,0 +1,8 @@
package Example;
public class Main {
public static void run() {
System.out.println("[Demo] Injection succeeded! Hello from JuiceAgent.");
System.out.println("[Demo] Current thread: " + Thread.currentThread().getName());
}
}
@@ -0,0 +1,28 @@
@echo off
setlocal
set "SRC=Main.java"
set "OUT=out"
set "JAR=..\demo.jar"
if exist "%OUT%" rmdir /s /q "%OUT%"
if exist "%JAR%" del /q "%JAR%"
mkdir "%OUT%"
javac -encoding UTF-8 --release 8 -d "%OUT%" "%SRC%"
if errorlevel 1 goto :error
jar --create --file "%JAR%" -C "%OUT%" .
if errorlevel 1 goto :error
rmdir /s /q "%OUT%"
echo Build succeeded: demo.jar
goto :end
:error
echo Build failed.
exit /b 1
:end
endlocal
+4
View File
@@ -0,0 +1,4 @@
@echo off
cd /d "%~dp0"
java -jar target.jar
pause
Binary file not shown.
@@ -0,0 +1,28 @@
@echo off
setlocal
set "SRC=target.java"
set "OUT=out"
set "JAR=..\target.jar"
if exist "%OUT%" rmdir /s /q "%OUT%"
if exist "%JAR%" del /q "%JAR%"
mkdir "%OUT%"
javac -encoding UTF-8 --release 8 -d "%OUT%" "%SRC%"
if errorlevel 1 goto :error
jar --create --file "%JAR%" --main-class target -C "%OUT%" .
if errorlevel 1 goto :error
rmdir /s /q "%OUT%"
echo Build succeeded: target.jar
goto :end
:error
echo Build failed.
exit /b 1
:end
endlocal
@@ -0,0 +1,15 @@
import java.lang.management.ManagementFactory;
public class target {
public static void main(String[] args) {
String pid = ManagementFactory.getRuntimeMXBean().getName().split("@")[0];
try {
while (true) {
System.out.println("[Target] I am the target JVM (PID: " + pid + ")");
Thread.sleep(1000);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -0,0 +1,78 @@
# 使用说明 — load-via-injector-exe
**前提条件:** 已安装 Java 8+(需要 `javac`/`jar` 构建,`jps` 用于注入)
## 目录文件说明
| 文件 | 说明 |
| --- | --- |
| `injector.exe` `libagent.dll` `libinject.dll` `libloader.dll` | JuiceAgent 运行时 |
| `config.toml` | 注入配置 |
| `demo.jar` | 待注入的 JAR(`build.bat` 生成) |
| `target.jar` | 目标 JVM 程序(`build.bat` 生成) |
| `injection/` | 注入代码源码 |
| `target/` | 目标程序源码 |
| `build.bat` | 重新生成 `demo.jar` / `target.jar` |
| `run.bat` | 运行目标 JVM(`target.jar`) |
## 使用步骤
### 1. 构建(可选)
默认已包含 `demo.jar` 和 `target.jar`。
若修改了 `injection/Main.java` 或 `target/target.java`,请运行:
```
build.bat
```
生成 `demo.jar` 和 `target.jar` 到本目录。
### 2. 运行目标 JVM
双击 `run.bat`(或执行 `java -jar target.jar`),出现黑色窗口并输出:
```
[Target] I am the target JVM (PID: <PID>)
```
...(每秒输出一次)
### 3. 注入
双击 `injector.exe`,出现黑色窗口,输入目标 PID 并回车:
```
6644 target.jar
10504 jdk.jcmd/sun.tools.jps.Jps
Input PID: 6644
```
### 4. 验证
回到目标窗口,看到以下输出即注入成功:
```
[Demo] Injection succeeded! Hello from JuiceAgent.
[Demo] Current thread: Thread-0
```
## 配置说明 / config.toml
| 配置项 | 说明 |
| --- | --- |
| `JarPath` | 待注入的 JAR 路径(默认 `./demo.jar`) |
| `EntryClass` | 入口类(默认 `Example.Main`) |
| `EntryMethod` | 入口方法,需为 `public static void run()` |
| `InjectionDir` | 依赖 JAR 目录(仅加载 `*.jar`) |
## 常见问题
- `java/javac/jar 不是内部或外部命令`:
安装 JDK 并将其 `bin` 目录加入 `PATH`。
- `injector.exe` 提示注入失败:
确认目标 JVM 正在运行,且输入的 PID 正确。
- 没有出现 `[Demo]` 输出:
目标窗口会有大量日志,可能影响阅读;请查看其中的
`[JuiceAgent JarLoader]` 日志定位原因。
如仍无法解决,请复制完整日志提交 Issue,或直接丢给 AI。
@@ -0,0 +1,63 @@
============================================
使用说明 / HOW TO USE
============================================
前提条件:已安装 Java 8+(需要 javac/jar 构建,jps 用于注入)
目录文件说明:
injector.exe libagent.dll libinject.dll libloader.dll - JuiceAgent 运行时
config.toml - 注入配置
demo.jar - 待注入的 JAR(build.bat 生成)
target.jar - 目标 JVM 程序(build.bat 生成)
injection/ - 注入代码源码
target/ - 目标程序源码
build.bat - 重新生成 demo.jar / target.jar
run.bat - 运行目标 JVM(target.jar)
============================================
使用步骤 / Usage Steps
============================================
1. 构建(可选)
默认已包含 demo.jar 和 target.jar。
若修改了 injection/Main.java 或 target/target.java,请运行:
build.bat
生成 demo.jar 和 target.jar 到本目录。
2. 运行目标 JVM
双击 run.bat(或执行 java -jar target.jar),出现黑色窗口并输出:
[Target] I am the target JVM (PID: <PID>)
......(每秒输出一次)
3. 注入
双击 injector.exe,出现黑色窗口,输入目标 PID 并回车:
6644 target.jar
10504 jdk.jcmd/sun.tools.jps.Jps
Input PID: 6644
4. 验证
回到目标窗口,看到以下输出即注入成功:
[Demo] Injection succeeded! Hello from JuiceAgent.
[Demo] Current thread: Thread-0
============================================
配置说明 / config.toml
============================================
JarPath - 待注入的 JAR 路径(默认 ./demo.jar)
EntryClass - 入口类(默认 Example.Main)
EntryMethod - 入口方法,需为 public static void run()
InjectionDir - 依赖 JAR 目录(仅加载 *.jar)
============================================
常见问题 / Troubleshooting
============================================
- "java/javac/jar 不是内部或外部命令":
安装 JDK 并将其 bin 目录加入 PATH。
- injector.exe 提示注入失败:
确认目标 JVM 正在运行,且输入的 PID 正确。
- 没有出现 [Demo] 输出:
目标窗口会有大量日志,可能影响阅读;请查看其中的
[JuiceAgent JarLoader] 日志定位原因。
如仍无法解决,请复制完整日志提交 Issue,或直接丢给 AI。
+7
View File
@@ -0,0 +1,7 @@
# Build output directory (intermediate)
out/
# Do not ignore root build artifacts:
!new_target.class
!payload.jar
!target.jar
+109
View File
@@ -0,0 +1,109 @@
# HowToUse — retransform-class
**Prerequisites:** Java 8+ (`javac`/`jar` for building, `jps` for injection)
## Directory Files
| File | Description |
| --- | --- |
| `injector.exe` `libagent.dll` `libinject.dll` `libloader.dll` | JuiceAgent runtime |
| `config.toml` | Injection config |
| `build.bat` | Build script |
| `run.bat` | Run target JVM |
| `payload.jar` | JAR to inject (built by `build.bat`) |
| `target.jar` | Target JVM program (built by `build.bat`) |
| `new_target.class` | Retransformed bytecode (built by `build.bat`) |
| `payload/` | Payload source |
| `target/` | Target source |
| `new_target/` | Modified copy of target source |
## What This Example Does
The target class `target` has a method `say()` that prints:
```
Hello!
```
`new_target/target.java` is a modified copy that also prints:
```
Retransformed!
```
This example injects `payload.jar` into a running JVM. The payload reads
`new_target.class` from its own JAR and calls
`JuiceAgent.retransformClassByName("target", ...)` to swap the already-loaded
`target` class on the fly. After that, `say()` starts printing the new message
without restarting the JVM.
## Usage Steps
### 1. Build (optional)
`payload.jar` and `target.jar` are already included by default.
If you modified `payload/`, `target/` or `new_target/`, run:
```
build.bat
```
to regenerate `payload.jar`, `target.jar` and `new_target.class`.
### 2. Run the target JVM
Double-click `run.bat` (or run: `java -jar target.jar`). A black window
appears and prints:
```
[Target] I am the target JVM (PID: <PID>)
Hello!
```
... (once per second)
### 3. Inject
Double-click `injector.exe`, type the target PID and press Enter:
```
6644 target.jar
10504 jdk.jcmd/sun.tools.jps.Jps
Input PID: 6644
```
### 4. Verify
Go back to the target window. Injection succeeded if you see:
```
Payload loaded!
Payload executed!
```
and the output of `say()` changes from `Hello!` to:
```
Hello!
Retransformed!
```
## Config / config.toml
| Key | Description |
| --- | --- |
| `JarPath` | JAR path to inject (default: `./payload.jar`) |
| `EntryClass` | Entry class (default: `payload`) |
| `EntryMethod` | Entry method, must be `public static void entry()` |
## Troubleshooting
- `java/javac/jar is not recognized`:
Install a JDK and add its `bin` directory to `PATH`.
- `injector.exe` reports injection failure:
Make sure the target JVM is running and the PID is correct.
- No `Payload loaded!` output appears:
Check `libagent.log` and `libloader.log` in this directory for the cause.
- `say()` output does not change:
Make sure `build.bat` was run after editing `new_target/`, and that
`new_target.class` inside `payload.jar` is up to date.
+86
View File
@@ -0,0 +1,86 @@
============================================
HowToUse
============================================
Prerequisites: Java 8+ (javac/jar for building, jps for injection)
Directory Files:
injector.exe libagent.dll libinject.dll libloader.dll - JuiceAgent runtime
config.toml - injection config
build.bat - build script
run.bat - run target JVM
payload.jar - JAR to inject (built by build.bat)
target.jar - target JVM program (built by build.bat)
new_target.class - retransformed bytecode (built by build.bat)
payload/ - payload source
target/ - target source
new_target/ - modified copy of target source
============================================
What This Example Does
============================================
The target class "target" has a method say() that prints:
Hello!
new_target/target.java is a modified copy that also prints:
Retransformed!
This example injects payload.jar into a running JVM. The payload reads
new_target.class from its own JAR and calls
JuiceAgent.retransformClassByName("target", ...) to swap the already-loaded
"target" class on the fly. After that, say() starts printing the new message
without restarting the JVM.
============================================
Usage Steps
============================================
1. Build (optional)
payload.jar and target.jar are already included by default.
If you modified payload/, target/ or new_target/, run:
build.bat
to regenerate payload.jar, target.jar and new_target.class.
2. Run the target JVM
Double-click run.bat (or run: java -jar target.jar). A black window
appears and prints:
[Target] I am the target JVM (PID: <PID>)
Hello!
...... (once per second)
3. Inject
Double-click injector.exe, type the target PID and press Enter:
6644 target.jar
10504 jdk.jcmd/sun.tools.jps.Jps
Input PID: 6644
4. Verify
Go back to the target window. Injection succeeded if you see:
Payload loaded!
Payload executed!
and the output of say() changes from "Hello!" to:
Hello!
Retransformed!
============================================
Config / config.toml
============================================
JarPath - JAR path to inject (default: ./payload.jar)
EntryClass - Entry class (default: payload)
EntryMethod - Entry method, must be public static void entry()
============================================
Troubleshooting
============================================
- "java/javac/jar is not recognized":
Install a JDK and add its bin directory to PATH.
- injector.exe reports injection failure:
Make sure the target JVM is running and the PID is correct.
- No "Payload loaded!" output appears:
Check libagent.log and libloader.log in this directory for the cause.
- say() output does not change:
Make sure build.bat was run after editing new_target/, and that
new_target.class inside payload.jar is up to date.
+58
View File
@@ -0,0 +1,58 @@
@echo off
setlocal
set "API_JAR=payload\JuiceAgent-API-1.4.1+build.1.jar"
set "PAYLOAD_JAR=payload.jar"
set "TARGET_JAR=target.jar"
set "OUT=out"
set "OUT_NT=%OUT%\new_target"
set "OUT_PL=%OUT%\payload"
set "OUT_TG=%OUT%\target"
set "NEW_TARGET_CLASS=new_target.class"
if exist "%OUT%" rmdir /s /q "%OUT%"
if exist "%PAYLOAD_JAR%" del /q "%PAYLOAD_JAR%"
if exist "%TARGET_JAR%" del /q "%TARGET_JAR%"
if exist "%NEW_TARGET_CLASS%" del /q "%NEW_TARGET_CLASS%"
mkdir "%OUT_NT%"
mkdir "%OUT_PL%"
mkdir "%OUT_TG%"
echo === Compiling new_target ===
javac -encoding UTF-8 --release 8 -d "%OUT_NT%" new_target\target.java
if errorlevel 1 goto :error
ren "%OUT_NT%\target.class" new_target.class
if errorlevel 1 goto :error
copy /y "%OUT_NT%\new_target.class" "%NEW_TARGET_CLASS%"
if errorlevel 1 goto :error
echo === Compiling payload ===
javac -encoding UTF-8 --release 8 -cp "%API_JAR%" -d "%OUT_PL%" payload\payload.java
if errorlevel 1 goto :error
echo === Compiling target ===
javac -encoding UTF-8 --release 8 -d "%OUT_TG%" target\target.java
if errorlevel 1 goto :error
echo === Packaging payload jar ===
jar --create --file "%PAYLOAD_JAR%" -C "%OUT_PL%" payload.class
if errorlevel 1 goto :error
echo === Packaging target jar ===
jar --create --file "%TARGET_JAR%" --main-class target -C "%OUT_TG%" .
if errorlevel 1 goto :error
rmdir /s /q "%OUT%"
echo Build succeeded: %PAYLOAD_JAR%, %TARGET_JAR%, %NEW_TARGET_CLASS%
goto :end
:error
echo Build failed.
exit /b 1
:end
endlocal
+19
View File
@@ -0,0 +1,19 @@
# See config.md for more information https://github.com/xiaozhou233/JuiceAgent/blob/main/docs/config.md
[JuiceAgent]
Version = 2
JuiceAgentNativeLibraryPath = ""
[JarLoader]
# Mode: BuiltIn, CustomJar
# BuiltIn: Use the built-in jar loader (recommended, support JuiceAgent-API ( https://github.com/xiaozhou233/JuiceAgent#juiceagent-api ))
# CustomJar: Load the Jar directly, without using JuiceAgent-API
# For more information, please refer to the documentation: https://github.com/xiaozhou233/JuiceAgent/blob/main/docs/advanced.md#load-custom-api--directly-load-jar
Enabled = true
Mode = "BuiltIn"
# InjectionDir only works when Mode is BuiltIn
InjectionDir = "./injection"
JarPath = "./payload.jar"
EntryClass = "payload"
EntryMethod = "entry"
Binary file not shown.
@@ -0,0 +1,23 @@
import java.lang.management.ManagementFactory;
public class target {
public static void say() {
System.out.println("Hello!");
//// RETRANSFORM HERE
System.out.println("Retransformed!");
//// RETRANSFORM HERE
}
public static void main(String[] args) {
String pid = ManagementFactory.getRuntimeMXBean().getName().split("@")[0];
try {
while (true) {
System.out.println("[Target] I am the target JVM (PID: " + pid + ")");
say();
Thread.sleep(1000);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Binary file not shown.
@@ -0,0 +1,25 @@
import cn.xiaozhou233.juiceagent.api.JuiceAgent;
public class payload {
public static void entry() throws java.io.IOException {
System.out.println("Payload loaded!");
java.io.InputStream in = new java.io.FileInputStream("new_target.class");
java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();
byte[] buf = new byte[4096];
int len;
while ((len = in.read(buf)) != -1) {
out.write(buf, 0, len);
}
byte[] bytes = out.toByteArray();
in.close();
JuiceAgent.retransformClassByName(
"target",
bytes,
bytes.length
);
System.out.println("Payload executed!");
}
}
+14
View File
@@ -0,0 +1,14 @@
@echo off
setlocal
java -jar target.jar
if errorlevel 1 goto :error
goto :end
:error
echo Run failed.
exit /b 1
:end
endlocal
Binary file not shown.
@@ -0,0 +1,20 @@
import java.lang.management.ManagementFactory;
public class target {
public static void say() {
System.out.println("Hello!");
}
public static void main(String[] args) {
String pid = ManagementFactory.getRuntimeMXBean().getName().split("@")[0];
try {
while (true) {
System.out.println("[Target] I am the target JVM (PID: " + pid + ")");
say();
Thread.sleep(1000);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
+104
View File
@@ -0,0 +1,104 @@
# 如何使用 — retransform-class
**前置条件:** Java 8+(构建需要 `javac`/`jar`,注入需要 `jps`)
## 目录文件
| 文件 | 说明 |
| --- | --- |
| `injector.exe` `libagent.dll` `libinject.dll` `libloader.dll` | JuiceAgent 运行库 |
| `config.toml` | 注入配置 |
| `build.bat` | 构建脚本 |
| `run.bat` | 运行目标 JVM |
| `payload.jar` | 注入用的 JAR(由 `build.bat` 生成) |
| `target.jar` | 目标 JVM 程序(由 `build.bat` 生成) |
| `new_target.class` | 重变换后的字节码(由 `build.bat` 生成) |
| `payload/` | payload 源码 |
| `target/` | 目标类源码 |
| `new_target/` | target 的修改版源码 |
## 本示例的作用
目标类 `target` 的 `say()` 方法原本打印:
```
Hello!
```
`new_target/target.java` 是它的修改版,额外打印:
```
Retransformed!
```
本示例把 `payload.jar` 注入到运行中的 JVM。payload 从自己的 JAR 中读取
`new_target.class`,调用 `JuiceAgent.retransformClassByName("target", ...)`
在运行时动态替换已加载的 `target` 类。之后 `say()` 无需重启 JVM 就会输出新内容。
## 使用步骤
### 1. 构建(可选)
`payload.jar` 和 `target.jar` 默认已包含。
如果修改了 `payload/`、`target/` 或 `new_target/`,运行:
```
build.bat
```
重新生成 `payload.jar`、`target.jar` 和 `new_target.class`。
### 2. 运行目标 JVM
双击 `run.bat`(或执行 `java -jar target.jar`)。黑窗口出现并每秒打印:
```
[Target] I am the target JVM (PID: <PID>)
Hello!
```
### 3. 注入
双击 `injector.exe`,输入目标 PID 后回车:
```
6644 target.jar
10504 jdk.jcmd/sun.tools.jps.Jps
Input PID: 6644
```
### 4. 验证
回到目标窗口,注入成功应看到:
```
Payload loaded!
Payload executed!
```
并且 `say()` 的输出从 `Hello!` 变为:
```
Hello!
Retransformed!
```
## 配置 / config.toml
| 配置项 | 说明 |
| --- | --- |
| `JarPath` | 注入的 JAR 路径(默认 `./payload.jar`) |
| `EntryClass` | 入口类(默认 `payload`) |
| `EntryMethod` | 入口方法,必须为 `public static void entry()` |
## 常见问题
- `java/javac/jar is not recognized`:
安装 JDK 并将 `bin` 目录加入 `PATH`。
- `injector.exe` 提示注入失败:
确认目标 JVM 正在运行且 PID 正确。
- 没有出现 `Payload loaded!` 输出:
查看本目录下的 `libagent.log` 和 `libloader.log` 定位原因。
- `say()` 输出没有变化:
确认修改 `new_target/` 后重新运行过 `build.bat`,且 `payload.jar` 内的
`new_target.class` 是最新的。
@@ -0,0 +1,82 @@
============================================
如何使用
============================================
前置条件: Java 8+ (构建需要 javac/jar, 注入需要 jps)
目录文件:
injector.exe libagent.dll libinject.dll libloader.dll - JuiceAgent 运行库
config.toml - 注入配置
build.bat - 构建脚本
run.bat - 运行目标 JVM
payload.jar - 注入用的 JAR (由 build.bat 生成)
target.jar - 目标 JVM 程序 (由 build.bat 生成)
new_target.class - 重变换后的字节码 (由 build.bat 生成)
payload/ - payload 源码
target/ - 目标类源码
new_target/ - target 的修改版源码
============================================
本示例的作用
============================================
目标类 "target" 的 say() 方法原本打印:
Hello!
new_target/target.java 是它的修改版, 额外打印:
Retransformed!
本示例把 payload.jar 注入到运行中的 JVM。payload 从自己的 JAR 中读取
new_target.class, 调用 JuiceAgent.retransformClassByName("target", ...)
在运行时动态替换已加载的 "target" 类。之后 say() 无需重启 JVM 就会输出新内容。
============================================
使用步骤
============================================
1. 构建 (可选)
payload.jar 和 target.jar 默认已包含。
如果修改了 payload/、target/ 或 new_target/, 运行:
build.bat
重新生成 payload.jar、target.jar 和 new_target.class。
2. 运行目标 JVM
双击 run.bat (或执行: java -jar target.jar)。黑窗口出现并每秒打印:
[Target] I am the target JVM (PID: <PID>)
Hello!
3. 注入
双击 injector.exe, 输入目标 PID 后回车:
6644 target.jar
10504 jdk.jcmd/sun.tools.jps.Jps
Input PID: 6644
4. 验证
回到目标窗口, 注入成功应看到:
Payload loaded!
Payload executed!
并且 say() 的输出从 "Hello!" 变为:
Hello!
Retransformed!
============================================
配置 / config.toml
============================================
JarPath - 注入的 JAR 路径 (默认: ./payload.jar)
EntryClass - 入口类 (默认: payload)
EntryMethod - 入口方法, 必须为 public static void entry()
============================================
常见问题
============================================
- "java/javac/jar is not recognized":
安装 JDK 并将 bin 目录加入 PATH。
- injector.exe 提示注入失败:
确认目标 JVM 正在运行且 PID 正确。
- 没有出现 "Payload loaded!" 输出:
查看本目录下的 libagent.log 和 libloader.log 定位原因。
- say() 输出没有变化:
确认修改 new_target/ 后重新运行过 build.bat, 且 payload.jar 内的
new_target.class 是最新的。
+142
View File
@@ -0,0 +1,142 @@
#pragma once
#include <filesystem>
#include <optional>
#include <toml++/toml.h>
#include <string>
#include <vector>
#include <cstddef>
#include <JuiceAgent/Logger.hpp>
namespace JuiceAgent::Config {
class Config {
private:
toml::table _config;
std::optional<toml::parse_error> _last_error;
std::filesystem::path _runtime_dir;
std::filesystem::path _config_path;
bool _valid = false;
public:
explicit Config(const std::filesystem::path& runtime_dir = {}) {
// Check if the runtime directory is empty
if (runtime_dir.empty()) {
// Use the default runtime directory
_runtime_dir = std::filesystem::current_path();
} else {
_runtime_dir = runtime_dir;
}
_config_path = _runtime_dir / "config.toml";
// Load the config file.
//
// This must never throw: when libloader runs from the reflectively
// loaded DLL its unwind tables are not registered, so a C++ exception
// raised here could not be caught and would crash the target process.
// toml++ switches to non-throwing mode (parse_result) automatically
// when exceptions are disabled.
#if TOML_EXCEPTIONS
try {
_config = toml::parse_file(_config_path.string());
_valid = true;
} catch (const toml::parse_error& e) {
spdlog::error("Failed to parse config file: {}", e.description());
_last_error = e;
}
#else
toml::parse_result result = toml::parse_file(_config_path.string());
if (result.succeeded()) {
_config = std::move(result).table();
_valid = true;
} else {
spdlog::error("Failed to parse config file: {}", result.error().description());
_last_error = result.error();
}
#endif
}
// Non-throwing lookup: returns defaultValue when the key is missing or has
// the wrong type. There is deliberately no throwing overload - callers that
// require a key must check contains() first.
template<typename T>
T get(const std::string& path, T defaultValue) const {
const auto* node = _config.at_path(path).node();
if (!node) {
// Configuration key is missing; use the default value.
spdlog::warn("Configuration key not found: {}, using default value", path);
return defaultValue;
}
auto value = node->value<T>();
if (!value) {
// Configuration type mismatch; use the default value.
spdlog::warn("Configuration type mismatch: {}, using default value", path);
return defaultValue;
}
return *value;
}
std::string getPath(
const std::string& key,
const std::string& defaultValue
) const {
std::string rawValue = get<std::string>(key, defaultValue);
// Use the default value when the configuration value is empty.
if (rawValue.empty()) {
rawValue = defaultValue;
}
if (rawValue.empty()) {
return {};
}
const std::filesystem::path value(rawValue);
if (value.is_absolute()) {
return value.lexically_normal().string();
}
const std::string normalized = value.generic_string();
if (normalized == "." || normalized.starts_with("./")) {
return (_runtime_dir / value).lexically_normal().string();
}
return value.lexically_normal().string();
}
bool contains(const std::string& path) const {
return _config.at_path(path).node() != nullptr;
}
// Getters
const toml::table& getConfig() const {
return _config;
}
const std::filesystem::path& getRuntimeDir() const {
return _runtime_dir;
}
const std::filesystem::path& getConfigPath() const {
return _config_path;
}
const std::optional<toml::parse_error>& getLastError() const {
return _last_error;
}
bool isValid() const {
return _valid;
}
};
} // namespace JuiceAgent::Config
@@ -0,0 +1,896 @@
#pragma once
#include <cstddef>
namespace JuiceAgent::Resource {
static const unsigned char juiceagent_api_bytes[] = {
0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00, 0xdd, 0x72,
0x95, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x4d, 0x45, 0x54, 0x41, 0x2d, 0x49,
0x4e, 0x46, 0x2f, 0x03, 0x00, 0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x00,
0x08, 0x08, 0x00, 0xd9, 0x72, 0x95, 0x5c, 0xcf, 0x58, 0x6d, 0xcb, 0x2d,
0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x4d,
0x45, 0x54, 0x41, 0x2d, 0x49, 0x4e, 0x46, 0x2f, 0x4d, 0x41, 0x4e, 0x49,
0x46, 0x45, 0x53, 0x54, 0x2e, 0x4d, 0x46, 0xf3, 0x4d, 0xcc, 0xcb, 0x4c,
0x4b, 0x2d, 0x2e, 0xd1, 0x0d, 0x4b, 0x2d, 0x2a, 0xce, 0xcc, 0xcf, 0xb3,
0x52, 0x30, 0xd4, 0x33, 0xe0, 0xe5, 0x72, 0x2a, 0xcd, 0xcc, 0x49, 0x41,
0x16, 0x33, 0xd1, 0x33, 0xd4, 0x4e, 0x02, 0x09, 0xea, 0x19, 0xf2, 0x72,
0xf1, 0x72, 0x01, 0x00, 0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x00, 0x08,
0x08, 0x00, 0xdd, 0x72, 0x95, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x63, 0x6e,
0x2f, 0x03, 0x00, 0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x00, 0x08, 0x08,
0x00, 0xdd, 0x72, 0x95, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x63, 0x6e, 0x2f,
0x78, 0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f,
0x03, 0x00, 0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00,
0xdd, 0x72, 0x95, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x63, 0x6e, 0x2f, 0x78,
0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f, 0x6a,
0x75, 0x69, 0x63, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x03, 0x00,
0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00, 0xdd, 0x72,
0x95, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x63, 0x6e, 0x2f, 0x78, 0x69, 0x61,
0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f, 0x6a, 0x75, 0x69,
0x63, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f,
0x03, 0x00, 0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00,
0xdd, 0x72, 0x95, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x63, 0x6e, 0x2f, 0x78,
0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f, 0x6a,
0x75, 0x69, 0x63, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f,
0x03, 0x00, 0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00,
0xdd, 0x72, 0x95, 0x5c, 0x89, 0xbd, 0x76, 0xf7, 0x74, 0x01, 0x00, 0x00,
0xf9, 0x02, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x63, 0x6e, 0x2f, 0x78,
0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f, 0x6a,
0x75, 0x69, 0x63, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f,
0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x42, 0x72, 0x69,
0x64, 0x67, 0x65, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x9d, 0x92, 0xd9,
0x4a, 0x43, 0x31, 0x10, 0x86, 0xff, 0xb4, 0xc7, 0x6e, 0xd6, 0x7d, 0x5f,
0x1e, 0xa0, 0x7a, 0x61, 0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0, 0x53, 0xac, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0x3a,
0x00, 0x00, 0x00, 0x63, 0x6e, 0x2f, 0x78, 0x69, 0x61, 0x6f, 0x7a, 0x68,
0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f, 0x6a, 0x75, 0x69, 0x63, 0x65, 0x61,
0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x62, 0x6f, 0x6f,
0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x4c, 0x6f, 0x61, 0x64, 0x65,
0x72, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x63, 0x6c, 0x61, 0x73,
0x73, 0x4d, 0x4e, 0x31, 0x0a, 0xc2, 0x40, 0x10, 0x9c, 0xd5, 0x68, 0x34,
0x36, 0x5a, 0xf8, 0x07, 0x6d, 0x3c, 0x30, 0xe9, 0xec, 0x04, 0xad, 0x02,
0x16, 0x82, 0xfd, 0x26, 0x1e, 0xe7, 0x85, 0x70, 0x17, 0x2e, 0x17, 0x51,
0x9f, 0x66, 0xe1, 0x03, 0x7c, 0x94, 0x98, 0x54, 0x3a, 0xc5, 0x0c, 0xcc,
0xcc, 0xb2, 0xf3, 0xfe, 0x3c, 0x5f, 0x00, 0x12, 0x4c, 0x42, 0x8c, 0x43,
0x44, 0x84, 0xa8, 0xf6, 0xec, 0xfc, 0xce, 0x78, 0x77, 0x27, 0xf4, 0x17,
0xcb, 0x53, 0xcb, 0xa5, 0x55, 0x84, 0xf9, 0x22, 0x2d, 0xf8, 0xca, 0xa2,
0x64, 0xa3, 0xc4, 0xd1, 0x3b, 0x6d, 0xd4, 0xa6, 0x4b, 0xa3, 0xa3, 0x6d,
0x5c, 0x2e, 0xf7, 0xba, 0x94, 0x84, 0x59, 0x6a, 0xf9, 0x2c, 0xdd, 0xd6,
0xe9, 0xb3, 0x92, 0xab, 0xae, 0x4f, 0x48, 0x72, 0x23, 0x6e, 0x9a, 0xed,
0xe3, 0x62, 0x9b, 0x75, 0x1c, 0x8b, 0xa2, 0xd1, 0xb9, 0x64, 0x25, 0x8d,
0x17, 0x5c, 0x69, 0x91, 0x59, 0xeb, 0x6b, 0xef, 0xb8, 0x12, 0xff, 0xb7,
0x84, 0xe9, 0xef, 0xdb, 0x21, 0x2b, 0x64, 0xee, 0x87, 0x04, 0x42, 0x0f,
0x1d, 0x7a, 0x41, 0xbb, 0x0a, 0x01, 0xd0, 0xea, 0x00, 0xc3, 0xd6, 0x21,
0x84, 0x9d, 0x8f, 0xd1, 0x17, 0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x00,
0x08, 0x08, 0x00, 0xdd, 0x72, 0x95, 0x5c, 0x7b, 0x04, 0xd3, 0xdd, 0x5f,
0x04, 0x00, 0x00, 0xf7, 0x07, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x63,
0x6e, 0x2f, 0x78, 0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33,
0x33, 0x2f, 0x6a, 0x75, 0x69, 0x63, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74,
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x49, 0x6e, 0x6a, 0x65, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73,
0x95, 0x55, 0xdd, 0x53, 0x1b, 0x55, 0x14, 0xff, 0xdd, 0x7c, 0xed, 0x66,
0x59, 0x08, 0x04, 0x12, 0x1a, 0x11, 0x58, 0x3e, 0xe4, 0x9b, 0xa6, 0x42,
0x8d, 0x14, 0x68, 0x2b, 0xa5, 0x50, 0x83, 0x81, 0x62, 0x69, 0xa9, 0x50,
0xd4, 0xb9, 0x09, 0x6b, 0x58, 0x58, 0x76, 0xe3, 0x66, 0xc3, 0x50, 0x9f,
0xfd, 0x27, 0xfa, 0xe4, 0x8c, 0x2f, 0x99,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xdd, 0x72, 0x95, 0x5c, 0x09, 0xad,
0xfd, 0x53, 0x35, 0x02, 0x00, 0x00, 0x34, 0x04, 0x00, 0x00, 0x39, 0x00,
0x00, 0x00, 0x63, 0x6e, 0x2f, 0x78, 0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f,
0x75, 0x32, 0x33, 0x33, 0x2f, 0x6a, 0x75, 0x69, 0x63, 0x65, 0x61, 0x67,
0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x4a, 0x75, 0x69, 0x63,
0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74,
0x72, 0x61, 0x70, 0x24, 0x31, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x9d,
0x53, 0x5b, 0x6f, 0x12, 0x41, 0x14, 0xfe, 0xa6, 0x5c, 0x16, 0x70, 0x6d,
0x2b, 0xbd, 0x50, 0xaf, 0x05, 0xa5, 0x0a, 0xd4, 0x76, 0x4b, 0xa1, 0xf6,
0x01, 0x63, 0x62, 0x9b, 0x36, 0xd1, 0xe0, 0x25, 0x62, 0x9a, 0x18, 0xe3,
0xc3, 0x00, 0x13, 0x18, 0xb2, 0xec, 0x90, 0xdd, 0xc1, 0x58, 0xff, 0x95,
0x3e, 0xd0, 0x44, 0x13, 0x7f, 0x80, 0x3f, 0xca, 0x78, 0x06, 0xb0, 0x58,
0x21, 0x26, 0xfa, 0x30, 0x73, 0xee, 0xdf, 0x7c, 0x73, 0xce, 0xcc, 0xf7,
0x1f, 0x5f, 0xbe, 0x01, 0x28, 0x63, 0x3f, 0x81, 0x4b, 0x58, 0x8f, 0x23,
0x8d, 0x4c, 0x0c, 0xb7, 0x13, 0xb8, 0x83, 0xac, 0x85, 0x8d, 0x04, 0x22,
0x58, 0x8f, 0xe1, 0xae, 0x91, 0xf7, 0xcc, 0x96, 0xb3, 0x90, 0xb7, 0x50,
0xb0, 0xb0, 0xc9, 0x10, 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xf1, 0xcf, 0x98, 0x4b, 0x86, 0x06, 0x08, 0x4f, 0x00, 0x12, 0x24, 0x81,
0x2c, 0x62, 0xd8, 0xf8, 0x0d, 0x24, 0x7e, 0x0e, 0xb2, 0x8a, 0xd4, 0x18,
0xe4, 0x15, 0x31, 0x32, 0xb9, 0xd7, 0x08, 0xe4, 0x2b, 0x22, 0x6f, 0xce,
0x10, 0x4d, 0x5a, 0x03, 0xc4, 0x36, 0x69, 0x0d, 0x10, 0x9f, 0x81, 0x9a,
0xc7, 0x55, 0x14, 0x86, 0xa8, 0xab, 0xa3, 0xca, 0x31, 0xaa, 0xd1, 0xd6,
0x28, 0x46, 0x73, 0x20, 0xcd, 0xd4, 0x5c, 0xc7, 0x0d, 0x92, 0x61, 0xdc,
0xc4, 0x2d, 0x2c, 0x0d, 0xeb, 0xe9, 0x87, 0x0c, 0x33, 0x63, 0x3f, 0x01,
0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00, 0xdd, 0x72,
0x95, 0x5c, 0x8f, 0x63, 0xf6, 0x0e, 0x07, 0x04, 0x00, 0x00, 0x35, 0x08,
0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x63, 0x6e, 0x2f, 0x78, 0x69, 0x61,
0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f, 0x6a, 0x75, 0x69,
0x63, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f,
0x4a, 0x75, 0x69, 0x63, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x42, 0x6f,
0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2e, 0x63, 0x6c, 0x61, 0x73,
0x73, 0x95, 0x55, 0x5f, 0x53, 0x1b, 0x55, 0x14, 0xff, 0x5d, 0x02, 0x6c,
0x58, 0x96, 0x42, 0x03, 0x15, 0x8a, 0x82, 0x0b, 0x56, 0x4d, 0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x8d, 0xe8, 0x71, 0x74, 0xe1, 0x2c, 0x9d, 0x69, 0x24, 0xe8, 0x9e,
0xea, 0xc6, 0x77, 0xe8, 0xc1, 0xf7, 0xf4, 0x51, 0x7d, 0x84, 0x3e, 0x3c,
0xc1, 0x49, 0xfc, 0x8c, 0x7e, 0xfc, 0x82, 0x01, 0xfc, 0x46, 0x9f, 0xd3,
0xdf, 0xa9, 0x0b, 0x7f, 0x12, 0x5a, 0x97, 0xd5, 0x8e, 0x4a, 0x47, 0xdc,
0xb9, 0xb0, 0xac, 0x7f, 0x50, 0x2f, 0xde, 0xa3, 0xc2, 0x3e, 0xa2, 0x2f,
0xf0, 0x18, 0xce, 0x53, 0x23, 0xc6, 0x49, 0xde, 0x81, 0xd8, 0xdf, 0x78,
0x62, 0xe0, 0x82, 0x81, 0xf7, 0x07, 0xfa, 0x49, 0xf8, 0x41, 0xd8, 0xa3,
0x8b, 0x78, 0x8b, 0xa8, 0x49, 0xf0, 0xc1, 0xb0, 0xa9, 0xf1, 0x7f, 0x01,
0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00, 0xdd, 0x72,
0x95, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x63, 0x6e, 0x2f, 0x78, 0x69, 0x61,
0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f, 0x6a, 0x75, 0x69,
0x63, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f,
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x03, 0x00, 0x50, 0x4b,
0x03, 0x04, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00, 0xdd, 0x72, 0x95, 0x5c,
0x19, 0x77, 0xde, 0xdf, 0x52, 0x08, 0x00, 0x00, 0xcd, 0x11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00, 0x24, 0x00, 0x00, 0x00, 0x63, 0x6e, 0x2f,
0x78, 0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f,
0x6a, 0x75, 0x69, 0x63, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61,
0x70, 0x69, 0x2f, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x2f, 0x03, 0x00, 0x50,
0x4b, 0x03, 0x04, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00, 0xdd, 0x72, 0x95,
0x5c, 0x50, 0xe7, 0x20, 0x38, 0xbd, 0x07, 0x00, 0x00, 0xd4, 0x10, 0x00,
0x00, 0x36, 0x00, 0x00, 0x00, 0x63, 0x6e, 0x2f, 0x78, 0x69, 0x61, 0x6f,
0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f, 0x6a, 0x75, 0x69, 0x63,
0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75,
0x74, 0x69, 0x6c, 0x73, 0x2f, 0x44, 0x65, 0x73, 0x65, 0x72, 0x69, 0x61,
0x6c, 0x69, 0x7a, 0x65, 0x72, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x95,
0x57, 0xfb, 0x73, 0x13, 0xd7, 0x19, 0x3d, 0x6b, 0xad, 0xb4, 0xd2, 0x7a,
0xfd, 0x90, 0xb1, 0x48, 0x0c, 0x4e, 0x0c, 0x84, 0x52, 0x59, 0xc6, 0x11,
0x81, 0xc4, 0x26, 0x36, 0xb8, 0xc1, 0x36, 0x26, 0x76, 0x8c, 0x69, 0x71,
0x0a, 0xc5, 0x09, 0x34, 0x6b, 0x69, 0x6d, 0xaf, 0x2d, 0xaf, 0x14, 0x69,
0xe5, 0x00, 0x49, 0xc8, 0xa3, 0xf4, 0x41, 0xda, 0xb4, 0x49, 0x9a, 0xb4,
0x35, 0x7d, 0xd1, 0x94,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,
0x59, 0xbd, 0xff, 0x75, 0xcf, 0xfd, 0xfc, 0x62, 0x2b, 0xee, 0x6f, 0x5b,
0xb9, 0x7f, 0xdb, 0xd2, 0x6b, 0xac, 0x50, 0xaf, 0x6f, 0x42, 0xc3, 0x5b,
0x9e, 0x18, 0x63, 0x18, 0xbf, 0x93, 0x8e, 0xf4, 0xce, 0x9a, 0x1d, 0x69,
0x82, 0x3a, 0x9b, 0x7d, 0xbb, 0x1c, 0xc4, 0xbf, 0x1a, 0xa4, 0xd2, 0x03,
0x64, 0xaa, 0xb8, 0x9a, 0x92, 0x6c, 0xa6, 0xd9, 0x1f, 0x7d, 0xff, 0x9f,
0x8d, 0xf1, 0x3f, 0xfa, 0xe3, 0x4a, 0x40, 0x47, 0x6a, 0xd3, 0xff, 0x05,
0x50, 0x4b, 0x01, 0x02, 0x14, 0x03, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00,
0xdd, 0x72, 0x95, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x10, 0x00, 0xed, 0x41, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x45,
0x54, 0x41, 0x2d, 0x49, 0x4e, 0x46, 0x2f, 0x50, 0x4b, 0x01, 0x02, 0x14,
0x03, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00, 0xd9, 0x72, 0x95, 0x5c, 0xcf,
0x58, 0x6d, 0xcb, 0x2d, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x14,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa4,
0x81, 0x29, 0x00, 0x00, 0x00, 0x4d, 0x45, 0x54, 0x41, 0x2d, 0x49, 0x4e,
0x46, 0x2f, 0x4d, 0x41, 0x4e, 0x49, 0x46, 0x45, 0x53, 0x54, 0x2e, 0x4d,
0x46, 0x50, 0x4b, 0x01, 0x02, 0x14, 0x03, 0x14, 0x00, 0x00, 0x08, 0x08,
0x00, 0xdd, 0x72, 0x95, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10, 0x00, 0xed, 0x41, 0x88, 0x00, 0x00, 0x00, 0x63,
0x6e, 0x2f, 0x50, 0x4b, 0x01, 0x02, 0x14, 0x03, 0x14, 0x00, 0x00, 0x08,
0x08, 0x00, 0xdd, 0x72, 0x95, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xed, 0x41, 0xab, 0x00, 0x00, 0x00,
0x63, 0x6e, 0x2f, 0x78, 0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32,
0x33, 0x33, 0x2f, 0x50, 0x4b, 0x01, 0x02, 0x14, 0x03, 0x14, 0x00, 0x00,
0x08, 0x08, 0x00, 0xdd, 0x72, 0x95, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xed, 0x41, 0xda, 0x00, 0x00,
0x00, 0x63, 0x6e, 0x2f, 0x78, 0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f, 0x75,
0x32, 0x33, 0x33, 0x2f, 0x6a, 0x75, 0x69, 0x63, 0x65, 0x61, 0x67, 0x65,
0x6e, 0x74, 0x2f, 0x50, 0x4b, 0x01, 0x02, 0x14, 0x03, 0x14, 0x00, 0x00,
0x08, 0x08, 0x00, 0xdd, 0x72, 0x95, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xed, 0x41, 0x14, 0x01, 0x00,
0x00, 0x63, 0x6e, 0x2f, 0x78, 0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f, 0x75,
0x32, 0x33, 0x33, 0x2f, 0x6a, 0x75, 0x69, 0x63, 0x65, 0x61, 0x67, 0x65,
0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x50, 0x4b, 0x01, 0x02, 0x14,
0x03, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00, 0xdd, 0x72, 0x95, 0x5c, 0x00,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xed,
0x41, 0x52, 0x01, 0x00, 0x00, 0x63, 0x6e, 0x2f, 0x78, 0x69, 0x61, 0x6f,
0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f, 0x6a, 0x75, 0x69, 0x63,
0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x62,
0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x50, 0x4b, 0x01,
0x02, 0x14, 0x03, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00, 0xdd, 0x72, 0x95,
0x5c, 0x89, 0xbd, 0x76, 0xf7, 0x74, 0x01, 0x00, 0x00, 0xf9, 0x02, 0x00,
0x00, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xa4, 0x81, 0x9a, 0x01, 0x00, 0x00, 0x63, 0x6e, 0x2f, 0x78, 0x69,
0x61, 0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f, 0x6a, 0x75,
0x69, 0x63, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69,
0x2f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x42,
0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x42, 0x72, 0x69, 0x64,
0x67, 0x65, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x50, 0x4b, 0x01, 0x02,
0x14, 0x03, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00, 0xdd, 0x72, 0x95, 0x5c,
0xfd, 0xd1, 0xa0, 0x53, 0xac, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00,
0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xa4, 0x81, 0x69, 0x03, 0x00, 0x00, 0x63, 0x6e, 0x2f, 0x78, 0x69, 0x61,
0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f, 0x6a, 0x75, 0x69,
0x63, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f,
0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x2f, 0x4c, 0x6f,
0x61, 0x64, 0x65, 0x72, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x63,
0x6c, 0x61, 0x73, 0x73, 0x50, 0x4b, 0x01, 0x02, 0x14, 0x03, 0x14, 0x00,
0x00, 0x08, 0x08, 0x00, 0xdd, 0x72, 0x95, 0x5c, 0x7b, 0x04, 0xd3, 0xdd,
0x5f, 0x04, 0x00, 0x00, 0xf7, 0x07, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x81, 0x6d, 0x04,
0x00, 0x00, 0x63, 0x6e, 0x2f, 0x78, 0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f,
0x75, 0x32, 0x33, 0x33, 0x2f, 0x6a, 0x75, 0x69, 0x63, 0x65, 0x61, 0x67,
0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x49, 0x6e, 0x6a, 0x65,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x63, 0x6c,
0x61, 0x73, 0x73, 0x50, 0x4b, 0x01, 0x02, 0x14, 0x03, 0x14, 0x00, 0x00,
0x08, 0x08, 0x00, 0xdd, 0x72, 0x95, 0x5c, 0x40, 0xc9, 0x71, 0xc0, 0x05,
0x02, 0x00, 0x00, 0xae, 0x04, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x81, 0x1b, 0x09, 0x00,
0x00, 0x63, 0x6e, 0x2f, 0x78, 0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f, 0x75,
0x32, 0x33, 0x33, 0x2f, 0x6a, 0x75, 0x69, 0x63, 0x65, 0x61, 0x67, 0x65,
0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x4a, 0x75, 0x69, 0x63, 0x65,
0x41, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x50,
0x4b, 0x01, 0x02, 0x14, 0x03, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00, 0xdd,
0x72, 0x95, 0x5c, 0x09, 0xad, 0xfd, 0x53, 0x35, 0x02, 0x00, 0x00, 0x34,
0x04, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xa4, 0x81, 0x6c, 0x0b, 0x00, 0x00, 0x63, 0x6e, 0x2f,
0x78, 0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f,
0x6a, 0x75, 0x69, 0x63, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61,
0x70, 0x69, 0x2f, 0x4a, 0x75, 0x69, 0x63, 0x65, 0x41, 0x67, 0x65, 0x6e,
0x74, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x24, 0x31,
0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x50, 0x4b, 0x01, 0x02, 0x14, 0x03,
0x14, 0x00, 0x00, 0x08, 0x08, 0x00, 0xdd, 0x72, 0x95, 0x5c, 0x8f, 0x63,
0xf6, 0x0e, 0x07, 0x04, 0x00, 0x00, 0x35, 0x08, 0x00, 0x00, 0x37, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x81,
0xf8, 0x0d, 0x00, 0x00, 0x63, 0x6e, 0x2f, 0x78, 0x69, 0x61, 0x6f, 0x7a,
0x68, 0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f, 0x6a, 0x75, 0x69, 0x63, 0x65,
0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x4a, 0x75,
0x69, 0x63, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x42, 0x6f, 0x6f, 0x74,
0x73, 0x74, 0x72, 0x61, 0x70, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x50,
0x4b, 0x01, 0x02, 0x14, 0x03, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00, 0xdd,
0x72, 0x95, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x10, 0x00, 0xed, 0x41, 0x54, 0x12, 0x00, 0x00, 0x63, 0x6e, 0x2f,
0x78, 0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f,
0x6a, 0x75, 0x69, 0x63, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61,
0x70, 0x69, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x50,
0x4b, 0x01, 0x02, 0x14, 0x03, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00, 0xdd,
0x72, 0x95, 0x5c, 0x19, 0x77, 0xde, 0xdf, 0x52, 0x08, 0x00, 0x00, 0xcd,
0x11, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xa4, 0x81, 0x9a, 0x12, 0x00, 0x00, 0x63, 0x6e, 0x2f,
0x78, 0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33, 0x33, 0x2f,
0x6a, 0x75, 0x69, 0x63, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x61,
0x70, 0x69, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x4a,
0x61, 0x72, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x63, 0x6c, 0x61,
0x73, 0x73, 0x50, 0x4b, 0x01, 0x02, 0x14, 0x03, 0x14, 0x00, 0x00, 0x08,
0x08, 0x00, 0xdd, 0x72, 0x95, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xed, 0x41, 0x3f, 0x1b, 0x00, 0x00,
0x63, 0x6e, 0x2f, 0x78, 0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32,
0x33, 0x33, 0x2f, 0x6a, 0x75, 0x69, 0x63, 0x65, 0x61, 0x67, 0x65, 0x6e,
0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x2f,
0x50, 0x4b, 0x01, 0x02, 0x14, 0x03, 0x14, 0x00, 0x00, 0x08, 0x08, 0x00,
0xdd, 0x72, 0x95, 0x5c, 0x50, 0xe7, 0x20, 0x38, 0xbd, 0x07, 0x00, 0x00,
0xd4, 0x10, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xa4, 0x81, 0x83, 0x1b, 0x00, 0x00, 0x63, 0x6e,
0x2f, 0x78, 0x69, 0x61, 0x6f, 0x7a, 0x68, 0x6f, 0x75, 0x32, 0x33, 0x33,
0x2f, 0x6a, 0x75, 0x69, 0x63, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f,
0x61, 0x70, 0x69, 0x2f, 0x75, 0x74, 0x69, 0x6c, 0x73, 0x2f, 0x44, 0x65,
0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x72, 0x2e, 0x63,
0x6c, 0x61, 0x73, 0x73, 0x50, 0x4b, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00,
0x11, 0x00, 0x11, 0x00, 0x98, 0x05, 0x00, 0x00, 0x94, 0x23, 0x00, 0x00,
0x00, 0x00
};
static const std::size_t juiceagent_api_bytes_len = 10562;
static const char* juiceagent_api_bytes_name = "JuiceAgent-API-1.4.1+build.1.jar";
static const char* juiceagent_api_bytes_mime = "application/java-archive";
static const char* juiceagent_api_bytes_sha256 = "089954f82770dbb59e36f6a168d50d3e9493051ca11fea7e9f0fc81d863df6b0";
} // namespace JuiceAgent::Resource
-18
View File
@@ -1,18 +0,0 @@
#ifndef JUICEAGENT_H
#define JUICEAGENT_H
#define INJECT_PATH_MAX 260
typedef struct _InjectionInfo {
char BootstrapAPIPath[INJECT_PATH_MAX];
char JuiceLoaderJarPath[INJECT_PATH_MAX];
char EntryJarPath[INJECT_PATH_MAX];
char EntryClass[INJECT_PATH_MAX];
char EntryMethod[INJECT_PATH_MAX];
char InjectionDir[INJECT_PATH_MAX];
char JuiceLoaderLibraryPath[INJECT_PATH_MAX];
} InjectionInfoType;
extern InjectionInfoType InjectionInfo;
#endif // JUICEAGENT_H
+3
View File
@@ -0,0 +1,3 @@
#pragma once
const int CONFIG_VERSION = 2;
+54 -12
View File
@@ -1,17 +1,59 @@
// Logger.hpp
#pragma once
#include <plog/Log.h>
#include <plog/Init.h>
#include <plog/Formatters/TxtFormatter.h>
#include <plog/Appenders/ConsoleAppender.h>
#include <plog/Appenders/DebugOutputAppender.h>
inline void InitLogger()
{
static plog::ConsoleAppender<plog::TxtFormatter> consoleAppender;
static plog::DebugOutputAppender<plog::TxtFormatter> debugAppender;
#include <string>
#include <memory>
#include <vector>
plog::init(plog::debug, &consoleAppender).addAppender(&debugAppender);
#include <spdlog/spdlog.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/sinks/basic_file_sink.h>
namespace Logger {
inline void init(
const std::string& file_name = "app.log",
spdlog::level::level_enum level = spdlog::level::trace
) {
static bool initialized = false;
if (initialized) {
spdlog::warn("Logger already initialized, skipping");
return;
}
auto console_sink =
std::make_shared<spdlog::sinks::stdout_color_sink_mt>();
auto file_sink =
std::make_shared<spdlog::sinks::basic_file_sink_mt>(
file_name,
true
);
std::vector<spdlog::sink_ptr> sinks{
console_sink,
file_sink
};
auto logger =
std::make_shared<spdlog::logger>(
"app",
sinks.begin(),
sinks.end()
);
logger->set_level(level);
logger->set_pattern(
"[%Y-%m-%d %H:%M:%S] [%^%l%$] %v"
);
spdlog::set_default_logger(logger);
// Flush after every log message
spdlog::flush_on(spdlog::level::trace);
initialized = true;
}
PLOG_INFO << "Logger initialized: Console + Debug Output";
}
+301
View File
@@ -0,0 +1,301 @@
#pragma once
#include <jvm/jni.h>
#include <jvm/jvmti.h>
#include <JuiceAgent/Logger.hpp>
#include <cstdlib>
#include <filesystem>
#include <fstream>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <charconv>
#include <string_view>
#include <system_error>
namespace JuiceAgent::Utils
{
// JNIEnv::FindClass expects the internal form of a class name where the
// package separator is '/' (e.g. "Example/Main"). Configs and docs use the
// Java binary name with '.' (e.g. "Example.Main"), so normalize it here to
// keep both forms working.
inline std::string to_jni_class_name(const char* name)
{
std::string result(name ? name : "");
for (char& c : result) {
if (c == '.') {
c = '/';
}
}
return result;
}
inline bool check_and_clear_exception(JNIEnv* env, const char* context)
{
if (!env->ExceptionCheck()) {
return false;
}
spdlog::error("JNI Exception occurred at: {}", context);
env->ExceptionDescribe();
env->ExceptionClear();
return true;
}
// Call a static Java method with a single string parameter
inline bool call_static_java_method(JNIEnv* env, const char* clazz, const char* method, const char* params)
{
if (!env || !clazz || !method) {
spdlog::error("Invalid JNI arguments");
return false;
}
constexpr const char* signature = "(Ljava/lang/String;)V";
spdlog::debug("Calling Java method: {}.{} {}", clazz, method, signature);
std::string jni_class = to_jni_class_name(clazz);
jclass cls = env->FindClass(jni_class.c_str());
if (!cls) {
check_and_clear_exception(env, "FindClass failed");
spdlog::error("Class not found: {}", clazz);
return false;
}
jmethodID mid = env->GetStaticMethodID(cls, method, signature);
jstring j_params = mid
? env->NewStringUTF(params ? params : "")
: nullptr;
if (!mid) {
check_and_clear_exception(env, "GetStaticMethodID failed");
spdlog::error("Method not found: {}", method);
}
else if (!j_params) {
spdlog::error("Failed to create jstring");
}
if (!mid || !j_params) {
if (j_params) {
env->DeleteLocalRef(j_params);
}
env->DeleteLocalRef(cls);
return false;
}
env->CallStaticVoidMethod(cls, mid, j_params);
bool success = !env->ExceptionCheck();
check_and_clear_exception(env, "CallStaticVoidMethod failed");
env->DeleteLocalRef(j_params);
env->DeleteLocalRef(cls);
return success;
}
inline bool call_static_java_method(JNIEnv* env, const char* clazz, const char* method)
{
if (!env || !clazz || !method) {
spdlog::error("Invalid JNI arguments");
return false;
}
constexpr const char* signature = "()V";
spdlog::debug("Calling Java method: {}.{} {}", clazz, method, signature);
std::string jni_class = to_jni_class_name(clazz);
jclass cls = env->FindClass(jni_class.c_str());
if (!cls) {
check_and_clear_exception(env, "FindClass failed");
spdlog::error("Class not found: {}", clazz);
return false;
}
jmethodID mid = env->GetStaticMethodID(cls, method, signature);
if (!mid) {
check_and_clear_exception(env, "GetStaticMethodID failed");
spdlog::error("Method not found: {}", method);
env->DeleteLocalRef(cls);
return false;
}
env->CallStaticVoidMethod(cls, mid);
bool success = !env->ExceptionCheck();
check_and_clear_exception(env, "CallStaticVoidMethod failed");
env->DeleteLocalRef(cls);
return success;
}
class Serializer {
public:
template<typename T>
Serializer& add_kv(std::string_view key, const T& value)
{
append_escaped(key);
s += '=';
using ValueType = std::decay_t<T>;
if constexpr (std::is_same_v<ValueType, bool>) {
s += value ? "true" : "false";
}
else if constexpr (std::is_integral_v<ValueType>) {
append_number(value);
}
else if constexpr (std::is_floating_point_v<ValueType>) {
append_number(value);
}
else {
append_escaped(std::string_view(value));
}
s += ';';
return *this;
}
void clear() noexcept
{
s.clear();
}
bool empty() const noexcept
{
return s.empty();
}
const std::string& serialize() const noexcept
{
return s;
}
private:
void append_escaped(std::string_view input)
{
for (char c : input) {
if (c == '=' || c == ';' || c == '\\') {
s += '\\';
}
s += c;
}
}
template<typename T>
void append_number(T value)
{
char buffer[64];
auto [end, ec] = std::to_chars(
buffer,
buffer + sizeof(buffer),
value
);
if (ec == std::errc{}) {
s.append(buffer, end);
}
}
std::string s;
};
inline jobjectArray to_java_string_array(
JNIEnv* env,
const std::vector<std::string>& values)
{
if (!env) {
return nullptr;
}
jclass string_class = env->FindClass("java/lang/String");
if (!string_class) {
return nullptr;
}
jobjectArray result = env->NewObjectArray(
static_cast<jsize>(values.size()),
string_class,
nullptr
);
if (!result) {
env->DeleteLocalRef(string_class);
return nullptr;
}
for (jsize i = 0; i < static_cast<jsize>(values.size()); ++i) {
jstring value = env->NewStringUTF(values[i].c_str());
if (!value) {
env->DeleteLocalRef(result);
env->DeleteLocalRef(string_class);
return nullptr;
}
env->SetObjectArrayElement(result, i, value);
env->DeleteLocalRef(value);
if (env->ExceptionCheck()) {
env->DeleteLocalRef(result);
env->DeleteLocalRef(string_class);
return nullptr;
}
}
env->DeleteLocalRef(string_class);
return result;
}
inline std::string toDelimitedString(const std::vector<std::string>& values,
const std::string& delimiter = ",")
{
std::string result;
for (const auto& value : values) {
if (!result.empty()) {
result += delimiter;
}
result += value;
}
return result;
}
class File {
public:
static std::string write_to_tempfile(
const unsigned char* data,
std::size_t size,
const std::string& name
)
{
#ifdef _WIN32
const char* env = std::getenv("TEMP");
#else
const char* env = std::getenv("TMPDIR");
#endif
std::filesystem::path path = std::filesystem::path(env ? env : ".") / name;
std::ofstream out(path, std::ios::binary | std::ios::trunc);
if (!out) {
spdlog::error("Failed to create temp file {}", path.string());
return {};
}
out.write(reinterpret_cast<const char*>(data), size);
return path.string();
}
};
} // namespace JuiceAgent::Utils
@@ -0,0 +1,117 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class cn_xiaozhou233_juiceagent_api_JuiceAgent */
#ifndef _Included_cn_xiaozhou233_juiceagent_api_JuiceAgent
#define _Included_cn_xiaozhou233_juiceagent_api_JuiceAgent
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: cn_xiaozhou233_juiceagent_api_JuiceAgent
* Method: init
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_init
(JNIEnv *, jclass, jstring);
/*
* Class: cn_xiaozhou233_juiceagent_api_JuiceAgent
* Method: addToBootstrapClassLoaderSearch
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_addToBootstrapClassLoaderSearch
(JNIEnv *, jclass, jstring);
/*
* Class: cn_xiaozhou233_juiceagent_api_JuiceAgent
* Method: addToSystemClassLoaderSearch
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_addToSystemClassLoaderSearch
(JNIEnv *, jclass, jstring);
/*
* Class: cn_xiaozhou233_juiceagent_api_JuiceAgent
* Method: addToClassLoader
* Signature: (Ljava/lang/String;Ljava/lang/ClassLoader;)Z
*/
JNIEXPORT jboolean JNICALL Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_addToClassLoader
(JNIEnv *, jclass, jstring, jobject);
/*
* Class: cn_xiaozhou233_juiceagent_api_JuiceAgent
* Method: defineClass
* Signature: (Ljava/lang/ClassLoader;[B)Ljava/lang/Class;
*/
JNIEXPORT jclass JNICALL Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_defineClass
(JNIEnv *, jclass, jobject, jbyteArray);
/*
* Class: cn_xiaozhou233_juiceagent_api_JuiceAgent
* Method: redefineClass
* Signature: (Ljava/lang/Class;[BI)Z
*/
JNIEXPORT jboolean JNICALL Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_redefineClass
(JNIEnv *, jclass, jclass, jbyteArray, jint);
/*
* Class: cn_xiaozhou233_juiceagent_api_JuiceAgent
* Method: redefineClassByName
* Signature: (Ljava/lang/String;[BI)Z
*/
JNIEXPORT jboolean JNICALL Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_redefineClassByName
(JNIEnv *, jclass, jstring, jbyteArray, jint);
/*
* Class: cn_xiaozhou233_juiceagent_api_JuiceAgent
* Method: retransformClass
* Signature: (Ljava/lang/Class;[BI)Z
*/
JNIEXPORT jboolean JNICALL Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_retransformClass
(JNIEnv *, jclass, jclass, jbyteArray, jint);
/*
* Class: cn_xiaozhou233_juiceagent_api_JuiceAgent
* Method: retransformClassByName
* Signature: (Ljava/lang/String;[BI)Z
*/
JNIEXPORT jboolean JNICALL Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_retransformClassByName
(JNIEnv *, jclass, jstring, jbyteArray, jint);
/*
* Class: cn_xiaozhou233_juiceagent_api_JuiceAgent
* Method: getLoadedClasses
* Signature: ()[Ljava/lang/Class;
*/
JNIEXPORT jobjectArray JNICALL Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_getLoadedClasses
(JNIEnv *, jclass);
/*
* Class: cn_xiaozhou233_juiceagent_api_JuiceAgent
* Method: getClassByName
* Signature: (Ljava/lang/String;)Ljava/lang/Class;
*/
JNIEXPORT jclass JNICALL Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_getClassByName
(JNIEnv *, jclass, jstring);
/*
* Class: cn_xiaozhou233_juiceagent_api_JuiceAgent
* Method: getClassBytes
* Signature: (Ljava/lang/Class;)[B
*/
JNIEXPORT jbyteArray JNICALL Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_getClassBytes
(JNIEnv *, jclass, jclass);
/*
* Class: cn_xiaozhou233_juiceagent_api_JuiceAgent
* Method: getClassBytesByName
* Signature: (Ljava/lang/String;)[B
*/
JNIEXPORT jbyteArray JNICALL Java_cn_xiaozhou233_juiceagent_api_JuiceAgent_getClassBytesByName
(JNIEnv *, jclass, jstring);
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,37 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class cn_xiaozhou233_juiceagent_injector_Injector */
#ifndef _Included_cn_xiaozhou233_juiceagent_injector_Injector
#define _Included_cn_xiaozhou233_juiceagent_injector_Injector
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: cn_xiaozhou233_juiceagent_injector_Injector
* Method: inject
* Signature: (ILjava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_cn_xiaozhou233_juiceagent_injector_Injector_inject__ILjava_lang_String_2
(JNIEnv *, jclass, jint, jstring);
/*
* Class: cn_xiaozhou233_juiceagent_injector_Injector
* Method: inject
* Signature: (ILjava/lang/String;Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_cn_xiaozhou233_juiceagent_injector_Injector_inject__ILjava_lang_String_2Ljava_lang_String_2
(JNIEnv *, jclass, jint, jstring, jstring);
/*
* Class: cn_xiaozhou233_juiceagent_injector_Injector
* Method: findWindowsByTitle
* Signature: (Ljava/lang/String;)[Lcn/xiaozhou233/juiceagent/injector/WindowInfo;
*/
JNIEXPORT jobjectArray JNICALL Java_cn_xiaozhou233_juiceagent_injector_Injector_findWindowsByTitle
(JNIEnv *, jclass, jstring);
#ifdef __cplusplus
}
#endif
#endif
@@ -30,7 +30,7 @@
#define WIN32_LEAN_AND_MEAN
#include <Winsock2.h>
#include <winsock2.h>
#include <windows.h>
#include <intrin.h>
+60
View File
@@ -0,0 +1,60 @@
/*
* Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef _JAVASOFT_JAWT_MD_H_
#define _JAVASOFT_JAWT_MD_H_
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "jawt.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* X11-specific declarations for AWT native interface.
* See notes in jawt.h for an example of use.
*/
typedef struct jawt_X11DrawingSurfaceInfo {
Drawable drawable;
Display* display;
VisualID visualID;
Colormap colormapID;
int depth;
/*
* Since 1.4
* Returns a pixel value from a set of RGB values.
* This is useful for paletted color (256 color) modes.
*/
int (JNICALL *GetAWTColor)(JAWT_DrawingSurface* ds,
int r, int g, int b);
} JAWT_X11DrawingSurfaceInfo;
#ifdef __cplusplus
}
#endif
#endif /* !_JAVASOFT_JAWT_MD_H_ */
+66
View File
@@ -0,0 +1,66 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef _JAVASOFT_JNI_MD_H_
#define _JAVASOFT_JNI_MD_H_
#ifndef __has_attribute
#define __has_attribute(x) 0
#endif
#ifndef JNIEXPORT
#if (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2))) || __has_attribute(visibility)
#ifdef ARM
#define JNIEXPORT __attribute__((externally_visible,visibility("default")))
#else
#define JNIEXPORT __attribute__((visibility("default")))
#endif
#else
#define JNIEXPORT
#endif
#endif
#if (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2))) || __has_attribute(visibility)
#ifdef ARM
#define JNIIMPORT __attribute__((externally_visible,visibility("default")))
#else
#define JNIIMPORT __attribute__((visibility("default")))
#endif
#else
#define JNIIMPORT
#endif
#define JNICALL
typedef int jint;
#ifdef _LP64
typedef long jlong;
#else
typedef long long jlong;
#endif
typedef signed char jbyte;
#endif /* !_JAVASOFT_JNI_MD_H_ */
-47
View File
@@ -1,47 +0,0 @@
#pragma once
#include <plog/Appenders/IAppender.h>
#include <android/log.h>
namespace plog
{
template<class Formatter>
class PLOG_LINKAGE_HIDDEN AndroidAppender : public IAppender
{
public:
AndroidAppender(const char* tag) : m_tag(tag)
{
}
virtual void write(const Record& record) PLOG_OVERRIDE
{
std::string str = Formatter::format(record);
__android_log_print(toPriority(record.getSeverity()), m_tag, "%s", str.c_str());
}
private:
static android_LogPriority toPriority(Severity severity)
{
switch (severity)
{
case fatal:
return ANDROID_LOG_FATAL;
case error:
return ANDROID_LOG_ERROR;
case warning:
return ANDROID_LOG_WARN;
case info:
return ANDROID_LOG_INFO;
case debug:
return ANDROID_LOG_DEBUG;
case verbose:
return ANDROID_LOG_VERBOSE;
default:
return ANDROID_LOG_UNKNOWN;
}
}
private:
const char* const m_tag;
};
}
-23
View File
@@ -1,23 +0,0 @@
#pragma once
#include <plog/Appenders/IAppender.h>
#include <Arduino.h>
namespace plog
{
template<class Formatter>
class PLOG_LINKAGE_HIDDEN ArduinoAppender : public IAppender
{
public:
ArduinoAppender(Stream &stream) : m_stream(stream)
{
}
virtual void write(const Record &record) PLOG_OVERRIDE
{
m_stream.print(Formatter::format(record).c_str());
}
private:
Stream &m_stream;
};
}
@@ -1,108 +0,0 @@
#pragma once
#include <plog/Appenders/ConsoleAppender.h>
#include <plog/WinApi.h>
namespace plog
{
template<class Formatter>
class PLOG_LINKAGE_HIDDEN ColorConsoleAppender : public ConsoleAppender<Formatter>
{
public:
#ifdef _WIN32
# ifdef _MSC_VER
# pragma warning(suppress: 26812) // Prefer 'enum class' over 'enum'
# endif
ColorConsoleAppender(OutputStream outStream = streamStdOut)
: ConsoleAppender<Formatter>(outStream)
, m_originalAttr()
{
if (this->m_isatty)
{
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
GetConsoleScreenBufferInfo(this->m_outputHandle, &csbiInfo);
m_originalAttr = csbiInfo.wAttributes;
}
}
#else
ColorConsoleAppender(OutputStream outStream = streamStdOut)
: ConsoleAppender<Formatter>(outStream)
{}
#endif
virtual void write(const Record& record) PLOG_OVERRIDE
{
util::nstring str = Formatter::format(record);
util::MutexLock lock(this->m_mutex);
setColor(record.getSeverity());
this->writestr(str);
resetColor();
}
protected:
void setColor(Severity severity)
{
if (this->m_isatty)
{
switch (severity)
{
#ifdef _WIN32
case fatal:
SetConsoleTextAttribute(this->m_outputHandle, foreground::kRed | foreground::kGreen | foreground::kBlue | foreground::kIntensity | background::kRed); // white on red background
break;
case error:
SetConsoleTextAttribute(this->m_outputHandle, static_cast<WORD>(foreground::kRed | foreground::kIntensity | (m_originalAttr & 0xf0))); // red
break;
case warning:
SetConsoleTextAttribute(this->m_outputHandle, static_cast<WORD>(foreground::kRed | foreground::kGreen | foreground::kIntensity | (m_originalAttr & 0xf0))); // yellow
break;
case debug:
case verbose:
SetConsoleTextAttribute(this->m_outputHandle, static_cast<WORD>(foreground::kGreen | foreground::kBlue | foreground::kIntensity | (m_originalAttr & 0xf0))); // cyan
break;
#else
case fatal:
this->m_outputStream << "\x1B[97m\x1B[41m"; // white on red background
break;
case error:
this->m_outputStream << "\x1B[91m"; // red
break;
case warning:
this->m_outputStream << "\x1B[93m"; // yellow
break;
case debug:
case verbose:
this->m_outputStream << "\x1B[96m"; // cyan
break;
#endif
default:
break;
}
}
}
void resetColor()
{
if (this->m_isatty)
{
#ifdef _WIN32
SetConsoleTextAttribute(this->m_outputHandle, m_originalAttr);
#else
this->m_outputStream << "\x1B[0m\x1B[0K";
#endif
}
}
private:
#ifdef _WIN32
WORD m_originalAttr;
#endif
};
}
-83
View File
@@ -1,83 +0,0 @@
#pragma once
#include <plog/Appenders/IAppender.h>
#include <plog/Util.h>
#include <plog/WinApi.h>
#include <iostream>
namespace plog
{
enum OutputStream
{
streamStdOut,
streamStdErr
};
template<class Formatter>
class PLOG_LINKAGE_HIDDEN ConsoleAppender : public IAppender
{
public:
#ifdef _WIN32
# ifdef _MSC_VER
# pragma warning(suppress: 26812) // Prefer 'enum class' over 'enum'
# endif
ConsoleAppender(OutputStream outStream = streamStdOut)
: m_isatty(!!_isatty(_fileno(outStream == streamStdOut ? stdout : stderr)))
, m_outputStream(outStream == streamStdOut ? std::cout : std::cerr)
, m_outputHandle()
{
if (m_isatty)
{
m_outputHandle = GetStdHandle(outStream == streamStdOut ? stdHandle::kOutput : stdHandle::kErrorOutput);
}
}
#else
ConsoleAppender(OutputStream outStream = streamStdOut)
: m_isatty(!!isatty(fileno(outStream == streamStdOut ? stdout : stderr)))
, m_outputStream(outStream == streamStdOut ? std::cout : std::cerr)
{}
#endif
virtual void write(const Record& record) PLOG_OVERRIDE
{
util::nstring str = Formatter::format(record);
util::MutexLock lock(m_mutex);
writestr(str);
}
protected:
void writestr(const util::nstring& str)
{
#ifdef _WIN32
if (m_isatty)
{
const std::wstring& wstr = util::toWide(str);
WriteConsoleW(m_outputHandle, wstr.c_str(), static_cast<DWORD>(wstr.size()), NULL, NULL);
}
else
{
# if PLOG_CHAR_IS_UTF8
m_outputStream << str << std::flush;
# else
m_outputStream << util::toNarrow(str, codePage::kActive) << std::flush;
# endif
}
#else
m_outputStream << str << std::flush;
#endif
}
private:
#ifdef __BORLANDC__
static int _isatty(int fd) { return ::isatty(fd); }
#endif
protected:
util::Mutex m_mutex;
const bool m_isatty;
std::ostream& m_outputStream;
#ifdef _WIN32
HANDLE m_outputHandle;
#endif
};
}
@@ -1,16 +0,0 @@
#pragma once
#include <plog/Appenders/IAppender.h>
#include <plog/WinApi.h>
namespace plog
{
template<class Formatter>
class PLOG_LINKAGE_HIDDEN DebugOutputAppender : public IAppender
{
public:
virtual void write(const Record& record) PLOG_OVERRIDE
{
OutputDebugStringW(util::toWide(Formatter::format(record)).c_str());
}
};
}
-42
View File
@@ -1,42 +0,0 @@
#pragma once
#include <plog/Appenders/IAppender.h>
#include <set>
namespace plog
{
class PLOG_LINKAGE_HIDDEN DynamicAppender : public IAppender
{
public:
DynamicAppender& addAppender(IAppender* appender)
{
assert(appender != this);
util::MutexLock lock(m_mutex);
m_appenders.insert(appender);
return *this;
}
DynamicAppender& removeAppender(IAppender* appender)
{
util::MutexLock lock(m_mutex);
m_appenders.erase(appender);
return *this;
}
virtual void write(const Record& record) PLOG_OVERRIDE
{
util::MutexLock lock(m_mutex);
for (std::set<IAppender*>::iterator it = m_appenders.begin(); it != m_appenders.end(); ++it)
{
(*it)->write(record);
}
}
private:
mutable util::Mutex m_mutex;
std::set<IAppender*> m_appenders;
};
}
-117
View File
@@ -1,117 +0,0 @@
#pragma once
#include <plog/Appenders/IAppender.h>
#include <plog/WinApi.h>
namespace plog
{
template <class Formatter>
class PLOG_LINKAGE_HIDDEN EventLogAppender : public IAppender
{
public:
EventLogAppender(const util::nchar* sourceName) : m_eventSource(RegisterEventSourceW(NULL, util::toWide(sourceName).c_str()))
{
}
~EventLogAppender()
{
DeregisterEventSource(m_eventSource);
}
virtual void write(const Record& record) PLOG_OVERRIDE
{
util::nstring str = Formatter::format(record);
write(record.getSeverity(), util::toWide(str).c_str());
}
private:
void write(Severity severity, const wchar_t* str)
{
const wchar_t* logMessagePtr[] = { str };
ReportEventW(m_eventSource, logSeverityToType(severity), static_cast<WORD>(severity), 0, NULL, 1, 0, logMessagePtr, NULL);
}
static WORD logSeverityToType(plog::Severity severity)
{
switch (severity)
{
case plog::fatal:
case plog::error:
return eventLog::kErrorType;
case plog::warning:
return eventLog::kWarningType;
case plog::info:
case plog::debug:
case plog::verbose:
default:
return eventLog::kInformationType;
}
}
private:
HANDLE m_eventSource;
};
class EventLogAppenderRegistry
{
public:
static bool add(const util::nchar* sourceName, const util::nchar* logName = PLOG_NSTR("Application"))
{
std::wstring logKeyName;
std::wstring sourceKeyName;
getKeyNames(sourceName, logName, sourceKeyName, logKeyName);
HKEY sourceKey;
if (0 != RegCreateKeyExW(hkey::kLocalMachine, sourceKeyName.c_str(), 0, NULL, 0, regSam::kSetValue, NULL, &sourceKey, NULL))
{
return false;
}
const DWORD kTypesSupported = eventLog::kErrorType | eventLog::kWarningType | eventLog::kInformationType;
RegSetValueExW(sourceKey, L"TypesSupported", 0, regType::kDword, reinterpret_cast<const BYTE*>(&kTypesSupported), sizeof(kTypesSupported));
const wchar_t kEventMessageFile[] = L"%windir%\\Microsoft.NET\\Framework\\v4.0.30319\\EventLogMessages.dll;%windir%\\Microsoft.NET\\Framework\\v2.0.50727\\EventLogMessages.dll";
RegSetValueExW(sourceKey, L"EventMessageFile", 0, regType::kExpandSz, reinterpret_cast<const BYTE*>(kEventMessageFile), sizeof(kEventMessageFile) - sizeof(*kEventMessageFile));
RegCloseKey(sourceKey);
return true;
}
static bool exists(const util::nchar* sourceName, const util::nchar* logName = PLOG_NSTR("Application"))
{
std::wstring logKeyName;
std::wstring sourceKeyName;
getKeyNames(sourceName, logName, sourceKeyName, logKeyName);
HKEY sourceKey;
if (0 != RegOpenKeyExW(hkey::kLocalMachine, sourceKeyName.c_str(), 0, regSam::kQueryValue, &sourceKey))
{
return false;
}
RegCloseKey(sourceKey);
return true;
}
static void remove(const util::nchar* sourceName, const util::nchar* logName = PLOG_NSTR("Application"))
{
std::wstring logKeyName;
std::wstring sourceKeyName;
getKeyNames(sourceName, logName, sourceKeyName, logKeyName);
RegDeleteKeyW(hkey::kLocalMachine, sourceKeyName.c_str());
RegDeleteKeyW(hkey::kLocalMachine, logKeyName.c_str());
}
private:
static void getKeyNames(const util::nchar* sourceName, const util::nchar* logName, std::wstring& sourceKeyName, std::wstring& logKeyName)
{
const std::wstring kPrefix = L"SYSTEM\\CurrentControlSet\\Services\\EventLog\\";
logKeyName = kPrefix + util::toWide(logName);
sourceKeyName = logKeyName + L"\\" + util::toWide(sourceName);
}
};
}
-16
View File
@@ -1,16 +0,0 @@
#pragma once
#include <plog/Record.h>
#include <plog/Util.h>
namespace plog
{
class PLOG_LINKAGE IAppender
{
public:
virtual ~IAppender()
{
}
virtual void write(const Record& record) = 0;
};
}
@@ -1,148 +0,0 @@
#pragma once
#include <plog/Appenders/IAppender.h>
#include <plog/Converters/UTF8Converter.h>
#include <plog/Converters/NativeEOLConverter.h>
#include <plog/Util.h>
#include <algorithm>
namespace plog
{
template<class Formatter, class Converter = NativeEOLConverter<UTF8Converter> >
class PLOG_LINKAGE_HIDDEN RollingFileAppender : public IAppender
{
public:
RollingFileAppender(const util::nchar* fileName, size_t maxFileSize = 0, int maxFiles = 0)
: m_fileSize()
, m_maxFileSize()
, m_maxFiles(maxFiles)
, m_firstWrite(true)
{
setFileName(fileName);
setMaxFileSize(maxFileSize);
}
#if defined(_WIN32) && !PLOG_CHAR_IS_UTF8
RollingFileAppender(const char* fileName, size_t maxFileSize = 0, int maxFiles = 0)
: m_fileSize()
, m_maxFileSize()
, m_maxFiles(maxFiles)
, m_firstWrite(true)
{
setFileName(fileName);
setMaxFileSize(maxFileSize);
}
#endif
virtual void write(const Record& record) PLOG_OVERRIDE
{
util::MutexLock lock(m_mutex);
if (m_firstWrite)
{
openLogFile();
m_firstWrite = false;
}
else if (m_maxFiles > 0 && m_fileSize > m_maxFileSize && static_cast<size_t>(-1) != m_fileSize)
{
rollLogFiles();
}
size_t bytesWritten = m_file.write(Converter::convert(Formatter::format(record)));
if (static_cast<size_t>(-1) != bytesWritten)
{
m_fileSize += bytesWritten;
}
}
void setFileName(const util::nchar* fileName)
{
util::MutexLock lock(m_mutex);
util::splitFileName(fileName, m_fileNameNoExt, m_fileExt);
m_file.close();
m_firstWrite = true;
}
#if defined(_WIN32) && !PLOG_CHAR_IS_UTF8
void setFileName(const char* fileName)
{
setFileName(util::toWide(fileName).c_str());
}
#endif
void setMaxFiles(int maxFiles)
{
m_maxFiles = maxFiles;
}
void setMaxFileSize(size_t maxFileSize)
{
m_maxFileSize = (std::max)(maxFileSize, static_cast<size_t>(1000)); // set a lower limit for the maxFileSize
}
void rollLogFiles()
{
m_file.close();
util::nstring lastFileName = buildFileName(m_maxFiles - 1);
util::File::unlink(lastFileName);
for (int fileNumber = m_maxFiles - 2; fileNumber >= 0; --fileNumber)
{
util::nstring currentFileName = buildFileName(fileNumber);
util::nstring nextFileName = buildFileName(fileNumber + 1);
util::File::rename(currentFileName, nextFileName);
}
openLogFile();
m_firstWrite = false;
}
private:
void openLogFile()
{
m_fileSize = m_file.open(buildFileName());
if (0 == m_fileSize)
{
size_t bytesWritten = m_file.write(Converter::header(Formatter::header()));
if (static_cast<size_t>(-1) != bytesWritten)
{
m_fileSize += bytesWritten;
}
}
}
util::nstring buildFileName(int fileNumber = 0)
{
util::nostringstream ss;
ss << m_fileNameNoExt;
if (fileNumber > 0)
{
ss << '.' << fileNumber;
}
if (!m_fileExt.empty())
{
ss << '.' << m_fileExt;
}
return ss.str();
}
private:
util::Mutex m_mutex;
util::File m_file;
size_t m_fileSize;
size_t m_maxFileSize;
int m_maxFiles;
util::nstring m_fileExt;
util::nstring m_fileNameNoExt;
bool m_firstWrite;
};
}
@@ -1,44 +0,0 @@
#pragma once
#include <plog/Converters/UTF8Converter.h>
#include <plog/Util.h>
namespace plog
{
template<class NextConverter = UTF8Converter>
class NativeEOLConverter : public NextConverter
{
#ifdef _WIN32
public:
static std::string header(const util::nstring& str)
{
return NextConverter::header(fixLineEndings(str));
}
static std::string convert(const util::nstring& str)
{
return NextConverter::convert(fixLineEndings(str));
}
private:
static util::nstring fixLineEndings(const util::nstring& str)
{
util::nstring output;
output.reserve(str.length() * 2); // the worst case requires 2x chars
for (size_t i = 0; i < str.size(); ++i)
{
util::nchar ch = str[i];
if (ch == PLOG_NSTR('\n'))
{
output.push_back(PLOG_NSTR('\r'));
}
output.push_back(ch);
}
return output;
}
#endif
};
}
-28
View File
@@ -1,28 +0,0 @@
#pragma once
#include <plog/Util.h>
namespace plog
{
class UTF8Converter
{
public:
static std::string header(const util::nstring& str)
{
const char kBOM[] = "\xEF\xBB\xBF";
return std::string(kBOM) + convert(str);
}
#if PLOG_CHAR_IS_UTF8
static const std::string& convert(const util::nstring& str)
{
return str;
}
#else
static std::string convert(const util::nstring& str)
{
return util::toNarrow(str, codePage::kUTF8);
}
#endif
};
}
-57
View File
@@ -1,57 +0,0 @@
#pragma once
#include <plog/Record.h>
#include <plog/Util.h>
#include <iomanip>
namespace plog
{
template<bool useUtcTime>
class CsvFormatterImpl
{
public:
static util::nstring header()
{
return PLOG_NSTR("Date;Time;Severity;TID;This;Function;Message\n");
}
static util::nstring format(const Record& record)
{
tm t;
useUtcTime ? util::gmtime_s(&t, &record.getTime().time) : util::localtime_s(&t, &record.getTime().time);
util::nostringstream ss;
ss << t.tm_year + 1900 << PLOG_NSTR("/") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_mon + 1 << PLOG_NSTR("/") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_mday << PLOG_NSTR(";");
ss << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_hour << PLOG_NSTR(":") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_min << PLOG_NSTR(":") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_sec << PLOG_NSTR(".") << std::setfill(PLOG_NSTR('0')) << std::setw(3) << static_cast<int> (record.getTime().millitm) << PLOG_NSTR(";");
ss << severityToString(record.getSeverity()) << PLOG_NSTR(";");
ss << record.getTid() << PLOG_NSTR(";");
ss << record.getObject() << PLOG_NSTR(";");
ss << record.getFunc() << PLOG_NSTR("@") << record.getLine() << PLOG_NSTR(";");
util::nstring message = record.getMessage();
if (message.size() > kMaxMessageSize)
{
message.resize(kMaxMessageSize);
message.append(PLOG_NSTR("..."));
}
util::nistringstream split(message);
util::nstring token;
while (!split.eof())
{
std::getline(split, token, PLOG_NSTR('"'));
ss << PLOG_NSTR("\"") << token << PLOG_NSTR("\"");
}
ss << PLOG_NSTR("\n");
return ss.str();
}
static const size_t kMaxMessageSize = 32000;
};
class CsvFormatter : public CsvFormatterImpl<false> {};
class CsvFormatterUtcTime : public CsvFormatterImpl<true> {};
}
@@ -1,23 +0,0 @@
#pragma once
#include <plog/Record.h>
#include <plog/Util.h>
namespace plog
{
class FuncMessageFormatter
{
public:
static util::nstring header()
{
return util::nstring();
}
static util::nstring format(const Record& record)
{
util::nostringstream ss;
ss << record.getFunc() << PLOG_NSTR("@") << record.getLine() << PLOG_NSTR(": ") << record.getMessage() << PLOG_NSTR("\n");
return ss.str();
}
};
}
@@ -1,23 +0,0 @@
#pragma once
#include <plog/Record.h>
#include <plog/Util.h>
namespace plog
{
class MessageOnlyFormatter
{
public:
static util::nstring header()
{
return util::nstring();
}
static util::nstring format(const Record& record)
{
util::nostringstream ss;
ss << record.getMessage() << PLOG_NSTR("\n");
return ss.str();
}
};
}
-36
View File
@@ -1,36 +0,0 @@
#pragma once
#include <plog/Record.h>
#include <plog/Util.h>
#include <iomanip>
namespace plog
{
template<bool useUtcTime>
class TxtFormatterImpl
{
public:
static util::nstring header()
{
return util::nstring();
}
static util::nstring format(const Record& record)
{
tm t;
useUtcTime ? util::gmtime_s(&t, &record.getTime().time) : util::localtime_s(&t, &record.getTime().time);
util::nostringstream ss;
ss << t.tm_year + 1900 << "-" << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_mon + 1 << PLOG_NSTR("-") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_mday << PLOG_NSTR(" ");
ss << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_hour << PLOG_NSTR(":") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_min << PLOG_NSTR(":") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_sec << PLOG_NSTR(".") << std::setfill(PLOG_NSTR('0')) << std::setw(3) << static_cast<int> (record.getTime().millitm) << PLOG_NSTR(" ");
ss << std::setfill(PLOG_NSTR(' ')) << std::setw(5) << std::left << severityToString(record.getSeverity()) << PLOG_NSTR(" ");
ss << PLOG_NSTR("[") << record.getTid() << PLOG_NSTR("] ");
ss << PLOG_NSTR("[") << record.getFunc() << PLOG_NSTR("@") << record.getLine() << PLOG_NSTR("] ");
ss << record.getMessage() << PLOG_NSTR("\n");
return ss.str();
}
};
class TxtFormatter : public TxtFormatterImpl<false> {};
class TxtFormatterUtcTime : public TxtFormatterImpl<true> {};
}
-40
View File
@@ -1,40 +0,0 @@
#pragma once
#include <plog/Util.h>
#include <cctype>
namespace plog
{
class AscDump
{
public:
AscDump(const void* ptr, size_t size)
: m_ptr(static_cast<const char*>(ptr))
, m_size(size)
{
}
friend util::nostringstream& operator<<(util::nostringstream& stream, const AscDump& ascDump);
private:
const char* m_ptr;
size_t m_size;
};
inline util::nostringstream& operator<<(util::nostringstream& stream, const AscDump& ascDump)
{
for (size_t i = 0; i < ascDump.m_size; ++i)
{
stream << (std::isprint(ascDump.m_ptr[i]) ? ascDump.m_ptr[i] : '.');
}
return stream;
}
inline AscDump ascdump(const void* ptr, size_t size) { return AscDump(ptr, size); }
template<class Container>
inline AscDump ascdump(const Container& container) { return AscDump(container.data(), container.size() * sizeof(*container.data())); }
template<class T, size_t N>
inline AscDump ascdump(const T (&arr)[N]) { return AscDump(arr, N * sizeof(*arr)); }
}
-79
View File
@@ -1,79 +0,0 @@
#pragma once
#include <plog/Util.h>
#include <iomanip>
namespace plog
{
class HexDump
{
public:
HexDump(const void* ptr, size_t size)
: m_ptr(static_cast<const unsigned char*>(ptr))
, m_size(size)
, m_group(8)
, m_digitSeparator(" ")
, m_groupSeparator(" ")
{
}
HexDump& group(size_t group)
{
m_group = group;
return *this;
}
HexDump& separator(const char* digitSeparator)
{
m_digitSeparator = digitSeparator;
return *this;
}
HexDump& separator(const char* digitSeparator, const char* groupSeparator)
{
m_digitSeparator = digitSeparator;
m_groupSeparator = groupSeparator;
return *this;
}
friend util::nostringstream& operator<<(util::nostringstream& stream, const HexDump&);
private:
const unsigned char* m_ptr;
size_t m_size;
size_t m_group;
const char* m_digitSeparator;
const char* m_groupSeparator;
};
inline util::nostringstream& operator<<(util::nostringstream& stream, const HexDump& hexDump)
{
stream << std::hex << std::setfill(PLOG_NSTR('0'));
for (size_t i = 0; i < hexDump.m_size;)
{
stream << std::setw(2) << static_cast<int>(hexDump.m_ptr[i]);
if (++i < hexDump.m_size)
{
if (hexDump.m_group > 0 && i % hexDump.m_group == 0)
{
stream << hexDump.m_groupSeparator;
}
else
{
stream << hexDump.m_digitSeparator;
}
}
}
return stream;
}
inline HexDump hexdump(const void* ptr, size_t size) { return HexDump(ptr, size); }
template<class Container>
inline HexDump hexdump(const Container& container) { return HexDump(container.data(), container.size() * sizeof(*container.data())); }
template<class T, size_t N>
inline HexDump hexdump(const T (&arr)[N]) { return HexDump(arr, N * sizeof(*arr)); }
}
-24
View File
@@ -1,24 +0,0 @@
#pragma once
#define PLOG_IMPL_PRINT_VAR_1(a1) #a1 ": " << a1
#define PLOG_IMPL_PRINT_VAR_2(a1, a2) PLOG_IMPL_PRINT_VAR_1(a1) PLOG_IMPL_PRINT_VAR_TAIL(a2)
#define PLOG_IMPL_PRINT_VAR_3(a1, a2, a3) PLOG_IMPL_PRINT_VAR_2(a1, a2) PLOG_IMPL_PRINT_VAR_TAIL(a3)
#define PLOG_IMPL_PRINT_VAR_4(a1, a2, a3, a4) PLOG_IMPL_PRINT_VAR_3(a1, a2, a3) PLOG_IMPL_PRINT_VAR_TAIL(a4)
#define PLOG_IMPL_PRINT_VAR_5(a1, a2, a3, a4, a5) PLOG_IMPL_PRINT_VAR_4(a1, a2, a3, a4) PLOG_IMPL_PRINT_VAR_TAIL(a5)
#define PLOG_IMPL_PRINT_VAR_6(a1, a2, a3, a4, a5, a6) PLOG_IMPL_PRINT_VAR_5(a1, a2, a3, a4, a5) PLOG_IMPL_PRINT_VAR_TAIL(a6)
#define PLOG_IMPL_PRINT_VAR_7(a1, a2, a3, a4, a5, a6, a7) PLOG_IMPL_PRINT_VAR_6(a1, a2, a3, a4, a5, a6) PLOG_IMPL_PRINT_VAR_TAIL(a7)
#define PLOG_IMPL_PRINT_VAR_8(a1, a2, a3, a4, a5, a6, a7, a8) PLOG_IMPL_PRINT_VAR_7(a1, a2, a3, a4, a5, a6, a7) PLOG_IMPL_PRINT_VAR_TAIL(a8)
#define PLOG_IMPL_PRINT_VAR_9(a1, a2, a3, a4, a5, a6, a7, a8, a9) PLOG_IMPL_PRINT_VAR_8(a1, a2, a3, a4, a5, a6, a7, a8) PLOG_IMPL_PRINT_VAR_TAIL(a9)
#define PLOG_IMPL_PRINT_VAR_TAIL(a) << ", " PLOG_IMPL_PRINT_VAR_1(a)
#define PLOG_IMPL_PRINT_VAR_EXPAND(x) x
#ifdef __GNUC__
#pragma GCC system_header // disable warning: variadic macros are a C99 feature
#endif
#define PLOG_IMPL_PRINT_VAR_GET_MACRO(x1, x2, x3, x4, x5, x6, x7, x8, x9, NAME, ...) NAME
#define PLOG_PRINT_VAR(...) PLOG_IMPL_PRINT_VAR_EXPAND(PLOG_IMPL_PRINT_VAR_GET_MACRO(__VA_ARGS__,\
PLOG_IMPL_PRINT_VAR_9, PLOG_IMPL_PRINT_VAR_8, PLOG_IMPL_PRINT_VAR_7, PLOG_IMPL_PRINT_VAR_6, PLOG_IMPL_PRINT_VAR_5,\
PLOG_IMPL_PRINT_VAR_4, PLOG_IMPL_PRINT_VAR_3, PLOG_IMPL_PRINT_VAR_2, PLOG_IMPL_PRINT_VAR_1, UNUSED)(__VA_ARGS__))
-17
View File
@@ -1,17 +0,0 @@
#pragma once
#include <plog/Logger.h>
namespace plog
{
template<int instanceId>
PLOG_LINKAGE_HIDDEN inline Logger<instanceId>& init(Severity maxSeverity = none, IAppender* appender = NULL)
{
static Logger<instanceId> logger(maxSeverity);
return appender ? logger.addAppender(appender) : logger;
}
inline Logger<PLOG_DEFAULT_INSTANCE_ID>& init(Severity maxSeverity = none, IAppender* appender = NULL)
{
return init<PLOG_DEFAULT_INSTANCE_ID>(maxSeverity, appender);
}
}
@@ -1,22 +0,0 @@
#pragma once
#include <plog/Appenders/ColorConsoleAppender.h>
#include <plog/Init.h>
namespace plog
{
//////////////////////////////////////////////////////////////////////////
// ColorConsoleAppender with any Formatter
template<class Formatter, int instanceId>
PLOG_LINKAGE_HIDDEN inline Logger<instanceId>& init(Severity maxSeverity, OutputStream outputStream)
{
static ColorConsoleAppender<Formatter> appender(outputStream);
return init<instanceId>(maxSeverity, &appender);
}
template<class Formatter>
inline Logger<PLOG_DEFAULT_INSTANCE_ID>& init(Severity maxSeverity, OutputStream outputStream)
{
return init<Formatter, PLOG_DEFAULT_INSTANCE_ID>(maxSeverity, outputStream);
}
}
@@ -1,80 +0,0 @@
#pragma once
#include <plog/Appenders/RollingFileAppender.h>
#include <plog/Formatters/TxtFormatter.h>
#include <plog/Formatters/CsvFormatter.h>
#include <plog/Init.h>
#include <cstring>
namespace plog
{
//////////////////////////////////////////////////////////////////////////
// RollingFileAppender with any Formatter
template<class Formatter, int instanceId>
PLOG_LINKAGE_HIDDEN inline Logger<instanceId>& init(Severity maxSeverity, const util::nchar* fileName, size_t maxFileSize = 0, int maxFiles = 0)
{
static RollingFileAppender<Formatter> rollingFileAppender(fileName, maxFileSize, maxFiles);
return init<instanceId>(maxSeverity, &rollingFileAppender);
}
template<class Formatter>
inline Logger<PLOG_DEFAULT_INSTANCE_ID>& init(Severity maxSeverity, const util::nchar* fileName, size_t maxFileSize = 0, int maxFiles = 0)
{
return init<Formatter, PLOG_DEFAULT_INSTANCE_ID>(maxSeverity, fileName, maxFileSize, maxFiles);
}
//////////////////////////////////////////////////////////////////////////
// RollingFileAppender with TXT/CSV chosen by file extension
namespace
{
inline bool isCsv(const util::nchar* fileName)
{
const util::nchar* dot = util::findExtensionDot(fileName);
#if PLOG_CHAR_IS_UTF8
return dot && 0 == std::strcmp(dot, ".csv");
#else
return dot && 0 == std::wcscmp(dot, L".csv");
#endif
}
}
template<int instanceId>
inline Logger<instanceId>& init(Severity maxSeverity, const util::nchar* fileName, size_t maxFileSize = 0, int maxFiles = 0)
{
return isCsv(fileName) ? init<CsvFormatter, instanceId>(maxSeverity, fileName, maxFileSize, maxFiles) : init<TxtFormatter, instanceId>(maxSeverity, fileName, maxFileSize, maxFiles);
}
inline Logger<PLOG_DEFAULT_INSTANCE_ID>& init(Severity maxSeverity, const util::nchar* fileName, size_t maxFileSize = 0, int maxFiles = 0)
{
return init<PLOG_DEFAULT_INSTANCE_ID>(maxSeverity, fileName, maxFileSize, maxFiles);
}
//////////////////////////////////////////////////////////////////////////
// CHAR variants for Windows
#if defined(_WIN32) && !PLOG_CHAR_IS_UTF8
template<class Formatter, int instanceId>
inline Logger<instanceId>& init(Severity maxSeverity, const char* fileName, size_t maxFileSize = 0, int maxFiles = 0)
{
return init<Formatter, instanceId>(maxSeverity, util::toWide(fileName).c_str(), maxFileSize, maxFiles);
}
template<class Formatter>
inline Logger<PLOG_DEFAULT_INSTANCE_ID>& init(Severity maxSeverity, const char* fileName, size_t maxFileSize = 0, int maxFiles = 0)
{
return init<Formatter, PLOG_DEFAULT_INSTANCE_ID>(maxSeverity, fileName, maxFileSize, maxFiles);
}
template<int instanceId>
inline Logger<instanceId>& init(Severity maxSeverity, const char* fileName, size_t maxFileSize = 0, int maxFiles = 0)
{
return init<instanceId>(maxSeverity, util::toWide(fileName).c_str(), maxFileSize, maxFiles);
}
inline Logger<PLOG_DEFAULT_INSTANCE_ID>& init(Severity maxSeverity, const char* fileName, size_t maxFileSize = 0, int maxFiles = 0)
{
return init<PLOG_DEFAULT_INSTANCE_ID>(maxSeverity, fileName, maxFileSize, maxFiles);
}
#endif
}
-209
View File
@@ -1,209 +0,0 @@
//////////////////////////////////////////////////////////////////////////
// Plog - portable and simple log for C++
// Documentation and sources: https://github.com/SergiusTheBest/plog
// License: MIT, https://choosealicense.com/licenses/mit
#pragma once
#include <plog/Logger.h>
//////////////////////////////////////////////////////////////////////////
// Helper macros that get context info
#if defined(PLOG_ENABLE_GET_THIS) && defined(_MSC_VER) && _MSC_VER >= 1600 && !defined(__INTELLISENSE__) && !defined(__INTEL_COMPILER) && !defined(__llvm__) && !defined(__RESHARPER__) // >= Visual Studio 2010, skip IntelliSense, Intel Compiler, Clang Code Model and ReSharper
# define PLOG_GET_THIS() __if_exists(this) { this } __if_not_exists(this) { 0 }
#else
# define PLOG_GET_THIS() reinterpret_cast<void*>(0)
#endif
#ifdef _MSC_VER
# define PLOG_GET_FUNC() __FUNCTION__
#elif defined(__BORLANDC__)
# define PLOG_GET_FUNC() __FUNC__
#else
# define PLOG_GET_FUNC() __PRETTY_FUNCTION__
#endif
#ifdef PLOG_CAPTURE_FILE
# define PLOG_GET_FILE() __FILE__
#else
# define PLOG_GET_FILE() ""
#endif
//////////////////////////////////////////////////////////////////////////
// Log severity level checker
#ifdef PLOG_DISABLE_LOGGING
# ifdef _MSC_VER
# define IF_PLOG_(instanceId, severity) __pragma(warning(push)) __pragma(warning(disable:4127)) if (true) {;} else __pragma(warning(pop)) // conditional expression is constant
# else
# define IF_PLOG_(instanceId, severity) if (true) {;} else
# endif
#else
# define IF_PLOG_(instanceId, severity) if (!plog::get<instanceId>() || !plog::get<instanceId>()->checkSeverity(severity)) {;} else
#endif
#define IF_PLOG(severity) IF_PLOG_(PLOG_DEFAULT_INSTANCE_ID, severity)
//////////////////////////////////////////////////////////////////////////
// Main logging macros
#ifdef PLOG_MESSAGE_PREFIX
# define PLOG_PRINT_MESSAGE_PREFIX() << PLOG_MESSAGE_PREFIX
#else
# define PLOG_PRINT_MESSAGE_PREFIX()
#endif
#define PLOG_(instanceId, severity) IF_PLOG_(instanceId, severity) (*plog::get<instanceId>()) += \
plog::Record(severity, PLOG_GET_FUNC(), __LINE__, PLOG_GET_FILE(), PLOG_GET_THIS(), instanceId).ref() PLOG_PRINT_MESSAGE_PREFIX()
#define PLOG(severity) PLOG_(PLOG_DEFAULT_INSTANCE_ID, severity)
#define PLOG_VERBOSE PLOG(plog::verbose)
#define PLOG_DEBUG PLOG(plog::debug)
#define PLOG_INFO PLOG(plog::info)
#define PLOG_WARNING PLOG(plog::warning)
#define PLOG_ERROR PLOG(plog::error)
#define PLOG_FATAL PLOG(plog::fatal)
#define PLOG_NONE PLOG(plog::none)
#define PLOG_VERBOSE_(instanceId) PLOG_(instanceId, plog::verbose)
#define PLOG_DEBUG_(instanceId) PLOG_(instanceId, plog::debug)
#define PLOG_INFO_(instanceId) PLOG_(instanceId, plog::info)
#define PLOG_WARNING_(instanceId) PLOG_(instanceId, plog::warning)
#define PLOG_ERROR_(instanceId) PLOG_(instanceId, plog::error)
#define PLOG_FATAL_(instanceId) PLOG_(instanceId, plog::fatal)
#define PLOG_NONE_(instanceId) PLOG_(instanceId, plog::none)
#define PLOGV PLOG_VERBOSE
#define PLOGD PLOG_DEBUG
#define PLOGI PLOG_INFO
#define PLOGW PLOG_WARNING
#define PLOGE PLOG_ERROR
#define PLOGF PLOG_FATAL
#define PLOGN PLOG_NONE
#define PLOGV_(instanceId) PLOG_VERBOSE_(instanceId)
#define PLOGD_(instanceId) PLOG_DEBUG_(instanceId)
#define PLOGI_(instanceId) PLOG_INFO_(instanceId)
#define PLOGW_(instanceId) PLOG_WARNING_(instanceId)
#define PLOGE_(instanceId) PLOG_ERROR_(instanceId)
#define PLOGF_(instanceId) PLOG_FATAL_(instanceId)
#define PLOGN_(instanceId) PLOG_NONE_(instanceId)
//////////////////////////////////////////////////////////////////////////
// Conditional logging macros
#define PLOG_IF_(instanceId, severity, condition) if (!(condition)) {;} else PLOG_(instanceId, severity)
#define PLOG_IF(severity, condition) PLOG_IF_(PLOG_DEFAULT_INSTANCE_ID, severity, condition)
#define PLOG_VERBOSE_IF(condition) PLOG_IF(plog::verbose, condition)
#define PLOG_DEBUG_IF(condition) PLOG_IF(plog::debug, condition)
#define PLOG_INFO_IF(condition) PLOG_IF(plog::info, condition)
#define PLOG_WARNING_IF(condition) PLOG_IF(plog::warning, condition)
#define PLOG_ERROR_IF(condition) PLOG_IF(plog::error, condition)
#define PLOG_FATAL_IF(condition) PLOG_IF(plog::fatal, condition)
#define PLOG_NONE_IF(condition) PLOG_IF(plog::none, condition)
#define PLOG_VERBOSE_IF_(instanceId, condition) PLOG_IF_(instanceId, plog::verbose, condition)
#define PLOG_DEBUG_IF_(instanceId, condition) PLOG_IF_(instanceId, plog::debug, condition)
#define PLOG_INFO_IF_(instanceId, condition) PLOG_IF_(instanceId, plog::info, condition)
#define PLOG_WARNING_IF_(instanceId, condition) PLOG_IF_(instanceId, plog::warning, condition)
#define PLOG_ERROR_IF_(instanceId, condition) PLOG_IF_(instanceId, plog::error, condition)
#define PLOG_FATAL_IF_(instanceId, condition) PLOG_IF_(instanceId, plog::fatal, condition)
#define PLOG_NONE_IF_(instanceId, condition) PLOG_IF_(instanceId, plog::none, condition)
#define PLOGV_IF(condition) PLOG_VERBOSE_IF(condition)
#define PLOGD_IF(condition) PLOG_DEBUG_IF(condition)
#define PLOGI_IF(condition) PLOG_INFO_IF(condition)
#define PLOGW_IF(condition) PLOG_WARNING_IF(condition)
#define PLOGE_IF(condition) PLOG_ERROR_IF(condition)
#define PLOGF_IF(condition) PLOG_FATAL_IF(condition)
#define PLOGN_IF(condition) PLOG_NONE_IF(condition)
#define PLOGV_IF_(instanceId, condition) PLOG_VERBOSE_IF_(instanceId, condition)
#define PLOGD_IF_(instanceId, condition) PLOG_DEBUG_IF_(instanceId, condition)
#define PLOGI_IF_(instanceId, condition) PLOG_INFO_IF_(instanceId, condition)
#define PLOGW_IF_(instanceId, condition) PLOG_WARNING_IF_(instanceId, condition)
#define PLOGE_IF_(instanceId, condition) PLOG_ERROR_IF_(instanceId, condition)
#define PLOGF_IF_(instanceId, condition) PLOG_FATAL_IF_(instanceId, condition)
#define PLOGN_IF_(instanceId, condition) PLOG_NONE_IF_(instanceId, condition)
// Old macro names for downward compatibility. To bypass including these macro names, add
// #define PLOG_OMIT_LOG_DEFINES before #include <plog/Log.h>
#ifndef PLOG_OMIT_LOG_DEFINES
//////////////////////////////////////////////////////////////////////////
// Main logging macros - can be changed later to point at macros for a different logging package
#define LOG_(instanceId, severity) PLOG_(instanceId, severity)
#define LOG(severity) PLOG(severity)
#define LOG_VERBOSE PLOG_VERBOSE
#define LOG_DEBUG PLOG_DEBUG
#define LOG_INFO PLOG_INFO
#define LOG_WARNING PLOG_WARNING
#define LOG_ERROR PLOG_ERROR
#define LOG_FATAL PLOG_FATAL
#define LOG_NONE PLOG_NONE
#define LOG_VERBOSE_(instanceId) PLOG_VERBOSE_(instanceId)
#define LOG_DEBUG_(instanceId) PLOG_DEBUG_(instanceId)
#define LOG_INFO_(instanceId) PLOG_INFO_(instanceId)
#define LOG_WARNING_(instanceId) PLOG_WARNING_(instanceId)
#define LOG_ERROR_(instanceId) PLOG_ERROR_(instanceId)
#define LOG_FATAL_(instanceId) PLOG_FATAL_(instanceId)
#define LOG_NONE_(instanceId) PLOG_NONE_(instanceId)
#define LOGV PLOGV
#define LOGD PLOGD
#define LOGI PLOGI
#define LOGW PLOGW
#define LOGE PLOGE
#define LOGF PLOGF
#define LOGN PLOGN
#define LOGV_(instanceId) PLOGV_(instanceId)
#define LOGD_(instanceId) PLOGD_(instanceId)
#define LOGI_(instanceId) PLOGI_(instanceId)
#define LOGW_(instanceId) PLOGW_(instanceId)
#define LOGE_(instanceId) PLOGE_(instanceId)
#define LOGF_(instanceId) PLOGF_(instanceId)
#define LOGN_(instanceId) PLOGN_(instanceId)
//////////////////////////////////////////////////////////////////////////
// Conditional logging macros
#define LOG_IF_(instanceId, severity, condition) PLOG_IF_(instanceId, severity, condition)
#define LOG_IF(severity, condition) PLOG_IF(severity, condition)
#define LOG_VERBOSE_IF(condition) PLOG_VERBOSE_IF(condition)
#define LOG_DEBUG_IF(condition) PLOG_DEBUG_IF(condition)
#define LOG_INFO_IF(condition) PLOG_INFO_IF(condition)
#define LOG_WARNING_IF(condition) PLOG_WARNING_IF(condition)
#define LOG_ERROR_IF(condition) PLOG_ERROR_IF(condition)
#define LOG_FATAL_IF(condition) PLOG_FATAL_IF(condition)
#define LOG_NONE_IF(condition) PLOG_NONE_IF(condition)
#define LOG_VERBOSE_IF_(instanceId, condition) PLOG_VERBOSE_IF_(instanceId, condition)
#define LOG_DEBUG_IF_(instanceId, condition) PLOG_DEBUG_IF_(instanceId, condition)
#define LOG_INFO_IF_(instanceId, condition) PLOG_INFO_IF_(instanceId, condition)
#define LOG_WARNING_IF_(instanceId, condition) PLOG_WARNING_IF_(instanceId, condition)
#define LOG_ERROR_IF_(instanceId, condition) PLOG_ERROR_IF_(instanceId, condition)
#define LOG_FATAL_IF_(instanceId, condition) PLOG_FATAL_IF_(instanceId, condition)
#define LOG_NONE_IF_(instanceId, condition) PLOG_NONE_IF_(instanceId, condition)
#define LOGV_IF(condition) PLOGV_IF(condition)
#define LOGD_IF(condition) PLOGD_IF(condition)
#define LOGI_IF(condition) PLOGI_IF(condition)
#define LOGW_IF(condition) PLOGW_IF(condition)
#define LOGE_IF(condition) PLOGE_IF(condition)
#define LOGF_IF(condition) PLOGF_IF(condition)
#define LOGN_IF(condition) PLOGN_IF(condition)
#define LOGV_IF_(instanceId, condition) PLOGV_IF_(instanceId, condition)
#define LOGD_IF_(instanceId, condition) PLOGD_IF_(instanceId, condition)
#define LOGI_IF_(instanceId, condition) PLOGI_IF_(instanceId, condition)
#define LOGW_IF_(instanceId, condition) PLOGW_IF_(instanceId, condition)
#define LOGE_IF_(instanceId, condition) PLOGE_IF_(instanceId, condition)
#define LOGF_IF_(instanceId, condition) PLOGF_IF_(instanceId, condition)
#define LOGN_IF_(instanceId, condition) PLOGN_IF_(instanceId, condition)
#endif
-84
View File
@@ -1,84 +0,0 @@
#pragma once
#include <plog/Appenders/IAppender.h>
#include <plog/Util.h>
#include <vector>
#ifdef PLOG_DEFAULT_INSTANCE // for backward compatibility
# define PLOG_DEFAULT_INSTANCE_ID PLOG_DEFAULT_INSTANCE
#endif
#ifndef PLOG_DEFAULT_INSTANCE_ID
# define PLOG_DEFAULT_INSTANCE_ID 0
#endif
namespace plog
{
template<int instanceId>
class PLOG_LINKAGE Logger : public util::Singleton<Logger<instanceId> >, public IAppender
{
public:
Logger(Severity maxSeverity = none) : m_maxSeverity(maxSeverity)
{
}
Logger& addAppender(IAppender* appender)
{
assert(appender != this);
m_appenders.push_back(appender);
return *this;
}
Severity getMaxSeverity() const
{
return m_maxSeverity;
}
void setMaxSeverity(Severity severity)
{
m_maxSeverity = severity;
}
bool checkSeverity(Severity severity) const
{
return severity <= m_maxSeverity;
}
virtual void write(const Record& record) PLOG_OVERRIDE
{
if (checkSeverity(record.getSeverity()))
{
*this += record;
}
}
void operator+=(const Record& record)
{
for (std::vector<IAppender*>::iterator it = m_appenders.begin(); it != m_appenders.end(); ++it)
{
(*it)->write(record);
}
}
private:
Severity m_maxSeverity;
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable:4251) // needs to have dll-interface to be used by clients of class
#endif
std::vector<IAppender*> m_appenders;
#ifdef _MSC_VER
# pragma warning(pop)
#endif
};
template<int instanceId>
inline Logger<instanceId>* get()
{
return Logger<instanceId>::getInstance();
}
inline Logger<PLOG_DEFAULT_INSTANCE_ID>* get()
{
return Logger<PLOG_DEFAULT_INSTANCE_ID>::getInstance();
}
}
-465
View File
@@ -1,465 +0,0 @@
#pragma once
#include <cstdarg>
#include <plog/Severity.h>
#include <plog/Util.h>
#ifdef __cplusplus_cli
#include <vcclr.h> // For PtrToStringChars
#endif
namespace plog
{
namespace detail
{
#if !defined(_MSC_VER) || _MSC_VER > 1400 // MSVC 2005 doesn't understand `enableIf`, so drop all `meta`
namespace meta
{
template<class T>
inline T& declval()
{
#ifdef __INTEL_COMPILER
# pragma warning(suppress: 327) // NULL reference is not allowed
#endif
return *reinterpret_cast<T*>(0);
}
template<bool B, class T = void>
struct enableIf {};
template<class T>
struct enableIf<true, T> { typedef T type; };
struct No { char a[1]; };
struct Yes { char a[2]; };
template <class From, class To>
struct isConvertible
{
// `+ sizeof(U*)` is required for GCC 4.5-4.7
template<class U>
static typename enableIf<!!(sizeof(static_cast<To>(meta::declval<U>())) + sizeof(U*)), Yes>::type test(int);
template<class U>
static No test(...);
enum { value = sizeof(test<From>(0)) == sizeof(Yes) };
};
template <class T>
struct isConvertibleToString : isConvertible<T, std::string> {};
#if PLOG_ENABLE_WCHAR_INPUT
template <class T>
struct isConvertibleToWString : isConvertible<T, std::wstring> {};
#endif
template <class T>
struct isContainer
{
template<class U>
static typename meta::enableIf<!!(sizeof(
#if defined(_MSC_VER) && _MSC_VER < 1700 // MSVC 2010 doesn't understand `typename T::const_iterator`
meta::declval<U>().begin()) + sizeof(meta::declval<U>().end()
#else
typename U::const_iterator
#endif
)), Yes>::type test(int);
template<class U>
static No test(...);
enum { value = sizeof(test<T>(0)) == sizeof(Yes) };
};
// Detects `std::filesystem::path` and `boost::filesystem::path`. They look like containers
// but we don't want to treat them as containers, so we use this detector to filter them out.
template <class T>
struct isFilesystemPath
{
template<class U>
static typename meta::enableIf<!!(sizeof(meta::declval<U>().preferred_separator)), Yes>::type test(int);
template<class U>
static No test(...);
enum { value = sizeof(test<T>(0)) == sizeof(Yes) };
};
}
#endif
//////////////////////////////////////////////////////////////////////////
// Stream output operators as free functions
#if PLOG_ENABLE_WCHAR_INPUT
inline void operator<<(util::nostringstream& stream, const wchar_t* data)
{
data = data ? data : L"(null)";
# ifdef _WIN32
# if PLOG_CHAR_IS_UTF8
std::operator<<(stream, util::toNarrow(data, codePage::kUTF8));
# else
std::operator<<(stream, data);
# endif
# else
std::operator<<(stream, util::toNarrow(data));
# endif
}
inline void operator<<(util::nostringstream& stream, wchar_t* data)
{
plog::detail::operator<<(stream, const_cast<const wchar_t*>(data));
}
inline void operator<<(util::nostringstream& stream, const std::wstring& data)
{
plog::detail::operator<<(stream, data.c_str());
}
#endif
inline void operator<<(util::nostringstream& stream, const char* data)
{
data = data ? data : "(null)";
#if defined(_WIN32) && defined(__BORLANDC__)
# if PLOG_CHAR_IS_UTF8
stream << data;
# else
stream << util::toWide(data);
# endif
#elif defined(_WIN32)
# if PLOG_CHAR_IS_UTF8
std::operator<<(stream, data);
# else
std::operator<<(stream, util::toWide(data));
# endif
#else
std::operator<<(stream, data);
#endif
}
inline void operator<<(util::nostringstream& stream, char* data)
{
plog::detail::operator<<(stream, const_cast<const char*>(data));
}
inline void operator<<(util::nostringstream& stream, const std::string& data)
{
plog::detail::operator<<(stream, data.c_str());
}
#ifdef __cpp_char8_t
inline void operator<<(util::nostringstream& stream, const char8_t* data)
{
# if PLOG_CHAR_IS_UTF8
plog::detail::operator<<(stream, reinterpret_cast<const char*>(data));
# else
plog::detail::operator<<(stream, util::toWide(reinterpret_cast<const char*>(data), codePage::kUTF8));
# endif
}
#endif //__cpp_char8_t
// Print `std::pair`
template<class T1, class T2>
inline void operator<<(util::nostringstream& stream, const std::pair<T1, T2>& data)
{
stream << data.first;
stream << ":";
stream << data.second;
}
#if defined(__clang__) || !defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 // skip for GCC < 4.5 due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38600
#if !defined(_MSC_VER) || _MSC_VER > 1400 // MSVC 2005 doesn't understand `enableIf`, so drop all `meta`
// Print data that can be casted to `std::string`
template<class T>
inline typename meta::enableIf<meta::isConvertibleToString<T>::value, void>::type operator<<(util::nostringstream& stream, const T& data)
{
plog::detail::operator<<(stream, static_cast<std::string>(data));
}
#if PLOG_ENABLE_WCHAR_INPUT
// Print data that can be casted to `std::wstring`
template<class T>
inline typename meta::enableIf<meta::isConvertibleToWString<T>::value, void>::type operator<<(util::nostringstream& stream, const T& data)
{
plog::detail::operator<<(stream, static_cast<std::wstring>(data));
}
#endif
// Print std containers
template<class T>
inline typename meta::enableIf<meta::isContainer<T>::value &&
!meta::isConvertibleToString<T>::value &&
#if PLOG_ENABLE_WCHAR_INPUT
!meta::isConvertibleToWString<T>::value &&
#endif
!meta::isFilesystemPath<T>::value, void>::type operator<<(util::nostringstream& stream, const T& data)
{
stream << "[";
for (typename T::const_iterator it = data.begin(); it != data.end();)
{
stream << *it;
if (++it == data.end())
{
break;
}
stream << ", ";
}
stream << "]";
}
#endif
#endif
#ifdef __cplusplus_cli
// Print managed C++ `System::String^`
inline void operator<<(util::nostringstream& stream, System::String^ data)
{
cli::pin_ptr<const System::Char> ptr = PtrToStringChars(data);
plog::detail::operator<<(stream, static_cast<const wchar_t*>(ptr));
}
#endif
#if PLOG_ENABLE_WCHAR_INPUT && (!defined(_MSC_VER) || _MSC_VER > 1400) // MSVC 2005 doesn't understand `enableIf`, so drop all `meta`
namespace meta
{
template<bool Value>
struct valueType { enum { value = Value }; };
template<class T, class Stream>
inline No operator<<(Stream&, const T&);
template<class T, class Stream>
struct isStreamable : valueType<sizeof(operator<<(meta::declval<Stream>(), meta::declval<const T>())) != sizeof(No)> {};
template<class Stream>
struct isStreamable<std::ios_base& PLOG_CDECL (std::ios_base&), Stream> : valueType<true> {};
template<class Stream, size_t N>
struct isStreamable<wchar_t[N], Stream> : valueType<false> {};
template<class Stream, size_t N>
struct isStreamable<const wchar_t[N], Stream> : valueType<false> {};
// meta doesn't work well for deleted functions and C++20 has `operator<<(std::ostream&, const wchar_t*) = delete` so explicitly define it
template<>
struct isStreamable<const wchar_t*, std::ostream> : valueType<false> {};
# ifdef __cpp_char8_t
// meta doesn't work well for deleted functions and C++20 has `operator<<(std::ostream&, const char8_t*) = delete` so explicitly define it
template<class Stream, size_t N>
struct isStreamable<char8_t[N], Stream> : valueType<false> {};
template<class Stream>
struct isStreamable<const char8_t*, Stream> : valueType<false> {};
# endif //__cpp_char8_t
}
# if PLOG_CHAR_IS_UTF8
// Print types that can be streamed into `std::owstringstream` but not into `std::ostringstream` when we use UTF-8 on Windows
template<class T>
inline typename meta::enableIf<meta::isStreamable<T, std::wostream>::value &&
!meta::isStreamable<T, std::ostream>::value &&
!meta::isConvertibleToWString<T>::value, void>::type operator<<(std::ostringstream& stream, const T& data)
{
std::wostringstream ss;
ss << data;
stream << ss.str();
}
# else
// Print types that can be streamed into `std::ostringstream` but not into `std::owstringstream` when we use `wchar_t` on Windows
template<class T>
inline typename meta::enableIf<meta::isStreamable<T, std::ostream>::value &&
!meta::isStreamable<T, std::wostream>::value &&
!meta::isConvertibleToString<T>::value, void>::type operator<<(std::wostringstream& stream, const T& data)
{
std::ostringstream ss;
ss << data;
stream << ss.str();
}
# endif
#endif
}
class Record
{
public:
Record(Severity severity, const char* func, size_t line, const char* file, const void* object, int instanceId)
: m_severity(severity), m_tid(util::gettid()), m_object(object), m_line(line), m_func(func), m_file(file), m_instanceId(instanceId)
{
util::ftime(&m_time);
}
Record& ref()
{
return *this;
}
//////////////////////////////////////////////////////////////////////////
// Stream output operators
Record& operator<<(char data)
{
char str[] = { data, 0 };
return *this << str;
}
#if PLOG_ENABLE_WCHAR_INPUT
Record& operator<<(wchar_t data)
{
wchar_t str[] = { data, 0 };
return *this << str;
}
#endif
Record& operator<<(util::nostream& (PLOG_CDECL *data)(util::nostream&))
{
m_message << data;
return *this;
}
#ifdef QT_VERSION
Record& operator<<(const QString& data)
{
# if PLOG_CHAR_IS_UTF8
return *this << data.toStdString();
# else
return *this << data.toStdWString();
# endif
}
# if QT_VERSION < 0x060000
Record& operator<<(const QStringRef& data)
{
return *this << data.toString();
}
# endif
# ifdef QSTRINGVIEW_H
Record& operator<<(QStringView data)
{
return *this << data.toString();
}
# endif
#endif
template<typename T>
Record& operator<<(const T& data)
{
using namespace plog::detail;
m_message << data;
return *this;
}
#ifndef __cplusplus_cli
Record& printf(const char* format, ...)
{
using namespace util;
char* str = NULL;
va_list ap;
va_start(ap, format);
int len = vasprintf(&str, format, ap);
static_cast<void>(len);
va_end(ap);
*this << str;
free(str);
return *this;
}
#ifdef _WIN32
Record& printf(const wchar_t* format, ...)
{
using namespace util;
wchar_t* str = NULL;
va_list ap;
va_start(ap, format);
int len = vaswprintf(&str, format, ap);
static_cast<void>(len);
va_end(ap);
*this << str;
free(str);
return *this;
}
#endif
#endif //__cplusplus_cli
//////////////////////////////////////////////////////////////////////////
// Getters
virtual const util::Time& getTime() const
{
return m_time;
}
virtual Severity getSeverity() const
{
return m_severity;
}
virtual unsigned int getTid() const
{
return m_tid;
}
virtual const void* getObject() const
{
return m_object;
}
virtual size_t getLine() const
{
return m_line;
}
virtual const util::nchar* getMessage() const
{
m_messageStr = m_message.str();
return m_messageStr.c_str();
}
virtual const char* getFunc() const
{
m_funcStr = util::processFuncName(m_func);
return m_funcStr.c_str();
}
virtual const char* getFile() const
{
return m_file;
}
virtual ~Record() // virtual destructor to satisfy -Wnon-virtual-dtor warning
{
}
virtual int getInstanceId() const
{
return m_instanceId;
}
private:
util::Time m_time;
const Severity m_severity;
const unsigned int m_tid;
const void* const m_object;
const size_t m_line;
util::nostringstream m_message;
const char* const m_func;
const char* const m_file;
const int m_instanceId;
mutable std::string m_funcStr;
mutable util::nstring m_messageStr;
};
}
-61
View File
@@ -1,61 +0,0 @@
#pragma once
#include <cctype>
namespace plog
{
enum Severity
{
none = 0,
fatal = 1,
error = 2,
warning = 3,
info = 4,
debug = 5,
verbose = 6
};
#ifdef _MSC_VER
# pragma warning(suppress: 26812) // Prefer 'enum class' over 'enum'
#endif
inline const char* severityToString(Severity severity)
{
switch (severity)
{
case fatal:
return "FATAL";
case error:
return "ERROR";
case warning:
return "WARN";
case info:
return "INFO";
case debug:
return "DEBUG";
case verbose:
return "VERB";
default:
return "NONE";
}
}
inline Severity severityFromString(const char* str)
{
switch (std::toupper(str[0]))
{
case 'F':
return fatal;
case 'E':
return error;
case 'W':
return warning;
case 'I':
return info;
case 'D':
return debug;
case 'V':
return verbose;
default:
return none;
}
}
}
-635
View File
@@ -1,635 +0,0 @@
#pragma once
#include <cassert>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <fcntl.h>
#include <sys/stat.h>
#ifndef PLOG_ENABLE_WCHAR_INPUT
# ifdef _WIN32
# define PLOG_ENABLE_WCHAR_INPUT 1
# else
# define PLOG_ENABLE_WCHAR_INPUT 0
# endif
#endif
//////////////////////////////////////////////////////////////////////////
// PLOG_CHAR_IS_UTF8 specifies character encoding of `char` type. On *nix
// systems it's set to UTF-8 while on Windows in can be ANSI or UTF-8. It
// automatically detects `/utf-8` command line option in MSVC. Also it can
// be set manually if required.
// This option allows to support http://utf8everywhere.org approach.
#ifndef PLOG_CHAR_IS_UTF8
# if defined(_WIN32) && !defined(_UTF8)
# define PLOG_CHAR_IS_UTF8 0
# else
# define PLOG_CHAR_IS_UTF8 1
# endif
#endif
#ifdef _WIN32
# if defined(PLOG_EXPORT)
# define PLOG_LINKAGE __declspec(dllexport)
# elif defined(PLOG_IMPORT)
# define PLOG_LINKAGE __declspec(dllimport)
# endif
# if defined(PLOG_GLOBAL)
# error "PLOG_GLOBAL isn't supported on Windows"
# endif
#else
# if defined(PLOG_GLOBAL)
# define PLOG_LINKAGE __attribute__ ((visibility ("default")))
# elif defined(PLOG_LOCAL)
# define PLOG_LINKAGE __attribute__ ((visibility ("hidden")))
# define PLOG_LINKAGE_HIDDEN PLOG_LINKAGE
# endif
# if defined(PLOG_EXPORT) || defined(PLOG_IMPORT)
# error "PLOG_EXPORT/PLOG_IMPORT is supported only on Windows"
# endif
#endif
#ifndef PLOG_LINKAGE
# define PLOG_LINKAGE
#endif
#ifndef PLOG_LINKAGE_HIDDEN
# define PLOG_LINKAGE_HIDDEN
#endif
#ifdef _WIN32
# include <plog/WinApi.h>
# include <time.h>
# include <sys/timeb.h>
# include <io.h>
# include <share.h>
#else
# include <unistd.h>
# include <sys/time.h>
# if defined(__linux__) || defined(__FreeBSD__)
# include <sys/syscall.h>
# elif defined(__rtems__)
# include <rtems.h>
# endif
# if defined(_POSIX_THREADS)
# include <pthread.h>
# endif
# if PLOG_ENABLE_WCHAR_INPUT
# include <iconv.h>
# endif
#endif
#ifdef __FREERTOS__ // There is no standard way to know if the code is compiled for FreeRTOS. We expect __FREERTOS__ macro to be defined in such case.
# include <FreeRTOS.h>
# include <semphr.h>
# include <task.h>
#endif
#if PLOG_CHAR_IS_UTF8
# define PLOG_NSTR(x) x
#else
# define _PLOG_NSTR(x) L##x
# define PLOG_NSTR(x) _PLOG_NSTR(x)
#endif
#ifdef _WIN32
# define PLOG_CDECL __cdecl
#else
# define PLOG_CDECL
#endif
#if __cplusplus >= 201103L || defined(_MSC_VER) && _MSC_VER >= 1700
# define PLOG_OVERRIDE override
#else
# define PLOG_OVERRIDE
#endif
namespace plog
{
namespace util
{
#if PLOG_CHAR_IS_UTF8
typedef std::string nstring;
typedef std::ostringstream nostringstream;
typedef std::istringstream nistringstream;
typedef std::ostream nostream;
typedef char nchar;
#else
typedef std::wstring nstring;
typedef std::wostringstream nostringstream;
typedef std::wistringstream nistringstream;
typedef std::wostream nostream;
typedef wchar_t nchar;
#endif
inline void localtime_s(struct tm* t, const time_t* time)
{
#if defined(_WIN32) && defined(__BORLANDC__)
::localtime_s(time, t);
#elif defined(_WIN32) && defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
*t = *::localtime(time);
#elif defined(_WIN32)
::localtime_s(t, time);
#else
::localtime_r(time, t);
#endif
}
inline void gmtime_s(struct tm* t, const time_t* time)
{
#if defined(_WIN32) && defined(__BORLANDC__)
::gmtime_s(time, t);
#elif defined(_WIN32) && defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
*t = *::gmtime(time);
#elif defined(_WIN32)
::gmtime_s(t, time);
#else
::gmtime_r(time, t);
#endif
}
#ifdef _WIN32
typedef timeb Time;
inline void ftime(Time* t)
{
::ftime(t);
}
#else
struct Time
{
time_t time;
unsigned short millitm;
};
inline void ftime(Time* t)
{
timeval tv;
::gettimeofday(&tv, NULL);
t->time = tv.tv_sec;
t->millitm = static_cast<unsigned short>(tv.tv_usec / 1000);
}
#endif
inline unsigned int gettid()
{
#if defined(__FREERTOS__) && defined(INCLUDE_xTaskGetCurrentTaskHandle)
return static_cast<unsigned int>(reinterpret_cast<uintptr_t>(xTaskGetCurrentTaskHandle()));
#elif defined(_WIN32)
return GetCurrentThreadId();
#elif defined(__linux__)
return static_cast<unsigned int>(::syscall(__NR_gettid));
#elif defined(__FreeBSD__)
long tid;
syscall(SYS_thr_self, &tid);
return static_cast<unsigned int>(tid);
#elif defined(__rtems__)
return rtems_task_self();
#elif defined(__APPLE__)
uint64_t tid64;
pthread_threadid_np(NULL, &tid64);
return static_cast<unsigned int>(tid64);
#else
return 0;
#endif
}
#ifndef _GNU_SOURCE
inline int vasprintf(char** strp, const char* format, va_list ap)
{
va_list ap_copy;
#if defined(_MSC_VER) && _MSC_VER <= 1600
ap_copy = ap; // there is no va_copy on Visual Studio 2010
#else
va_copy(ap_copy, ap);
#endif
#ifndef __STDC_SECURE_LIB__
int charCount = vsnprintf(NULL, 0, format, ap_copy);
#else
int charCount = _vscprintf(format, ap_copy);
#endif
va_end(ap_copy);
if (charCount < 0)
{
return -1;
}
size_t bufferCharCount = static_cast<size_t>(charCount) + 1;
char* str = static_cast<char*>(malloc(bufferCharCount));
if (!str)
{
return -1;
}
#ifndef __STDC_SECURE_LIB__
int retval = vsnprintf(str, bufferCharCount, format, ap);
#else
int retval = vsnprintf_s(str, bufferCharCount, static_cast<size_t>(-1), format, ap);
#endif
if (retval < 0)
{
free(str);
return -1;
}
*strp = str;
return retval;
}
#endif
#ifdef _WIN32
inline int vaswprintf(wchar_t** strp, const wchar_t* format, va_list ap)
{
#if defined(__BORLANDC__)
int charCount = 0x1000; // there is no _vscwprintf on Borland/Embarcadero
#else
int charCount = _vscwprintf(format, ap);
if (charCount < 0)
{
return -1;
}
#endif
size_t bufferCharCount = static_cast<size_t>(charCount) + 1;
wchar_t* str = static_cast<wchar_t*>(malloc(bufferCharCount * sizeof(wchar_t)));
if (!str)
{
return -1;
}
#if defined(__BORLANDC__)
int retval = vsnwprintf_s(str, bufferCharCount, format, ap);
#elif defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
int retval = _vsnwprintf(str, bufferCharCount, format, ap);
#else
int retval = _vsnwprintf_s(str, bufferCharCount, charCount, format, ap);
#endif
if (retval < 0)
{
free(str);
return -1;
}
*strp = str;
return retval;
}
#endif
#ifdef _WIN32
inline std::wstring toWide(const char* str, UINT cp = codePage::kChar)
{
size_t len = ::strlen(str);
std::wstring wstr(len, 0);
if (!wstr.empty())
{
int wlen = MultiByteToWideChar(cp, 0, str, static_cast<int>(len), &wstr[0], static_cast<int>(wstr.size()));
wstr.resize(wlen);
}
return wstr;
}
inline std::wstring toWide(const std::string& str, UINT cp = codePage::kChar)
{
return toWide(str.c_str(), cp);
}
inline const std::wstring& toWide(const std::wstring& str) // do nothing for already wide string
{
return str;
}
inline std::string toNarrow(const std::wstring& wstr, long page)
{
int len = WideCharToMultiByte(page, 0, wstr.c_str(), static_cast<int>(wstr.size()), 0, 0, 0, 0);
std::string str(len, 0);
if (!str.empty())
{
WideCharToMultiByte(page, 0, wstr.c_str(), static_cast<int>(wstr.size()), &str[0], len, 0, 0);
}
return str;
}
#elif PLOG_ENABLE_WCHAR_INPUT
inline std::string toNarrow(const wchar_t* wstr)
{
size_t wlen = ::wcslen(wstr);
std::string str(wlen * sizeof(wchar_t), 0);
if (!str.empty())
{
const char* in = reinterpret_cast<const char*>(&wstr[0]);
char* out = &str[0];
size_t inBytes = wlen * sizeof(wchar_t);
size_t outBytes = str.size();
iconv_t cd = ::iconv_open("UTF-8", "WCHAR_T");
::iconv(cd, const_cast<char**>(&in), &inBytes, &out, &outBytes);
::iconv_close(cd);
str.resize(str.size() - outBytes);
}
return str;
}
#endif
inline std::string processFuncName(const char* func)
{
#if (defined(_WIN32) && !defined(__MINGW32__)) || defined(__OBJC__)
return std::string(func);
#else
const char* funcBegin = func;
const char* funcEnd = ::strchr(funcBegin, '(');
int foundTemplate = 0;
if (!funcEnd)
{
return std::string(func);
}
for (const char* i = funcEnd - 1; i >= funcBegin; --i) // search backwards for the first space char
{
if (*i == '>')
{
foundTemplate++;
}
else if (*i == '<')
{
foundTemplate--;
}
else if (*i == ' ' && foundTemplate == 0)
{
funcBegin = i + 1;
break;
}
}
return std::string(funcBegin, funcEnd);
#endif
}
inline const nchar* findExtensionDot(const nchar* fileName)
{
#if PLOG_CHAR_IS_UTF8
return std::strrchr(fileName, '.');
#else
return std::wcsrchr(fileName, L'.');
#endif
}
inline void splitFileName(const nchar* fileName, nstring& fileNameNoExt, nstring& fileExt)
{
const nchar* dot = findExtensionDot(fileName);
if (dot)
{
fileNameNoExt.assign(fileName, dot);
fileExt.assign(dot + 1);
}
else
{
fileNameNoExt.assign(fileName);
fileExt.clear();
}
}
class PLOG_LINKAGE NonCopyable
{
protected:
NonCopyable()
{
}
private:
NonCopyable(const NonCopyable&);
NonCopyable& operator=(const NonCopyable&);
};
class PLOG_LINKAGE_HIDDEN File : NonCopyable
{
public:
File() : m_file(-1)
{
}
~File()
{
close();
}
size_t open(const nstring& fileName)
{
#if defined(_WIN32) && (defined(__BORLANDC__) || defined(__MINGW32__))
m_file = ::_wsopen(toWide(fileName).c_str(), _O_CREAT | _O_WRONLY | _O_BINARY | _O_NOINHERIT, SH_DENYWR, _S_IREAD | _S_IWRITE);
#elif defined(_WIN32)
::_wsopen_s(&m_file, toWide(fileName).c_str(), _O_CREAT | _O_WRONLY | _O_BINARY | _O_NOINHERIT, _SH_DENYWR, _S_IREAD | _S_IWRITE);
#elif defined(O_CLOEXEC)
m_file = ::open(fileName.c_str(), O_CREAT | O_APPEND | O_WRONLY | O_CLOEXEC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
#else
m_file = ::open(fileName.c_str(), O_CREAT | O_APPEND | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
#endif
return seek(0, SEEK_END);
}
size_t write(const void* buf, size_t count)
{
return m_file != -1 ? static_cast<size_t>(
#ifdef _WIN32
::_write(m_file, buf, static_cast<unsigned int>(count))
#else
::write(m_file, buf, count)
#endif
) : static_cast<size_t>(-1);
}
template<class CharType>
size_t write(const std::basic_string<CharType>& str)
{
return write(str.data(), str.size() * sizeof(CharType));
}
size_t seek(size_t offset, int whence)
{
return m_file != -1 ? static_cast<size_t>(
#if defined(_WIN32) && (defined(__BORLANDC__) || defined(__MINGW32__))
::_lseek(m_file, static_cast<off_t>(offset), whence)
#elif defined(_WIN32)
::_lseeki64(m_file, static_cast<off_t>(offset), whence)
#else
::lseek(m_file, static_cast<off_t>(offset), whence)
#endif
) : static_cast<size_t>(-1);
}
void close()
{
if (m_file != -1)
{
#ifdef _WIN32
::_close(m_file);
#else
::close(m_file);
#endif
m_file = -1;
}
}
static int unlink(const nstring& fileName)
{
#ifdef _WIN32
return ::_wunlink(toWide(fileName).c_str());
#else
return ::unlink(fileName.c_str());
#endif
}
static int rename(const nstring& oldFilename, const nstring& newFilename)
{
#ifdef _WIN32
return MoveFileW(toWide(oldFilename).c_str(), toWide(newFilename).c_str());
#else
return ::rename(oldFilename.c_str(), newFilename.c_str());
#endif
}
private:
int m_file;
};
class PLOG_LINKAGE_HIDDEN Mutex : NonCopyable
{
public:
Mutex()
{
#ifdef __FREERTOS__
m_sync = xSemaphoreCreateBinary();
xSemaphoreGive(m_sync);
#elif defined(_WIN32)
InitializeCriticalSection(&m_sync);
#elif defined(__rtems__)
rtems_semaphore_create(0, 1,
RTEMS_PRIORITY |
RTEMS_BINARY_SEMAPHORE |
RTEMS_INHERIT_PRIORITY, 1, &m_sync);
#elif defined(_POSIX_THREADS)
::pthread_mutex_init(&m_sync, 0);
#endif
}
~Mutex()
{
#ifdef __FREERTOS__
vSemaphoreDelete(m_sync);
#elif defined(_WIN32)
DeleteCriticalSection(&m_sync);
#elif defined(__rtems__)
rtems_semaphore_delete(m_sync);
#elif defined(_POSIX_THREADS)
::pthread_mutex_destroy(&m_sync);
#endif
}
friend class MutexLock;
private:
void lock()
{
#ifdef __FREERTOS__
xSemaphoreTake(m_sync, portMAX_DELAY);
#elif defined(_WIN32)
EnterCriticalSection(&m_sync);
#elif defined(__rtems__)
rtems_semaphore_obtain(m_sync, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
#elif defined(_POSIX_THREADS)
::pthread_mutex_lock(&m_sync);
#endif
}
void unlock()
{
#ifdef __FREERTOS__
xSemaphoreGive(m_sync);
#elif defined(_WIN32)
LeaveCriticalSection(&m_sync);
#elif defined(__rtems__)
rtems_semaphore_release(m_sync);
#elif defined(_POSIX_THREADS)
::pthread_mutex_unlock(&m_sync);
#endif
}
private:
#ifdef __FREERTOS__
SemaphoreHandle_t m_sync;
#elif defined(_WIN32)
CRITICAL_SECTION m_sync;
#elif defined(__rtems__)
rtems_id m_sync;
#elif defined(_POSIX_THREADS)
pthread_mutex_t m_sync;
#endif
};
class PLOG_LINKAGE_HIDDEN MutexLock : NonCopyable
{
public:
MutexLock(Mutex& mutex) : m_mutex(mutex)
{
m_mutex.lock();
}
~MutexLock()
{
m_mutex.unlock();
}
private:
Mutex& m_mutex;
};
template<class T>
#ifdef _WIN32
class Singleton : NonCopyable
#else
class PLOG_LINKAGE Singleton : NonCopyable
#endif
{
public:
#if (defined(__clang__) || defined(__GNUC__) && __GNUC__ >= 8) && !defined(__BORLANDC__)
// This constructor is called before the `T` object is fully constructed, and
// pointers are not dereferenced anyway, so UBSan shouldn't check vptrs.
__attribute__((no_sanitize("vptr")))
#endif
Singleton()
{
assert(!m_instance);
m_instance = static_cast<T*>(this);
}
~Singleton()
{
assert(m_instance);
m_instance = 0;
}
static T* getInstance()
{
return m_instance;
}
private:
static T* m_instance;
};
template<class T>
T* Singleton<T>::m_instance = NULL;
}
}
-175
View File
@@ -1,175 +0,0 @@
#pragma once
#ifdef _WIN32
// These windows structs must be in a global namespace
struct HKEY__;
struct _SECURITY_ATTRIBUTES;
struct _CONSOLE_SCREEN_BUFFER_INFO;
struct _RTL_CRITICAL_SECTION;
namespace plog
{
typedef unsigned long DWORD;
typedef unsigned short WORD;
typedef unsigned char BYTE;
typedef unsigned int UINT;
typedef int BOOL;
typedef long LSTATUS;
typedef char* LPSTR;
typedef wchar_t* LPWSTR;
typedef const char* LPCSTR;
typedef const wchar_t* LPCWSTR;
typedef void* HANDLE;
typedef HKEY__* HKEY;
typedef size_t ULONG_PTR;
struct CRITICAL_SECTION
{
void* DebugInfo;
long LockCount;
long RecursionCount;
HANDLE OwningThread;
HANDLE LockSemaphore;
ULONG_PTR SpinCount;
};
struct COORD
{
short X;
short Y;
};
struct SMALL_RECT
{
short Left;
short Top;
short Right;
short Bottom;
};
struct CONSOLE_SCREEN_BUFFER_INFO
{
COORD dwSize;
COORD dwCursorPosition;
WORD wAttributes;
SMALL_RECT srWindow;
COORD dwMaximumWindowSize;
};
namespace codePage
{
const UINT kActive = 0;
const UINT kUTF8 = 65001;
#if PLOG_CHAR_IS_UTF8
const UINT kChar = kUTF8;
#else
const UINT kChar = kActive;
#endif
}
namespace eventLog
{
const WORD kErrorType = 0x0001;
const WORD kWarningType = 0x0002;
const WORD kInformationType = 0x0004;
}
namespace hkey
{
const HKEY kLocalMachine = reinterpret_cast<HKEY>(static_cast<ULONG_PTR>(0x80000002));
}
namespace regSam
{
const DWORD kQueryValue = 0x0001;
const DWORD kSetValue = 0x0002;
}
namespace regType
{
const DWORD kExpandSz = 2;
const DWORD kDword = 4;
}
namespace stdHandle
{
const DWORD kOutput = static_cast<DWORD>(-11);
const DWORD kErrorOutput = static_cast<DWORD>(-12);
}
namespace foreground
{
const WORD kBlue = 0x0001;
const WORD kGreen = 0x0002;
const WORD kRed = 0x0004;
const WORD kIntensity = 0x0008;
}
namespace background
{
const WORD kBlue = 0x0010;
const WORD kGreen = 0x0020;
const WORD kRed = 0x0040;
const WORD kIntensity = 0x0080;
}
extern "C"
{
__declspec(dllimport) int __stdcall MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, LPWSTR lpWideCharStr, int cchWideChar);
__declspec(dllimport) int __stdcall WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, const char* lpDefaultChar, BOOL* lpUsedDefaultChar);
__declspec(dllimport) DWORD __stdcall GetCurrentThreadId();
__declspec(dllimport) BOOL __stdcall MoveFileW(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName);
__declspec(dllimport) void __stdcall InitializeCriticalSection(_RTL_CRITICAL_SECTION* lpCriticalSection);
__declspec(dllimport) void __stdcall EnterCriticalSection(_RTL_CRITICAL_SECTION* lpCriticalSection);
__declspec(dllimport) void __stdcall LeaveCriticalSection(_RTL_CRITICAL_SECTION* lpCriticalSection);
__declspec(dllimport) void __stdcall DeleteCriticalSection(_RTL_CRITICAL_SECTION* lpCriticalSection);
__declspec(dllimport) HANDLE __stdcall RegisterEventSourceW(LPCWSTR lpUNCServerName, LPCWSTR lpSourceName);
__declspec(dllimport) BOOL __stdcall DeregisterEventSource(HANDLE hEventLog);
__declspec(dllimport) BOOL __stdcall ReportEventW(HANDLE hEventLog, WORD wType, WORD wCategory, DWORD dwEventID, void* lpUserSid, WORD wNumStrings, DWORD dwDataSize, LPCWSTR* lpStrings, void* lpRawData);
__declspec(dllimport) LSTATUS __stdcall RegCreateKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD Reserved, LPWSTR lpClass, DWORD dwOptions, DWORD samDesired, _SECURITY_ATTRIBUTES* lpSecurityAttributes, HKEY* phkResult, DWORD* lpdwDisposition);
__declspec(dllimport) LSTATUS __stdcall RegSetValueExW(HKEY hKey, LPCWSTR lpValueName, DWORD Reserved, DWORD dwType, const BYTE* lpData, DWORD cbData);
__declspec(dllimport) LSTATUS __stdcall RegCloseKey(HKEY hKey);
__declspec(dllimport) LSTATUS __stdcall RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, DWORD samDesired, HKEY* phkResult);
__declspec(dllimport) LSTATUS __stdcall RegDeleteKeyW(HKEY hKey, LPCWSTR lpSubKey);
__declspec(dllimport) HANDLE __stdcall GetStdHandle(DWORD nStdHandle);
__declspec(dllimport) BOOL __stdcall WriteConsoleW(HANDLE hConsoleOutput, const void* lpBuffer, DWORD nNumberOfCharsToWrite, DWORD* lpNumberOfCharsWritten, void* lpReserved);
__declspec(dllimport) BOOL __stdcall GetConsoleScreenBufferInfo(HANDLE hConsoleOutput, _CONSOLE_SCREEN_BUFFER_INFO* lpConsoleScreenBufferInfo);
__declspec(dllimport) BOOL __stdcall SetConsoleTextAttribute(HANDLE hConsoleOutput, WORD wAttributes);
__declspec(dllimport) void __stdcall OutputDebugStringW(LPCWSTR lpOutputString);
}
inline void InitializeCriticalSection(CRITICAL_SECTION* criticalSection)
{
plog::InitializeCriticalSection(reinterpret_cast<_RTL_CRITICAL_SECTION*>(criticalSection));
}
inline void EnterCriticalSection(CRITICAL_SECTION* criticalSection)
{
plog::EnterCriticalSection(reinterpret_cast<_RTL_CRITICAL_SECTION*>(criticalSection));
}
inline void LeaveCriticalSection(CRITICAL_SECTION* criticalSection)
{
plog::LeaveCriticalSection(reinterpret_cast<_RTL_CRITICAL_SECTION*>(criticalSection));
}
inline void DeleteCriticalSection(CRITICAL_SECTION* criticalSection)
{
plog::DeleteCriticalSection(reinterpret_cast<_RTL_CRITICAL_SECTION*>(criticalSection));
}
inline BOOL GetConsoleScreenBufferInfo(HANDLE consoleOutput, CONSOLE_SCREEN_BUFFER_INFO* consoleScreenBufferInfo)
{
return plog::GetConsoleScreenBufferInfo(consoleOutput, reinterpret_cast<_CONSOLE_SCREEN_BUFFER_INFO*>(consoleScreenBufferInfo));
}
}
#endif // _WIN32
Loaded 100 of 338 files, more files were not shown because too many files have changed in this diff. Show more