mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 21:15:56 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80f926fde6 | ||
|
|
9351556cda | ||
|
|
19b1bfb88a | ||
|
|
3cd28c9bcb | ||
|
|
124c656400 | ||
|
|
e6da1d6fff | ||
|
|
08fe3a8815 | ||
|
|
9aebf29bb5 | ||
|
|
13145f77c9 | ||
|
|
5b0a26d49e | ||
|
|
4c3798735b | ||
|
|
5cf0d6ebd8 | ||
|
|
fd6fe0abdb | ||
|
|
5170d50517 | ||
|
|
af22f80b23 | ||
|
|
56a1c32f49 | ||
|
|
f38a28e8b3 | ||
|
|
eb7fd31817 | ||
|
|
92ad21003f | ||
|
|
11cf47c4c2 | ||
|
|
3626abb35a | ||
|
|
382bfb7fed | ||
|
|
560215c0ae | ||
|
|
55303b7dc9 | ||
|
|
41049f1852 | ||
|
|
396ec1a96f | ||
|
|
10ec330480 | ||
|
|
0ddcfcd7c8 | ||
|
|
87a91376c5 | ||
|
|
dbae5e5258 | ||
|
|
ff216aabee | ||
|
|
18a923373b | ||
|
|
6fe467bccf | ||
|
|
4bed99f417 | ||
|
|
81905d6c3f | ||
|
|
6822c1dc63 | ||
|
|
27abc2bf6a | ||
|
|
4f433bc6ee | ||
|
|
20747124d1 | ||
|
|
4833b512f5 | ||
|
|
63dd69abc6 | ||
|
|
f38743e863 | ||
|
|
8e1b8b38e4 | ||
|
|
6962c4a477 | ||
|
|
6bf2d31798 | ||
|
|
6afa44f90a | ||
|
|
2ab1c134ed | ||
|
|
51bcfbd549 | ||
|
|
3b180e7199 | ||
|
|
b34377d447 | ||
|
|
f2ce4e6a5a | ||
|
|
757c5f70f0 | ||
|
|
78160a33a9 | ||
|
|
092110672a | ||
|
|
c5acf2aba0 | ||
|
|
316735cfef | ||
|
|
a1b0eb8b84 | ||
|
|
32e9199d4a | ||
|
|
56ebafd48d | ||
|
|
d304ededd5 | ||
|
|
7a4d8cb101 | ||
|
|
3303630a45 | ||
|
|
20fd69d239 | ||
|
|
b8a4b805c7 | ||
|
|
a56caffe09 | ||
|
|
b08656daa6 | ||
|
|
57405e810c | ||
|
|
6e417035b6 | ||
|
|
1d3755952f | ||
|
|
bcc1ecbf0e | ||
|
|
a251b8996e | ||
|
|
1931072b96 | ||
|
|
ce08b19170 | ||
|
|
998f4d139e | ||
|
|
5023ecf90c | ||
|
|
6479966472 | ||
|
|
841c0e5c2f | ||
|
|
01f966c5f2 | ||
|
|
d711838948 | ||
|
|
fe64308942 | ||
|
|
56b6ab7e98 | ||
|
|
5f9fb7f1b4 | ||
|
|
1dcad52e15 | ||
|
|
cadd3679e9 | ||
|
|
97b100bbbb | ||
|
|
8b5ea4cf28 | ||
|
|
b17ce02ae1 | ||
|
|
bb5b215a33 | ||
|
|
8cf2b8330c | ||
|
|
f11687481f | ||
|
|
c5889cb338 | ||
|
|
1f80df0af0 | ||
|
|
2d1492f3e4 | ||
|
|
b8e2ace91c | ||
|
|
4fde6477c6 | ||
|
|
9ecd2e4e03 | ||
|
|
3842585777 | ||
|
|
18726e59f4 | ||
|
|
02c0583b34 | ||
|
|
9ed7df8476 | ||
|
|
f49ac4dff7 | ||
|
|
16a36ef22a | ||
|
|
4305000bf7 | ||
|
|
65824934d1 | ||
|
|
992fbd9f8d | ||
|
|
882c19ad8f | ||
|
|
637640b938 | ||
|
|
490e4ce2ac | ||
|
|
30ecc82ca2 | ||
|
|
bf4ebd0e5b | ||
|
|
ec7d221b08 | ||
|
|
e5b054fcfc | ||
|
|
b3ec5b6eb5 | ||
|
|
d5a49a5ce7 | ||
|
|
90689f306b | ||
|
|
1e2e5afd07 | ||
|
|
d9d44f029f | ||
|
|
cc1c2bff30 | ||
|
|
7352f8d872 | ||
|
|
4be6324cf3 | ||
|
|
0169e5e133 | ||
|
|
fc5d23109d | ||
|
|
2493a9243f | ||
|
|
28804c0af3 | ||
|
|
9d0fdecf92 | ||
|
|
dfc5886812 | ||
|
|
9a582addc3 | ||
|
|
41a8572c55 | ||
|
|
01c46c6b98 | ||
|
|
bb6f5d50bb | ||
|
|
e2d6dcaa25 | ||
|
|
75062b805c | ||
|
|
853002e70a | ||
|
|
962cbbe25d | ||
|
|
97e3b44130 | ||
|
|
8002386230 | ||
|
|
f84e13c14d | ||
|
|
ee382817d3 | ||
|
|
a834584b9d | ||
|
|
49f737ec2f | ||
|
|
7bf6d486c3 | ||
|
|
bf75790921 | ||
|
|
5b253ddd5d | ||
|
|
4c940c848b | ||
|
|
6564a0e020 | ||
|
|
c6dd965a9a | ||
|
|
d87972242a | ||
|
|
50eb73d4e8 | ||
|
|
08ec414094 | ||
|
|
601c999023 | ||
|
|
e1577d4fae | ||
|
|
79ae4b62a3 | ||
|
|
f90582d24f | ||
|
|
bc2440eeab | ||
|
|
92837c9597 | ||
|
|
b348757416 | ||
|
|
f5912f8040 | ||
|
|
95f5604bfe | ||
|
|
1ae65dd516 | ||
|
|
50773f5456 | ||
|
|
ccb332cb42 | ||
|
|
9a2dd217f1 | ||
|
|
3fe9f5a573 | ||
|
|
6858a35754 | ||
|
|
e7ce54188b | ||
|
|
9f366645c9 | ||
|
|
6a7e5a1d38 | ||
|
|
17bc993296 | ||
|
|
c348529e65 | ||
|
|
cc52a25db4 | ||
|
|
8b0bf8f211 | ||
|
|
455986b08c | ||
|
|
5b2c3c77ef | ||
|
|
11aaac0f0b | ||
|
|
6d3e29db03 | ||
|
|
655039745a | ||
|
|
09f44f1aff | ||
|
|
5ac0bac555 | ||
|
|
c7d9336b70 | ||
|
|
c11891e718 | ||
|
|
de56fca73d | ||
|
|
c20ec1e839 | ||
|
|
f8be8cb795 | ||
|
|
eb3a76769d | ||
|
|
49d2499f73 | ||
|
|
a64bbb8bb8 | ||
|
|
011fafb5b0 | ||
|
|
748b118fb1 | ||
|
|
b78839a8d4 | ||
|
|
8894a819f2 | ||
|
|
e25f0c304a | ||
|
|
bbea7b72c3 | ||
|
|
896a856c57 | ||
|
|
c80851adb7 | ||
|
|
49ac4a51a1 | ||
|
|
0d9e5fe836 | ||
|
|
34c8ccd497 | ||
|
|
f73265ac3e | ||
|
|
5e7972779f | ||
|
|
8ad8f45545 | ||
|
|
71965165b9 | ||
|
|
34dbd82a59 | ||
|
|
9aa77848d7 | ||
|
|
ad69f9d11a | ||
|
|
faeaf052b9 | ||
|
|
b0d8b5901f | ||
|
|
4496931bdf | ||
|
|
34cb16d385 | ||
|
|
bad147d898 | ||
|
|
289b0311bf | ||
|
|
1714f7603d | ||
|
|
d6d17aac35 | ||
|
|
6350bfb0ec | ||
|
|
8421d3817a | ||
|
|
3362e2071c | ||
|
|
72c0518ebc | ||
|
|
0a4ec5e97a | ||
|
|
15d7f0295a | ||
|
|
c5817a3b06 | ||
|
|
e5ac60d476 | ||
|
|
3e3f9d1c14 | ||
|
|
3ce1bccf02 | ||
|
|
205e608d60 | ||
|
|
9dab75b5fd | ||
|
|
c9c10686ab | ||
|
|
a110e675c6 | ||
|
|
9b24ea0ae4 | ||
|
|
172f354b04 | ||
|
|
cf49ed0a7b | ||
|
|
ea5ce8258d | ||
|
|
ab9369d8b7 | ||
|
|
2ce6a8e192 | ||
|
|
d8bed79f84 | ||
|
|
6ab3c279aa | ||
|
|
a8c2496292 | ||
|
|
94d881fe63 | ||
|
|
d98e3e818e | ||
|
|
58f76009e4 | ||
|
|
64ca48dfc8 | ||
|
|
4ef94b5ac2 | ||
|
|
339b68c8af | ||
|
|
623445aa5e | ||
|
|
cacdb6a1cd | ||
|
|
f5a6564fd0 | ||
|
|
338f4eb50c | ||
|
|
9b5f29eee4 | ||
|
|
797cf8aed9 | ||
|
|
63c9e55355 | ||
|
|
7f9e381bc3 | ||
|
|
e2a3119af6 | ||
|
|
681a86cb36 | ||
|
|
353fe3e5a5 | ||
|
|
ffaa234bbf | ||
|
|
76055183d2 | ||
|
|
80713ace68 | ||
|
|
01caa4c8cb | ||
|
|
07a71eab12 | ||
|
|
ad827fabff | ||
|
|
ebc557c2f2 | ||
|
|
c4bbbabe07 | ||
|
|
4c184cbb95 | ||
|
|
ffd42c5e30 | ||
|
|
6628b5bfd5 | ||
|
|
56cd994715 | ||
|
|
e3481d007c | ||
|
|
386dc14a01 | ||
|
|
c8c255b233 | ||
|
|
094e7bc0d4 | ||
|
|
acf2cd2c1d | ||
|
|
bd2e9ca730 | ||
|
|
7039e0f914 | ||
|
|
25153d2062 | ||
|
|
eefee5d04d | ||
|
|
df6bc29360 | ||
|
|
9f2782a126 | ||
|
|
21df0346db | ||
|
|
73910150b2 | ||
|
|
8e8f08c986 | ||
|
|
01b437cd9f | ||
|
|
1ea23faab9 | ||
|
|
8966125ad9 | ||
|
|
de971d6481 | ||
|
|
ee97c10702 | ||
|
|
87a1701f22 | ||
|
|
e265e39be9 | ||
|
|
34323a68fe | ||
|
|
39fad40655 | ||
|
|
bf5a6b0804 | ||
|
|
30d379521a | ||
|
|
fe495657d4 | ||
|
|
40707231c0 | ||
|
|
3dc83d83db | ||
|
|
9bb9faacdf | ||
|
|
7cdd3e4b11 | ||
|
|
a44f2d9753 | ||
|
|
7c3f1c302e | ||
|
|
f311b51b43 | ||
|
|
8fd8432032 | ||
|
|
6113ea47c2 | ||
|
|
c5e6f3e180 | ||
|
|
f3c2b7d0e6 | ||
|
|
c642280142 | ||
|
|
390f2c2241 | ||
|
|
8563e2b447 | ||
|
|
8e42780eed | ||
|
|
b46802faaa | ||
|
|
96fee27476 | ||
|
|
09eca1b802 | ||
|
|
0bb717b935 | ||
|
|
88e8835f8a | ||
|
|
f317ea3e8d | ||
|
|
8b2ab3e588 | ||
|
|
c7907fa82a | ||
|
|
5b92db6f5a | ||
|
|
d74322503c | ||
|
|
cd8657ad4f | ||
|
|
6f104145b4 | ||
|
|
5eff534dbd | ||
|
|
0dd7e4610b | ||
|
|
e5d824671d | ||
|
|
13f4e02e3b | ||
|
|
ab168c2f06 | ||
|
|
f7c25e91cf | ||
|
|
6ae4299b01 |
No files matched your search
@@ -0,0 +1,95 @@
|
|||||||
|
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
|
||||||
+4
-5
@@ -1,5 +1,4 @@
|
|||||||
.vscode/*
|
build/
|
||||||
build/*
|
.cache/
|
||||||
debug/*
|
*.log
|
||||||
UserDir/*
|
dist/
|
||||||
CMakeCache.txt
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
[Injection]
|
|
||||||
BootstrapAPIPath = "D:/Development/JuiceLoader/build/libs/bootstrap-api.jar"
|
|
||||||
JuiceLoaderJarPath = "D:/Development/JuiceLoader/build/libs/JuiceLoader.jar"
|
|
||||||
JuiceLoaderLibPath = ""
|
|
||||||
EntryJarPath = "D:/Development/JuiceLoader/build/libs/Entry.jar"
|
|
||||||
EntryClass = "cn.xiaozhou233.juiceloader.entry.Entry"
|
|
||||||
EntryMethod = "start"
|
|
||||||
+8
-15
@@ -1,7 +1,7 @@
|
|||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
project(JuiceAgent LANGUAGES C CXX)
|
project(JuiceAgent LANGUAGES C CXX)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
# output directories
|
# output directories
|
||||||
@@ -9,21 +9,14 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||||
|
|
||||||
# includes
|
set(SRC_DIR ${CMAKE_SOURCE_DIR}/src)
|
||||||
set(INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/includes)
|
link_directories("${CMAKE_SOURCE_DIR}/lib")
|
||||||
|
|
||||||
# libraries
|
# libraries
|
||||||
add_subdirectory(${INCLUDES}/ReflectiveDLLInjection)
|
add_subdirectory(${CMAKE_SOURCE_DIR}/includes/ReflectiveDLLInjection)
|
||||||
add_subdirectory(${INCLUDES}/log.c)
|
|
||||||
add_subdirectory(${INCLUDES}/tomlc17)
|
|
||||||
add_subdirectory(src/utils)
|
|
||||||
|
|
||||||
include(cmake/JuiceModule.cmake)
|
|
||||||
include(cmake/BuildVersion.cmake)
|
|
||||||
|
|
||||||
build_version()
|
|
||||||
|
|
||||||
# modules
|
# modules
|
||||||
add_juice_module(agent)
|
add_subdirectory(${SRC_DIR}/libloader)
|
||||||
add_juice_module(juiceloader)
|
add_subdirectory(${SRC_DIR}/injector)
|
||||||
add_juice_module(injector)
|
add_subdirectory(${SRC_DIR}/libinject)
|
||||||
|
add_subdirectory(${SRC_DIR}/libagent)
|
||||||
+4
-5
@@ -2,18 +2,17 @@
|
|||||||
"version": 3,
|
"version": 3,
|
||||||
"configurePresets": [
|
"configurePresets": [
|
||||||
{
|
{
|
||||||
"name": "ninja-release",
|
"name": "release",
|
||||||
"generator": "Ninja",
|
"generator": "Ninja",
|
||||||
"binaryDir": "${sourceDir}/build",
|
"binaryDir": "${sourceDir}/build",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": "Release",
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
"RELEASE_BUILD": "ON"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ninja-debug",
|
"name": "debug",
|
||||||
"generator": "Ninja",
|
"generator": "Ninja",
|
||||||
"binaryDir": "${sourceDir}/debug",
|
"binaryDir": "${sourceDir}/build",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": "Debug"
|
"CMAKE_BUILD_TYPE": "Debug"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,108 +1,240 @@
|
|||||||
|
|
||||||
# JuiceAgent
|
# 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)
|
||||||
|
|
||||||
|
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 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
|
||||||
|
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
## Index
|
||||||
|
|
||||||
|
- [JuiceAgent](#juiceagent)
|
||||||
|
- [Introduction](#introduction)
|
||||||
|
- [How It Works](#how-it-works)
|
||||||
|
- [Features](#features)
|
||||||
|
- [Project Structure](#project-structure)
|
||||||
|
- [Quick Start](#quick-start)
|
||||||
|
- [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.
|
||||||
|
|
||||||
**NOTICE:** Currently only supports **Windows**, and plans to support **Linux** in the future.
|
|
||||||
## 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
|
## Features
|
||||||
### Injector (src/injector)
|
|
||||||
Reflective injector, can be invoke in java (java/InjectorNative.java)
|
|
||||||
- Inject Dlls. (with no params)
|
|
||||||
- Inject JuiceAgent library. (with params)
|
|
||||||
|
|
||||||
### JuiceAgent (src/agent)
|
- Load external JARs into the Bootstrap or System ClassLoader
|
||||||
Minimize loading, inject to target jvm.
|
- Add JARs to an arbitrary class loader
|
||||||
- Get JVM / JNI / JVMTI
|
- Define classes dynamically
|
||||||
- Inject bootstrap-api.jar
|
- Redefine classes by name or class reference
|
||||||
- Inject JuiceLoader.jar
|
- Retransform classes by name or class reference
|
||||||
- Invoke Java Function JuiceLoader init
|
- 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)
|
## Project Structure
|
||||||
Native library for [JuiceLoader](https://github.com/xiaozhou233/JuiceLoader) , Inject Jars/ Redefine class Low-level implementation.
|
|
||||||
- Get JVM / JNI / JVMTI
|
|
||||||
- Inject Custom Jars
|
|
||||||
- Redefine class
|
|
||||||
- Get Loaded Classes
|
|
||||||
- JNI Function (Can be invoke in java)
|
|
||||||
## How To Use
|
|
||||||
|
|
||||||
### 1. Download Files
|
- `src/libloader` — `libloader.dll`. Injected into the target JVM. Attaches to the JVM, parses `config.toml`, injects the embedded `JuiceAgent-API`, and bootstraps the agent.
|
||||||
- Download `libagent`, `libinjector`, and `libjuiceloader` from the Release to the same directory.
|
- `src/libagent` — `libagent.dll`. The JVMTI agent. Registers callbacks (e.g. `ClassFileLoadHook`) and implements the native side of `JuiceAgent-API`.
|
||||||
- Download JARs `bootstrap-api.jar`, `JuiceLoader.jar`, and `Entry.jar` (or your own JAR) to the same directory.
|
- `src/injector` — `injector.exe`. Command-line driver that loads `libinject.dll` and injects `libloader.dll` into the target process.
|
||||||
|
- `src/libinject` — `libinject.dll`. Reflective DLL injector. Exposes a native `inject` function and JNI bindings (`cn.xiaozhou233.juiceagent.injector.InjectorNative`).
|
||||||
|
|
||||||
### 2. Write Config File
|
## Quick Start
|
||||||
Create a config file named `AgentConfig.toml` in the same directory. Example:
|
|
||||||
|
**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.
|
||||||
|
|
||||||
|
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
|
```toml
|
||||||
[Injection]
|
[JuiceAgent]
|
||||||
BootstrapAPIPath = "<YourDir>/bootstrap-api.jar"
|
Version = 2
|
||||||
JuiceLoaderJarPath = "<YourDir>/JuiceLoader.jar"
|
# Path to libagent.dll, default is "./libagent.dll" (relative to the runtime directory)
|
||||||
# Leave empty to use the DLL directory (Normal Inject) or the directory passed as parameter (Reflective Inject)
|
JuiceAgentNativeLibraryPath = ""
|
||||||
JuiceLoaderLibPath = ""
|
|
||||||
EntryJarPath = "<YourDir>/Entry.jar"
|
|
||||||
EntryClass = "entry.class"
|
|
||||||
EntryMethod = "entryMethod"
|
|
||||||
```
|
|
||||||
| Method| Usage|
|
|
||||||
| - | -|
|
|
||||||
| **Reflective Inject** | Uses `libinjector`. Pass the config directory as a parameter. </br> Example: config file at `<YourDir>/AgentConfig.toml`, pass `<YourDir>` as parameter. If a key is empty (e.g., `BootstrapAPIPath = ""`), it defaults to `<DirA>/default-name` (e.g., `<DirA>/bootstrap-api.jar`). |
|
|
||||||
| **Normal Inject** | Uses `LoadLibraryA + CreateRemoteThread`. Keep `AgentConfig.toml` and all DLLs/JARs in the same directory.
|
|
||||||
|
|
||||||
### 3. Invoke Inject Function
|
[JarLoader]
|
||||||
C/C++ Use libinjector and invoke inject(int pid, char* path, InjectParameters *params)
|
Enabled = true
|
||||||
|
# Mode: BuiltIn | CustomJar
|
||||||
Java Use `Injecor.jar`: `java -jar Injecor.jar` or
|
Mode = "BuiltIn"
|
||||||
```
|
# Directory containing dependency JARs to load first (BuiltIn mode)
|
||||||
package cn.xiaozhou233.juiceagent.injector;
|
InjectionDir = "./injection"
|
||||||
|
# Path to the JAR file to be loaded
|
||||||
public class InjectorNative {
|
JarPath = "./MyCustomJar.jar"
|
||||||
/*
|
# Entry class to be executed after loading the JAR
|
||||||
* @param pid target process id
|
EntryClass = "Example.Main"
|
||||||
*/
|
# Entry method, must be: public static void run()
|
||||||
public native boolean inject(int pid, String path);
|
EntryMethod = "run"
|
||||||
|
|
||||||
/*
|
|
||||||
* @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>");
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 4. Done!
|
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.
|
||||||
If the injection is successful, EntryClass .EntryMethod() of <EntryJarPath> will be executed.
|
|
||||||
## Hot To Build
|
- YourDir
|
||||||
### Environment
|
- **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.
|
||||||
|
|
||||||
|
## 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+
|
- Java 8+
|
||||||
- MinGW
|
- MinGW
|
||||||
- CMake
|
- CMake 3.15+
|
||||||
- Ninja
|
- Ninja
|
||||||
```
|
|
||||||
|
### Build with CMake Presets
|
||||||
|
|
||||||
|
```powershell
|
||||||
git clone https://github.com/xiaozhou233/JuiceAgent.git
|
git clone https://github.com/xiaozhou233/JuiceAgent.git
|
||||||
cd JuiceAgent
|
cd JuiceAgent
|
||||||
|
|
||||||
mkdir -p build
|
cmake --preset release
|
||||||
cmake --build build --
|
cmake --build build
|
||||||
```
|
```
|
||||||
dlls: build/bin/
|
|
||||||
|
|
||||||
jars: see [JuiceLoader](https://github.com/xiaozhou233/JuiceLoader)
|
### Manual 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
|
||||||
|
```
|
||||||
|
|
||||||
|
The generated binaries will be placed in `build/bin`.
|
||||||
|
|
||||||
|
## 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
|
## Acknowledgements
|
||||||
|
|
||||||
- [ReflectiveDLLInjection](https://github.com/stephenfewer/ReflectiveDLLInjection) - DLL Inject
|
- [ReflectiveDLLInjection](https://github.com/stephenfewer/ReflectiveDLLInjection) — DLL injection implementation
|
||||||
- [log.c](https://github.com/rxi/log.c) - A simple logger system
|
- [spdlog](https://github.com/gabime/spdlog) — Fast C++ logging library
|
||||||
- [tomlc17](https://github.com/cktan/tomlc17) - TOML parser in C17
|
- [toml11](https://github.com/ToruNiina/toml11) — TOML for Modern C++
|
||||||
|
|
||||||
+241
@@ -0,0 +1,241 @@
|
|||||||
|
# JuiceAgent
|
||||||
|
|
||||||
|
[English](README.md) | [简体中文](README_ZH.md)
|
||||||
|
|
||||||
|
> **注意**:本文档由 AI 自动翻译,可能存在不准确或不通顺之处,请以 [英文版 README](README.md) 为准。如有疑问欢迎提 issue 或 PR 修正。
|
||||||
|
|
||||||
|
JuiceAgent 是一个基于 JVMTI 的高级注入框架,用于运行时 JAR 加载、字节码变换和运行时 JVM 插桩。它可以在 `DisableAttachMechanism=true` 的情况下注入到正在运行的 JVM 进程中,无需 `-javaagent` 启动参数,也无需使用 attach 机制。
|
||||||
|
|
||||||
|
**警告**:本项目仍处于实验阶段,不建议用于生产环境。使用风险自负。
|
||||||
|
|
||||||
|
> **提示**:部分杀毒软件可能将 JuiceAgent 误报为恶意软件。详情见[杀毒软件误报说明](docs/Antivirus-False-Positive.md)。
|
||||||
|
|
||||||
|
**注意**:本项目针对标准 JVM 设计,自定义 JVM 可能无法运行。
|
||||||
|
|
||||||
|
欢迎加入我们的 QQ / Discord 群组获取更多信息和支持:
|
||||||
|
- Discord:[JuiceDev](https://discord.gg/AQTnUyWNNJ)
|
||||||
|
- QQ 群:1103504356
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
## 目录
|
||||||
|
|
||||||
|
- [JuiceAgent](#juiceagent)
|
||||||
|
- [简介](#简介)
|
||||||
|
- [工作原理](#工作原理)
|
||||||
|
- [特性](#特性)
|
||||||
|
- [项目结构](#项目结构)
|
||||||
|
- [快速开始](#快速开始)
|
||||||
|
- [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 内嵌于原生二进制中,无需单独下载。
|
||||||
|
|
||||||
|
## 特性
|
||||||
|
|
||||||
|
- 将外部 JAR 加载到 Bootstrap 或 System ClassLoader
|
||||||
|
- 将 JAR 添加到任意类加载器
|
||||||
|
- 动态定义类
|
||||||
|
- 按名称或类引用重新定义类
|
||||||
|
- 按名称或类引用重变换类
|
||||||
|
- 获取所有已加载的类
|
||||||
|
- 按名称查找类
|
||||||
|
- 按名称或类引用获取类的字节码
|
||||||
|
- 自动附加 JVM,支持 `DisableAttachMechanism=true`
|
||||||
|
|
||||||
|
## 项目结构
|
||||||
|
|
||||||
|
- `src/libloader` — `libloader.dll`。注入到目标 JVM,附加 JVM、解析 `config.toml`、注入内嵌的 `JuiceAgent-API` 并引导 agent。
|
||||||
|
- `src/libagent` — `libagent.dll`。JVMTI agent。注册回调(例如 `ClassFileLoadHook`)并实现 `JuiceAgent-API` 的原生侧。
|
||||||
|
- `src/injector` — `injector.exe`。命令行驱动,加载 `libinject.dll` 并将 `libloader.dll` 注入到目标进程。
|
||||||
|
- `src/libinject` — `libinject.dll`。反射式 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`。
|
||||||
|
|
||||||
|
解压 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 并执行指定的入口类和入口方法。
|
||||||
|
|
||||||
|
## 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
|
||||||
|
- 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` 中。
|
||||||
|
|
||||||
|
## 完整免责声明
|
||||||
|
|
||||||
|
本项目仅用于受控环境下的学习与研究。作者不对因未授权使用、修改、破解或违反任何适用协议或法律所造成的后果负责。用户有责任确保其行为合法合规。
|
||||||
|
|
||||||
|
## 致谢
|
||||||
|
|
||||||
|
- [ReflectiveDLLInjection](https://github.com/stephenfewer/ReflectiveDLLInjection) — DLL 注入实现
|
||||||
|
- [spdlog](https://github.com/gabime/spdlog) — 高性能 C++ 日志库
|
||||||
|
- [toml11](https://github.com/ToruNiina/toml11) — 现代 C++ 的 TOML 库
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
Major=5
|
||||||
|
Minor=0
|
||||||
|
Patch=1
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
# BuildVersion.cmake
|
|
||||||
# function to get and set the build version
|
|
||||||
|
|
||||||
function(build_version)
|
|
||||||
set(VERSION_FILE "${CMAKE_SOURCE_DIR}/version.txt")
|
|
||||||
|
|
||||||
file(READ "${VERSION_FILE}" VERSION_CONTENT)
|
|
||||||
|
|
||||||
# VERSION_MAJOR
|
|
||||||
string(REGEX MATCH "VERSION_MAJOR=([0-9]+)" _ ${VERSION_CONTENT})
|
|
||||||
set(PROJECT_VERSION_MAJOR ${CMAKE_MATCH_1})
|
|
||||||
# VERSION_MINOR
|
|
||||||
string(REGEX MATCH "VERSION_MINOR=([0-9]+)" _ ${VERSION_CONTENT})
|
|
||||||
set(PROJECT_VERSION_MINOR ${CMAKE_MATCH_1})
|
|
||||||
# BUILD_NUMBER
|
|
||||||
string(REGEX MATCH "BUILD_NUMBER=([0-9]+)" _ ${VERSION_CONTENT})
|
|
||||||
set(PROJECT_BUILD_NUMBER ${CMAKE_MATCH_1})
|
|
||||||
if(RELEASE_BUILD)
|
|
||||||
math(EXPR PROJECT_BUILD_NUMBER "${PROJECT_BUILD_NUMBER} + 1")
|
|
||||||
file(WRITE "${VERSION_FILE}"
|
|
||||||
"VERSION_MAJOR=${PROJECT_VERSION_MAJOR}\n"
|
|
||||||
"VERSION_MINOR=${PROJECT_VERSION_MINOR}\n"
|
|
||||||
"BUILD_NUMBER=${PROJECT_BUILD_NUMBER}\n"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(PROJECT_VERSION_STRING "v${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}-b${PROJECT_BUILD_NUMBER}")
|
|
||||||
|
|
||||||
message(STATUS "Build version: ${PROJECT_VERSION_STRING}")
|
|
||||||
|
|
||||||
add_compile_definitions(
|
|
||||||
PROJECT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR}
|
|
||||||
PROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR}
|
|
||||||
PROJECT_BUILD_NUMBER=${PROJECT_BUILD_NUMBER}
|
|
||||||
PROJECT_VERSION_STRING=\"${PROJECT_VERSION_STRING}\")
|
|
||||||
endfunction()
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
# JuiceModule.cmake
|
|
||||||
# Function to add a JuiceAgent module (agent, injector, juiceloader)
|
|
||||||
|
|
||||||
function(add_juice_module NAME)
|
|
||||||
link_directories("$ENV{JAVA_HOME}/lib")
|
|
||||||
|
|
||||||
# Collect all source files in module src and utils
|
|
||||||
file(GLOB MODULE_SOURCES
|
|
||||||
"${CMAKE_SOURCE_DIR}/src/${NAME}/*.c"
|
|
||||||
"${CMAKE_SOURCE_DIR}/src/${NAME}/utils/*.c"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create shared library
|
|
||||||
add_library(${NAME} SHARED ${MODULE_SOURCES})
|
|
||||||
|
|
||||||
# Include directories
|
|
||||||
target_include_directories(${NAME} PRIVATE
|
|
||||||
${CMAKE_SOURCE_DIR}/includes
|
|
||||||
${CMAKE_SOURCE_DIR}/includes/jvm
|
|
||||||
${CMAKE_SOURCE_DIR}/includes/jvm/win32
|
|
||||||
${CMAKE_SOURCE_DIR}/includes/JuiceAgent
|
|
||||||
${CMAKE_SOURCE_DIR}/includes/ReflectiveDLLInjection
|
|
||||||
${CMAKE_SOURCE_DIR}/includes/log.c
|
|
||||||
"${CMAKE_SOURCE_DIR}/src/${NAME}/utils"
|
|
||||||
"${CMAKE_SOURCE_DIR}/src/${NAME}/include"
|
|
||||||
"${CMAKE_SOURCE_DIR}/src/utils"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Link common libraries
|
|
||||||
target_link_libraries(${NAME} PRIVATE
|
|
||||||
ReflectiveDLLInjection
|
|
||||||
log.c
|
|
||||||
jvm
|
|
||||||
utils
|
|
||||||
)
|
|
||||||
|
|
||||||
add_subdirectory("${CMAKE_SOURCE_DIR}/src/${NAME}")
|
|
||||||
endfunction()
|
|
||||||
@@ -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.
|
||||||
@@ -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>");
|
||||||
|
```
|
||||||
@@ -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.
|
||||||
@@ -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.
|
||||||
@@ -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.
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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)
|
||||||
@@ -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)
|
||||||
@@ -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.
|
||||||
@@ -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.
|
||||||
@@ -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
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -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
|
||||||
@@ -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.
|
||||||
@@ -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
|
||||||
@@ -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。
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# Build output directory (intermediate)
|
||||||
|
out/
|
||||||
|
|
||||||
|
# Do not ignore root build artifacts:
|
||||||
|
!new_target.class
|
||||||
|
!playload.jar
|
||||||
|
!target.jar
|
||||||
@@ -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 |
|
||||||
|
| `playload.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`) |
|
||||||
|
| `playload/` | 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 `playload.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)
|
||||||
|
|
||||||
|
`playload.jar` and `target.jar` are already included by default.
|
||||||
|
If you modified `playload/`, `target/` or `new_target/`, run:
|
||||||
|
|
||||||
|
```
|
||||||
|
build.bat
|
||||||
|
```
|
||||||
|
|
||||||
|
to regenerate `playload.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:
|
||||||
|
|
||||||
|
```
|
||||||
|
Playload loaded!
|
||||||
|
Playload executed!
|
||||||
|
```
|
||||||
|
|
||||||
|
and the output of `say()` changes from `Hello!` to:
|
||||||
|
|
||||||
|
```
|
||||||
|
Hello!
|
||||||
|
Retransformed!
|
||||||
|
```
|
||||||
|
|
||||||
|
## Config / config.toml
|
||||||
|
|
||||||
|
| Key | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| `JarPath` | JAR path to inject (default: `./playload.jar`) |
|
||||||
|
| `EntryClass` | Entry class (default: `playload`) |
|
||||||
|
| `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 `Playload 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 `playload.jar` is up to date.
|
||||||
@@ -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
|
||||||
|
playload.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)
|
||||||
|
playload/ - 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 playload.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)
|
||||||
|
playload.jar and target.jar are already included by default.
|
||||||
|
If you modified playload/, target/ or new_target/, run:
|
||||||
|
build.bat
|
||||||
|
to regenerate playload.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:
|
||||||
|
Playload loaded!
|
||||||
|
Playload executed!
|
||||||
|
and the output of say() changes from "Hello!" to:
|
||||||
|
Hello!
|
||||||
|
Retransformed!
|
||||||
|
|
||||||
|
============================================
|
||||||
|
Config / config.toml
|
||||||
|
============================================
|
||||||
|
|
||||||
|
JarPath - JAR path to inject (default: ./playload.jar)
|
||||||
|
EntryClass - Entry class (default: playload)
|
||||||
|
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 "Playload 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 playload.jar is up to date.
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
set "API_JAR=playload\JuiceAgent-API-1.4.1+build.1.jar"
|
||||||
|
set "PAYLOAD_JAR=playload.jar"
|
||||||
|
set "TARGET_JAR=target.jar"
|
||||||
|
|
||||||
|
set "OUT=out"
|
||||||
|
set "OUT_NT=%OUT%\new_target"
|
||||||
|
set "OUT_PL=%OUT%\playload"
|
||||||
|
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 playload ===
|
||||||
|
javac -encoding UTF-8 --release 8 -cp "%API_JAR%" -d "%OUT_PL%" playload\playload.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%" playload.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
|
||||||
@@ -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 = "./playload.jar"
|
||||||
|
EntryClass = "playload"
|
||||||
|
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.
Binary file not shown.
@@ -0,0 +1,25 @@
|
|||||||
|
import cn.xiaozhou233.juiceagent.api.JuiceAgent;
|
||||||
|
|
||||||
|
public class playload {
|
||||||
|
public static void entry() throws java.io.IOException {
|
||||||
|
System.out.println("Playload 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("Playload executed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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 |
|
||||||
|
| `playload.jar` | 注入用的 JAR(由 `build.bat` 生成) |
|
||||||
|
| `target.jar` | 目标 JVM 程序(由 `build.bat` 生成) |
|
||||||
|
| `new_target.class` | 重变换后的字节码(由 `build.bat` 生成) |
|
||||||
|
| `playload/` | payload 源码 |
|
||||||
|
| `target/` | 目标类源码 |
|
||||||
|
| `new_target/` | target 的修改版源码 |
|
||||||
|
|
||||||
|
## 本示例的作用
|
||||||
|
|
||||||
|
目标类 `target` 的 `say()` 方法原本打印:
|
||||||
|
|
||||||
|
```
|
||||||
|
Hello!
|
||||||
|
```
|
||||||
|
|
||||||
|
`new_target/target.java` 是它的修改版,额外打印:
|
||||||
|
|
||||||
|
```
|
||||||
|
Retransformed!
|
||||||
|
```
|
||||||
|
|
||||||
|
本示例把 `playload.jar` 注入到运行中的 JVM。payload 从自己的 JAR 中读取
|
||||||
|
`new_target.class`,调用 `JuiceAgent.retransformClassByName("target", ...)`
|
||||||
|
在运行时动态替换已加载的 `target` 类。之后 `say()` 无需重启 JVM 就会输出新内容。
|
||||||
|
|
||||||
|
## 使用步骤
|
||||||
|
|
||||||
|
### 1. 构建(可选)
|
||||||
|
|
||||||
|
`playload.jar` 和 `target.jar` 默认已包含。
|
||||||
|
如果修改了 `playload/`、`target/` 或 `new_target/`,运行:
|
||||||
|
|
||||||
|
```
|
||||||
|
build.bat
|
||||||
|
```
|
||||||
|
|
||||||
|
重新生成 `playload.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. 验证
|
||||||
|
|
||||||
|
回到目标窗口,注入成功应看到:
|
||||||
|
|
||||||
|
```
|
||||||
|
Playload loaded!
|
||||||
|
Playload executed!
|
||||||
|
```
|
||||||
|
|
||||||
|
并且 `say()` 的输出从 `Hello!` 变为:
|
||||||
|
|
||||||
|
```
|
||||||
|
Hello!
|
||||||
|
Retransformed!
|
||||||
|
```
|
||||||
|
|
||||||
|
## 配置 / config.toml
|
||||||
|
|
||||||
|
| 配置项 | 说明 |
|
||||||
|
| --- | --- |
|
||||||
|
| `JarPath` | 注入的 JAR 路径(默认 `./playload.jar`) |
|
||||||
|
| `EntryClass` | 入口类(默认 `playload`) |
|
||||||
|
| `EntryMethod` | 入口方法,必须为 `public static void entry()` |
|
||||||
|
|
||||||
|
## 常见问题
|
||||||
|
|
||||||
|
- `java/javac/jar is not recognized`:
|
||||||
|
安装 JDK 并将 `bin` 目录加入 `PATH`。
|
||||||
|
- `injector.exe` 提示注入失败:
|
||||||
|
确认目标 JVM 正在运行且 PID 正确。
|
||||||
|
- 没有出现 `Playload loaded!` 输出:
|
||||||
|
查看本目录下的 `libagent.log` 和 `libloader.log` 定位原因。
|
||||||
|
- `say()` 输出没有变化:
|
||||||
|
确认修改 `new_target/` 后重新运行过 `build.bat`,且 `playload.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
|
||||||
|
playload.jar - 注入用的 JAR (由 build.bat 生成)
|
||||||
|
target.jar - 目标 JVM 程序 (由 build.bat 生成)
|
||||||
|
new_target.class - 重变换后的字节码 (由 build.bat 生成)
|
||||||
|
playload/ - payload 源码
|
||||||
|
target/ - 目标类源码
|
||||||
|
new_target/ - target 的修改版源码
|
||||||
|
|
||||||
|
============================================
|
||||||
|
本示例的作用
|
||||||
|
============================================
|
||||||
|
|
||||||
|
目标类 "target" 的 say() 方法原本打印:
|
||||||
|
Hello!
|
||||||
|
|
||||||
|
new_target/target.java 是它的修改版, 额外打印:
|
||||||
|
Retransformed!
|
||||||
|
|
||||||
|
本示例把 playload.jar 注入到运行中的 JVM。payload 从自己的 JAR 中读取
|
||||||
|
new_target.class, 调用 JuiceAgent.retransformClassByName("target", ...)
|
||||||
|
在运行时动态替换已加载的 "target" 类。之后 say() 无需重启 JVM 就会输出新内容。
|
||||||
|
|
||||||
|
============================================
|
||||||
|
使用步骤
|
||||||
|
============================================
|
||||||
|
|
||||||
|
1. 构建 (可选)
|
||||||
|
playload.jar 和 target.jar 默认已包含。
|
||||||
|
如果修改了 playload/、target/ 或 new_target/, 运行:
|
||||||
|
build.bat
|
||||||
|
重新生成 playload.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. 验证
|
||||||
|
回到目标窗口, 注入成功应看到:
|
||||||
|
Playload loaded!
|
||||||
|
Playload executed!
|
||||||
|
并且 say() 的输出从 "Hello!" 变为:
|
||||||
|
Hello!
|
||||||
|
Retransformed!
|
||||||
|
|
||||||
|
============================================
|
||||||
|
配置 / config.toml
|
||||||
|
============================================
|
||||||
|
|
||||||
|
JarPath - 注入的 JAR 路径 (默认: ./playload.jar)
|
||||||
|
EntryClass - 入口类 (默认: playload)
|
||||||
|
EntryMethod - 入口方法, 必须为 public static void entry()
|
||||||
|
|
||||||
|
============================================
|
||||||
|
常见问题
|
||||||
|
============================================
|
||||||
|
|
||||||
|
- "java/javac/jar is not recognized":
|
||||||
|
安装 JDK 并将 bin 目录加入 PATH。
|
||||||
|
- injector.exe 提示注入失败:
|
||||||
|
确认目标 JVM 正在运行且 PID 正确。
|
||||||
|
- 没有出现 "Playload loaded!" 输出:
|
||||||
|
查看本目录下的 libagent.log 和 libloader.log 定位原因。
|
||||||
|
- say() 输出没有变化:
|
||||||
|
确认修改 new_target/ 后重新运行过 build.bat, 且 playload.jar 内的
|
||||||
|
new_target.class 是最新的。
|
||||||
@@ -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
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#ifndef INJECTPARAMETERS_H
|
|
||||||
#define INJECTPARAMETERS_H
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#define INJECT_PATH_MAX 4096
|
|
||||||
|
|
||||||
typedef struct InjectParameters{
|
|
||||||
char ConfigDir[INJECT_PATH_MAX];
|
|
||||||
} InjectParameters;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -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, 0x70, 0xc1, 0x05, 0x45, 0xb0, 0x82, 0xa2, 0x14,
|
||||||
|
0x15, 0x15, 0xef, 0x73, 0x4e, 0x43, 0x4d, 0x6d, 0x93, 0x72, 0x4e, 0x4e,
|
||||||
|
0x11, 0x9f, 0xca, 0xe5, 0x42, 0xf0, 0xc2, 0x07, 0xf0, 0xa1, 0xc4, 0xc9,
|
||||||
|
0x69, 0x5d, 0xaf, 0xa4, 0x04, 0x32, 0x93, 0x49, 0xfe, 0xf9, 0x66, 0x86,
|
||||||
|
0xbc, 0xbd, 0xbf, 0xbc, 0x02, 0x58, 0xc3, 0x6c, 0x01, 0x1e, 0x26, 0xf3,
|
||||||
|
0x48, 0x63, 0x2a, 0x8b, 0xe9, 0x2c, 0x66, 0x18, 0x72, 0xad, 0xd0, 0xb4,
|
||||||
|
0x55, 0x55, 0x86, 0x0c, 0xeb, 0x95, 0x40, 0xf3, 0x5b, 0x25, 0xcc, 0xdd,
|
||||||
|
0xb5, 0x89, 0x57, 0x56, 0x57, 0x79, 0x3d, 0x56, 0x81, 0x14, 0x35, 0xa9,
|
||||||
|
0x2d, 0x17, 0x2d, 0xc5, 0x7d, 0x63, 0x6c, 0x64, 0x43, 0xd1, 0xe2, 0x15,
|
||||||
|
0x23, 0x48, 0x51, 0x0e, 0x55, 0xb5, 0x26, 0xb7, 0x19, 0x32, 0x3b, 0x4a,
|
||||||
|
0x2b, 0xbb, 0xcb, 0x90, 0x2e, 0x2d, 0x5c, 0x31, 0x78, 0xfb, 0xa6, 0x2a,
|
||||||
|
0x19, 0x86, 0x2a, 0x4a, 0xcb, 0x93, 0xb8, 0xe9, 0xcb, 0xf0, 0x52, 0xf8,
|
||||||
|
0x0d, 0x8a, 0x8c, 0x56, 0x4c, 0x20, 0x1a, 0x57, 0x22, 0x54, 0xee, 0xdc,
|
||||||
|
0x0d, 0x7a, 0xf6, 0x5a, 0x45, 0x0c, 0x5b, 0xff, 0x86, 0x97, 0x3f, 0xbd,
|
||||||
|
0x2f, 0x7e, 0x7f, 0x4d, 0xda, 0xb3, 0xaf, 0x36, 0x36, 0x4b, 0x0b, 0xbd,
|
||||||
|
0x36, 0x32, 0x77, 0x1e, 0x6b, 0xab, 0x9a, 0xf2, 0x48, 0xb7, 0x55, 0xa4,
|
||||||
|
0xa8, 0xbc, 0x3d, 0xad, 0x8d, 0x15, 0x56, 0x19, 0x1d, 0xb9, 0xf2, 0x1b,
|
||||||
|
0xa6, 0xe9, 0x9b, 0x1b, 0x7e, 0x28, 0xb5, 0x0c, 0x85, 0x95, 0x55, 0xc7,
|
||||||
|
0x8e, 0x7e, 0xb2, 0xb7, 0x4a, 0xbd, 0xa1, 0xdd, 0xd8, 0x0a, 0x17, 0x26,
|
||||||
|
0x0e, 0x03, 0x79, 0xa0, 0xdc, 0x54, 0xc6, 0xff, 0x74, 0xb9, 0x54, 0x17,
|
||||||
|
0x6d, 0x51, 0x44, 0x16, 0xb9, 0x22, 0xfa, 0x90, 0x61, 0xd8, 0xe8, 0x71,
|
||||||
|
0x5c, 0x0c, 0xc3, 0x2e, 0x15, 0x6f, 0x08, 0x5d, 0xe3, 0xa7, 0x7e, 0x5d,
|
||||||
|
0x06, 0x16, 0xcb, 0xf4, 0x21, 0x3c, 0xfa, 0x20, 0x0c, 0xc7, 0x2e, 0x39,
|
||||||
|
0x79, 0x69, 0xa4, 0x1c, 0x8b, 0x22, 0x79, 0x3a, 0x71, 0xb2, 0x8c, 0x6c,
|
||||||
|
0xdf, 0xe2, 0x33, 0xd8, 0x03, 0x39, 0x29, 0x14, 0x68, 0xcf, 0x24, 0xc1,
|
||||||
|
0x7e, 0x5a, 0x40, 0xb1, 0xf3, 0x80, 0xec, 0x00, 0xd9, 0x3c, 0x06, 0x31,
|
||||||
|
0x44, 0xaf, 0x9c, 0x78, 0x3e, 0xb9, 0x01, 0xbc, 0x47, 0xa4, 0xee, 0x13,
|
||||||
|
0xc8, 0xb7, 0x36, 0x8b, 0xe1, 0xae, 0x3f, 0x92, 0xa8, 0x46, 0x31, 0xd6,
|
||||||
|
0x55, 0x7d, 0x23, 0x9f, 0x90, 0xfa, 0x8b, 0xcc, 0xfd, 0x42, 0x76, 0x2a,
|
||||||
|
0xfe, 0x99, 0x88, 0xc6, 0x97, 0x28, 0x26, 0x3e, 0x00, 0x50, 0x4b, 0x03,
|
||||||
|
0x04, 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, 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, 0xd1, 0x17, 0x9d, 0x69, 0xc1,
|
||||||
|
0xb1, 0x33, 0xf8, 0xe2, 0xf8, 0xe0, 0xff, 0xe1, 0x83, 0xe3, 0x8c, 0xbe,
|
||||||
|
0xf6, 0x05, 0xf1, 0xdc, 0x4d, 0x94, 0x02, 0x99, 0x61, 0x0c, 0xb9, 0xe7,
|
||||||
|
0xde, 0x73, 0xee, 0x3d, 0xbf, 0xfb, 0x3b, 0x1f, 0x37, 0xfc, 0xfa, 0xf7,
|
||||||
|
0x8f, 0x47, 0x00, 0xae, 0xe3, 0x13, 0x05, 0x09, 0x4c, 0x2b, 0xb8, 0x89,
|
||||||
|
0x5b, 0x12, 0x6e, 0xcb, 0x78, 0x4f, 0x81, 0x1f, 0x33, 0x32, 0xee, 0x08,
|
||||||
|
0xd3, 0xac, 0x8c, 0xbb, 0x12, 0xe6, 0x14, 0x84, 0x31, 0x2d, 0x63, 0x5e,
|
||||||
|
0xcc, 0xf7, 0x84, 0x78, 0x5f, 0x6c, 0xa6, 0x65, 0x74, 0x88, 0x79, 0x41,
|
||||||
|
0x86, 0x26, 0xa3, 0x4b, 0x46, 0x77, 0x18, 0x57, 0xf0, 0x81, 0x10, 0x19,
|
||||||
|
0x21, 0x16, 0x85, 0x58, 0x92, 0x70, 0x5f, 0xc2, 0x32, 0x83, 0xc4, 0x9d,
|
||||||
|
0x7c, 0x71, 0xa9, 0xb4, 0xcb, 0xc0, 0xd2, 0x0c, 0xf5, 0xb3, 0xb6, 0x55,
|
||||||
|
0x74, 0xb9, 0xe5, 0xae, 0x72, 0xb3, 0xa4, 0xfb, 0x89, 0x49, 0x90, 0x8e,
|
||||||
|
0xac, 0xea, 0x4e, 0xd1, 0xb0, 0x2d, 0x86, 0x68, 0x66, 0x9b, 0xef, 0xf1,
|
||||||
|
0xa4, 0xc9, 0xad, 0x7c, 0x72, 0xc5, 0x75, 0x0c, 0x2b, 0x3f, 0xc5, 0xd0,
|
||||||
|
0xb2, 0x50, 0x32, 0x72, 0xfa, 0x4c, 0x5e, 0xb7, 0xdc, 0x99, 0xe5, 0xf4,
|
||||||
|
0x02, 0x77, 0x96, 0xb9, 0xbb, 0xc5, 0xd0, 0x76, 0x6a, 0x5e, 0xe2, 0xae,
|
||||||
|
0xb1, 0xa7, 0x67, 0x8c, 0xac, 0xc3, 0x9d, 0xa7, 0x95, 0x5d, 0xe5, 0x41,
|
||||||
|
0xc9, 0x72, 0x8d, 0x5d, 0xfd, 0xae, 0xe1, 0x30, 0x84, 0xa6, 0x0d, 0xcb,
|
||||||
|
0x70, 0x6f, 0x31, 0xc4, 0x06, 0x2e, 0x5e, 0x30, 0xb8, 0xca, 0x10, 0x98,
|
||||||
|
0xb5, 0x37, 0x75, 0x86, 0x48, 0xc6, 0xb0, 0x74, 0xe2, 0x9a, 0xd5, 0x9d,
|
||||||
|
0x87, 0x3c, 0x6b, 0xea, 0x82, 0x90, 0x9d, 0xe3, 0xe6, 0x2a, 0x77, 0x0c,
|
||||||
|
0xa1, 0x57, 0x8d, 0xbe, 0x9d, 0x3d, 0x86, 0xe6, 0x27, 0xb5, 0xb8, 0xfa,
|
||||||
|
0x29, 0x5a, 0x82, 0x73, 0xb7, 0x8c, 0x22, 0xc3, 0x68, 0x26, 0x67, 0x25,
|
||||||
|
0xf7, 0x0d, 0x6e, 0x7f, 0xb1, 0x65, 0x97, 0xc6, 0xc6, 0xc7, 0x93, 0xdb,
|
||||||
|
0x82, 0x31, 0x17, 0x8c, 0x93, 0xbc, 0x60, 0x24, 0xd3, 0xd6, 0xb6, 0x9e,
|
||||||
|
0x73, 0x29, 0xf0, 0xb4, 0xf5, 0x99, 0x4d, 0xce, 0x75, 0x22, 0x55, 0x9f,
|
||||||
|
0x16, 0x3d, 0x2c, 0x02, 0x11, 0x1a, 0x65, 0x6c, 0xc5, 0xe5, 0xb9, 0x9d,
|
||||||
|
0x45, 0x5e, 0xf0, 0x2e, 0xf7, 0xb2, 0xfa, 0xa1, 0x84, 0x41, 0x8a, 0x30,
|
||||||
|
0xaf, 0xbb, 0xff, 0x25, 0xae, 0x65, 0x60, 0xb0, 0x16, 0x9d, 0xb6, 0x6a,
|
||||||
|
0x16, 0xd2, 0xd6, 0x9e, 0x51, 0x34, 0xc8, 0x7f, 0xc6, 0xb2, 0x6c, 0x97,
|
||||||
|
0x8b, 0x3b, 0x8b, 0x22, 0x38, 0xd3, 0xde, 0xcd, 0xda, 0x3b, 0xc9, 0x7b,
|
||||||
|
0xba, 0xa5, 0x3b, 0xdc, 0xd5, 0x37, 0xc9, 0xa5, 0x95, 0x60, 0x6b, 0x27,
|
||||||
|
0xbc, 0xe3, 0xcc, 0x4e, 0x8d, 0x9c, 0xd7, 0xd3, 0x81, 0xd7, 0xd3, 0xae,
|
||||||
|
0xac, 0xd8, 0x25, 0x27, 0xa7, 0xcf, 0x1b, 0x5e, 0x26, 0xcf, 0x44, 0x7b,
|
||||||
|
0x55, 0x90, 0x55, 0xd1, 0x83, 0x07, 0x14, 0x8e, 0x8a, 0x15, 0x3c, 0x64,
|
||||||
|
0xe8, 0x3e, 0x0d, 0x20, 0x6d, 0x9a, 0x7a, 0x9e, 0x9b, 0x33, 0x4e, 0xbe,
|
||||||
|
0xb4, 0x4b, 0x77, 0xcd, 0xed, 0xe7, 0xf4, 0x82, 0xeb, 0x05, 0xda, 0xf3,
|
||||||
|
0x5a, 0x8e, 0xb4, 0x1c, 0x17, 0xe1, 0x68, 0x59, 0x5d, 0xb3, 0x4a, 0xa6,
|
||||||
|
0xa9, 0xd9, 0x8e, 0xa6, 0xef, 0x16, 0xdc, 0xa7, 0x02, 0xb7, 0x97, 0xfa,
|
||||||
|
0x6d, 0x4a, 0xc5, 0x23, 0x50, 0x75, 0xd9, 0x4d, 0x0a, 0xeb, 0x7c, 0x76,
|
||||||
|
0xee, 0x94, 0x0c, 0x73, 0x53, 0x77, 0x3c, 0x62, 0x7b, 0xdc, 0x34, 0x36,
|
||||||
|
0x35, 0x5e, 0xbd, 0x6d, 0x52, 0x53, 0xf1, 0x18, 0x1f, 0xa9, 0x58, 0xc3,
|
||||||
|
0x75, 0x15, 0xeb, 0x78, 0xa2, 0x62, 0x03, 0x1f, 0xab, 0xe8, 0x40, 0xa7,
|
||||||
|
0x0a, 0x4d, 0x88, 0x2e, 0x21, 0xba, 0xd1, 0xc9, 0x30, 0xfc, 0x3f, 0x2a,
|
||||||
|
0xcc, 0xd0, 0x78, 0x4a, 0xe2, 0x7e, 0x56, 0xec, 0x9c, 0x31, 0xad, 0x54,
|
||||||
|
0x0b, 0xef, 0x1f, 0x10, 0x2d, 0x29, 0x19, 0xc5, 0x39, 0x11, 0x8c, 0xa7,
|
||||||
|
0xaf, 0x33, 0x04, 0x8b, 0x05, 0xd3, 0x20, 0x87, 0xfe, 0x5a, 0x2d, 0x5c,
|
||||||
|
0xb3, 0x17, 0x43, 0xbc, 0x50, 0xd0, 0xad, 0x4d, 0xea, 0xc3, 0x5a, 0x2e,
|
||||||
|
0x17, 0x4c, 0xd5, 0x84, 0x90, 0xa3, 0xec, 0xda, 0xff, 0x72, 0x91, 0xb7,
|
||||||
|
0x78, 0x71, 0xab, 0xf2, 0x38, 0x88, 0x06, 0x3d, 0xe0, 0x90, 0xfe, 0x79,
|
||||||
|
0x89, 0x9b, 0xc5, 0x73, 0x4f, 0xa9, 0x12, 0xcd, 0xd4, 0xe0, 0x3a, 0xa5,
|
||||||
|
0xe6, 0x0a, 0xfd, 0xae, 0xd0, 0xb3, 0xc6, 0x1b, 0xf4, 0xd7, 0x06, 0x86,
|
||||||
|
0x37, 0x49, 0xf3, 0xa1, 0x9d, 0x06, 0x25, 0xd0, 0x5b, 0x6b, 0xd5, 0xb9,
|
||||||
|
0xab, 0x3a, 0x77, 0x7b, 0x73, 0x90, 0xce, 0x52, 0xdd, 0x48, 0xbe, 0x45,
|
||||||
|
0x46, 0x0d, 0x01, 0x28, 0x00, 0x1b, 0x1e, 0x3a, 0x24, 0xf1, 0x0b, 0x94,
|
||||||
|
0xe1, 0x03, 0xf8, 0x9e, 0xa1, 0xfe, 0x25, 0xfc, 0x6b, 0xd1, 0xc0, 0x21,
|
||||||
|
0x82, 0x3f, 0x0d, 0x47, 0x43, 0x07, 0x90, 0x16, 0x47, 0x96, 0x46, 0x8f,
|
||||||
|
0x52, 0x01, 0x7f, 0x2a, 0x18, 0x0b, 0xc6, 0x02, 0x5f, 0xe3, 0x78, 0x34,
|
||||||
|
0x16, 0x1c, 0x9b, 0x0c, 0x25, 0x42, 0x51, 0x99, 0x76, 0x27, 0xa5, 0x84,
|
||||||
|
0x74, 0x14, 0xfc, 0x0a, 0x9d, 0xc2, 0xed, 0x25, 0xc2, 0x6b, 0x87, 0x50,
|
||||||
|
0xa2, 0x75, 0x07, 0x50, 0x13, 0xe4, 0xab, 0x1e, 0xa0, 0x5e, 0x00, 0x25,
|
||||||
|
0x24, 0xff, 0xd8, 0xa4, 0xec, 0x4b, 0x85, 0x13, 0xe4, 0xd2, 0xf0, 0x2d,
|
||||||
|
0xbc, 0x8f, 0x41, 0x23, 0x10, 0xde, 0xf8, 0xeb, 0x67, 0x9a, 0x33, 0xf3,
|
||||||
|
0x4d, 0x13, 0x7f, 0xd0, 0x3c, 0xfd, 0x78, 0xfa, 0xf7, 0x17, 0x34, 0x6f,
|
||||||
|
0xec, 0x8f, 0x3e, 0xff, 0x81, 0xe6, 0x91, 0x84, 0x1c, 0x8d, 0x1c, 0xa0,
|
||||||
|
0xf1, 0x19, 0x52, 0xfe, 0x54, 0xb8, 0x8c, 0x6b, 0xa4, 0x37, 0x79, 0x7a,
|
||||||
|
0x5f, 0x40, 0xe8, 0x1a, 0xe9, 0x51, 0x4f, 0x8f, 0x07, 0x85, 0xde, 0x48,
|
||||||
|
0x7a, 0xb3, 0xa7, 0x87, 0x42, 0xa9, 0x70, 0x2c, 0xfc, 0x0d, 0x61, 0xa4,
|
||||||
|
0x2b, 0xd7, 0x41, 0xfc, 0x14, 0xb6, 0xd3, 0x18, 0xa0, 0x31, 0x4e, 0xe3,
|
||||||
|
0xd6, 0x50, 0x42, 0x0a, 0x8c, 0xbd, 0x40, 0x4b, 0x19, 0xbd, 0xd5, 0x65,
|
||||||
|
0xac, 0x8c, 0x44, 0x75, 0x19, 0x2f, 0xa3, 0xa1, 0xba, 0x6c, 0x2d, 0xc3,
|
||||||
|
0xff, 0x65, 0x90, 0x95, 0x4f, 0x7c, 0xdf, 0x7b, 0x30, 0x7d, 0x24, 0x97,
|
||||||
|
0xd0, 0x4c, 0xb2, 0x91, 0x52, 0xd8, 0x84, 0x08, 0xa2, 0x54, 0x90, 0x18,
|
||||||
|
0x25, 0x3d, 0x8e, 0x14, 0x5a, 0x71, 0x9b, 0x0a, 0x34, 0x4f, 0x96, 0x2c,
|
||||||
|
0x15, 0xe7, 0x15, 0xda, 0x19, 0xd0, 0xc1, 0xfc, 0xd0, 0x58, 0x1d, 0xba,
|
||||||
|
0x58, 0x03, 0x7a, 0x58, 0x9c, 0x9e, 0x4e, 0x02, 0x7d, 0xac, 0x0b, 0xfd,
|
||||||
|
0xac, 0x17, 0x71, 0x36, 0x84, 0x11, 0xf4, 0x7b, 0xff, 0x31, 0x82, 0xe4,
|
||||||
|
0xfb, 0x1b, 0x11, 0x1c, 0x84, 0x44, 0x48, 0x7f, 0x62, 0x88, 0xca, 0x16,
|
||||||
|
0x12, 0x25, 0xc2, 0x30, 0x9d, 0x81, 0xb7, 0x1a, 0x25, 0x1b, 0xf3, 0xd0,
|
||||||
|
0xae, 0xd2, 0x39, 0x1f, 0x92, 0x64, 0x7e, 0x84, 0xc8, 0x09, 0xd1, 0xf0,
|
||||||
|
0x49, 0xb8, 0x26, 0xe1, 0x6d, 0x20, 0x2c, 0xb4, 0x50, 0x45, 0x93, 0x30,
|
||||||
|
0x46, 0x5f, 0x46, 0x2c, 0x8e, 0x31, 0x51, 0xd1, 0x8f, 0x71, 0x83, 0x16,
|
||||||
|
0x2c, 0x12, 0x89, 0xa8, 0x1d, 0x8a, 0xa2, 0x9c, 0x50, 0x1b, 0x5c, 0x38,
|
||||||
|
0xfc, 0xca, 0xeb, 0x96, 0x71, 0x22, 0xe5, 0x13, 0xdd, 0x42, 0xd7, 0xd0,
|
||||||
|
0x2b, 0x17, 0x3d, 0x34, 0xf4, 0x1c, 0x2d, 0xdf, 0x79, 0x4d, 0x25, 0xf2,
|
||||||
|
0x10, 0xf2, 0x8c, 0x75, 0x1e, 0x7f, 0xb5, 0x72, 0xa0, 0xca, 0xf5, 0x9d,
|
||||||
|
0xea, 0x6e, 0x4a, 0xd0, 0xc6, 0xbb, 0x35, 0x81, 0x62, 0xe7, 0x81, 0xd4,
|
||||||
|
0x4b, 0x81, 0x26, 0x6a, 0x02, 0xc5, 0xcf, 0x03, 0xd5, 0x5f, 0x0a, 0x74,
|
||||||
|
0xa3, 0x26, 0x50, 0xeb, 0x79, 0xa0, 0x86, 0x4b, 0x81, 0x26, 0x3d, 0x8f,
|
||||||
|
0xa9, 0x7f, 0x00, 0x50, 0x4b, 0x03, 0x04, 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, 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, 0x95, 0x53, 0x4d, 0x6f, 0xd3,
|
||||||
|
0x40, 0x10, 0x9d, 0x6d, 0xd3, 0x84, 0xa4, 0x6d, 0x12, 0x9a, 0x26, 0x29,
|
||||||
|
0xa5, 0x50, 0x0a, 0x14, 0xec, 0x50, 0x61, 0x89, 0x72, 0x6b, 0x55, 0x89,
|
||||||
|
0x54, 0x42, 0x02, 0x59, 0xe5, 0x90, 0xaa, 0x87, 0xe6, 0xb4, 0xb1, 0xb7,
|
||||||
|
0xce, 0x46, 0x89, 0xb7, 0x5a, 0xaf, 0x11, 0xe5, 0x5f, 0x71, 0x42, 0xe2,
|
||||||
|
0xc0, 0x0f, 0xe0, 0x47, 0x21, 0x66, 0xb7, 0xae, 0x93, 0x38, 0x3e, 0x14,
|
||||||
|
0x1f, 0x76, 0xf6, 0xbd, 0x99, 0x79, 0xf3, 0x21, 0xef, 0x9f, 0xbf, 0xbf,
|
||||||
|
0x7e, 0x03, 0xc0, 0x7b, 0x38, 0xa8, 0xc0, 0x32, 0xd8, 0x25, 0xe8, 0x94,
|
||||||
|
0xe0, 0x0d, 0x81, 0xe2, 0x31, 0x0f, 0xb9, 0x3a, 0x21, 0xb0, 0x6c, 0xd9,
|
||||||
|
0x17, 0x04, 0x0a, 0xa7, 0xc2, 0x67, 0x04, 0x6a, 0x2e, 0x0f, 0xd9, 0x59,
|
||||||
|
0x3c, 0x19, 0x30, 0x79, 0x4e, 0x07, 0x63, 0x64, 0x36, 0x5c, 0xe1, 0xd1,
|
||||||
|
0xf1, 0x05, 0x95, 0x5c, 0xe3, 0x84, 0x2c, 0xa8, 0x21, 0x8f, 0x08, 0x74,
|
||||||
|
0x5c, 0x2f, 0x74, 0xbe, 0x71, 0x2a, 0xbe, 0x0f, 0x45, 0xfc, 0xee, 0xf0,
|
||||||
|
0xd0, 0x19, 0xc5, 0xdc, 0x63, 0x34, 0x60, 0xa1, 0x72, 0xe8, 0x35, 0x77,
|
||||||
|
0x3e, 0x6b, 0xf8, 0x41, 0xc3, 0x23, 0xcc, 0xd1, 0xf5, 0x08, 0x34, 0x2d,
|
||||||
|
0x77, 0x44, 0xbf, 0x52, 0x67, 0x4c, 0xc3, 0xc0, 0xe9, 0x29, 0xc9, 0xc3,
|
||||||
|
0xe0, 0xc8, 0xbe, 0x24, 0xb0, 0x4b, 0x7d, 0xff, 0x5c, 0x74, 0x85, 0x50,
|
||||||
|
0x91, 0x92, 0xf4, 0xfa, 0x74, 0x4c, 0xa3, 0xc8, 0x15, 0xd4, 0x67, 0xb2,
|
||||||
|
0xc7, 0xa8, 0xf4, 0x86, 0x04, 0x76, 0x4c, 0x44, 0xef, 0x26, 0x52, 0x6c,
|
||||||
|
0x92, 0xe3, 0xae, 0x1b, 0xf7, 0x8c, 0x83, 0xc0, 0x41, 0x4e, 0xad, 0x19,
|
||||||
|
0x66, 0x26, 0xd6, 0xb4, 0xb0, 0xea, 0xb3, 0x2b, 0x1c, 0xdf, 0xd0, 0x99,
|
||||||
|
0xe4, 0xd9, 0xd0, 0x7e, 0xd7, 0xce, 0x7a, 0x70, 0xbc, 0x72, 0x8f, 0x07,
|
||||||
|
0x21, 0x55, 0xb1, 0xc4, 0xf5, 0x38, 0xff, 0x91, 0x7a, 0xdc, 0x39, 0xc1,
|
||||||
|
0xec, 0x75, 0xc9, 0xe6, 0x8a, 0xb7, 0x17, 0x14, 0x30, 0xf7, 0x93, 0x6e,
|
||||||
|
0x72, 0x7b, 0xc1, 0xa3, 0x15, 0x12, 0x67, 0x63, 0x4e, 0xa6, 0x7b, 0x73,
|
||||||
|
0x46, 0x27, 0xd8, 0xce, 0x56, 0xce, 0x1a, 0x92, 0x84, 0xba, 0x64, 0xb8,
|
||||||
|
0xed, 0x30, 0xba, 0x12, 0x72, 0x92, 0x94, 0x6e, 0x65, 0xa9, 0x3b, 0x99,
|
||||||
|
0x7a, 0xc0, 0x94, 0x99, 0xc3, 0x37, 0x34, 0xc3, 0xd8, 0x4d, 0xcb, 0xee,
|
||||||
|
0xe7, 0xec, 0xa2, 0x9d, 0x43, 0xdf, 0xce, 0x59, 0x45, 0x8d, 0x39, 0xd1,
|
||||||
|
0xfd, 0xbc, 0xdf, 0x21, 0x47, 0xd2, 0xba, 0x4f, 0x5c, 0xb2, 0xcb, 0x69,
|
||||||
|
0x0d, 0xa5, 0x9b, 0x6c, 0x2e, 0xee, 0xd2, 0xee, 0x77, 0x33, 0x6b, 0x49,
|
||||||
|
0xf3, 0x8d, 0xab, 0x31, 0x27, 0x71, 0xd7, 0x6b, 0x2b, 0xaf, 0x07, 0x1d,
|
||||||
|
0x5e, 0xe9, 0x89, 0x58, 0x7a, 0xec, 0x23, 0xd7, 0x6f, 0xa3, 0x36, 0xfd,
|
||||||
|
0xeb, 0xdf, 0xea, 0xf0, 0x35, 0x28, 0xc0, 0x0a, 0x0e, 0x70, 0xdf, 0xa7,
|
||||||
|
0x82, 0x8b, 0x9e, 0x56, 0xf9, 0x32, 0x18, 0x31, 0x4f, 0xc1, 0x1e, 0x2c,
|
||||||
|
0xe1, 0xdb, 0xd5, 0x5f, 0x15, 0x88, 0xd6, 0xc3, 0xb3, 0x88, 0xc8, 0x41,
|
||||||
|
0x4b, 0xd0, 0xae, 0x74, 0x7e, 0x02, 0xf9, 0x81, 0x97, 0x25, 0x28, 0xe1,
|
||||||
|
0x59, 0x34, 0x64, 0x01, 0x1e, 0xe0, 0xb9, 0x76, 0x1b, 0x00, 0x65, 0xa8,
|
||||||
|
0x00, 0x90, 0x32, 0xac, 0x22, 0xa3, 0xed, 0x7a, 0x62, 0xab, 0x89, 0xad,
|
||||||
|
0x41, 0xdd, 0xd8, 0x87, 0xb0, 0x81, 0x19, 0x0d, 0xa3, 0xb5, 0x89, 0xb8,
|
||||||
|
0x09, 0xad, 0x14, 0xb7, 0x11, 0x6f, 0xc1, 0x23, 0x13, 0xb7, 0x9d, 0xe1,
|
||||||
|
0x1f, 0x27, 0xfc, 0x0e, 0x3c, 0x49, 0xf9, 0xa7, 0x88, 0x77, 0xe1, 0x59,
|
||||||
|
0x8a, 0xf7, 0x10, 0x3f, 0x87, 0x17, 0x29, 0x7e, 0x89, 0x78, 0x1f, 0x5e,
|
||||||
|
0xe1, 0x9d, 0xc0, 0x6b, 0xc3, 0x58, 0xff, 0x00, 0x50, 0x4b, 0x03, 0x04,
|
||||||
|
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, 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, 0x7d, 0x28, 0x3d, 0xa9, 0x1f, 0x31, 0x84, 0x72,
|
||||||
|
0xf9, 0x13, 0x86, 0xf0, 0xa1, 0x6a, 0x0a, 0x86, 0x85, 0xaa, 0xf4, 0xc4,
|
||||||
|
0xf3, 0x7e, 0xb7, 0x2e, 0xfc, 0xd7, 0xbc, 0xee, 0x92, 0x27, 0x59, 0x55,
|
||||||
|
0x0d, 0xee, 0x9e, 0x70, 0x5f, 0x1a, 0x7b, 0xec, 0x0c, 0xeb, 0xb6, 0x0c,
|
||||||
|
0x18, 0xec, 0x27, 0x9e, 0x27, 0xfc, 0x43, 0x97, 0x07, 0x81, 0x20, 0x73,
|
||||||
|
0xaf, 0xda, 0xf0, 0x9c, 0x0f, 0x92, 0xab, 0x8f, 0x6d, 0xd5, 0xdf, 0x2d,
|
||||||
|
0x95, 0x9c, 0x4e, 0x5f, 0x36, 0x04, 0x6f, 0x09, 0x4f, 0x3b, 0xbc, 0x27,
|
||||||
|
0x9d, 0xa7, 0xc6, 0x7c, 0x6c, 0xcc, 0x03, 0xa5, 0x74, 0xa0, 0x7d, 0xde,
|
||||||
|
0xcb, 0x16, 0x2b, 0x0c, 0x89, 0x40, 0x73, 0x5f, 0x1f, 0x79, 0xda, 0x3f,
|
||||||
|
0x25, 0x3a, 0xae, 0x6a, 0x31, 0xac, 0xe4, 0xaa, 0x1d, 0xfe, 0x9e, 0x3b,
|
||||||
|
0x2e, 0xf7, 0x5a, 0x4e, 0x4d, 0xfb, 0xd2, 0x6b, 0x55, 0x0c, 0x4d, 0x16,
|
||||||
|
0x18, 0x46, 0x53, 0x21, 0xc2, 0xa8, 0xa9, 0xbe, 0xdf, 0x10, 0xc7, 0xd2,
|
||||||
|
0xd0, 0x5b, 0x9b, 0x71, 0xd2, 0xb6, 0x29, 0xa2, 0x0b, 0x1e, 0x79, 0x0d,
|
||||||
|
0x57, 0x05, 0x54, 0xf4, 0x4c, 0xe8, 0xb6, 0x6a, 0x5a, 0xb8, 0x6f, 0x63,
|
||||||
|
0x0b, 0x29, 0x1b, 0x97, 0x31, 0x6f, 0x61, 0xdb, 0x86, 0x83, 0x1d, 0x86,
|
||||||
|
0xf4, 0xdb, 0x21, 0x44, 0x55, 0xf1, 0xa6, 0xf0, 0xdf, 0xa5, 0x27, 0x04,
|
||||||
|
0xd3, 0xd4, 0x0c, 0x57, 0x34, 0x33, 0x16, 0x8a, 0x36, 0x76, 0x91, 0x62,
|
||||||
|
0x48, 0xfd, 0xc9, 0xe6, 0xa0, 0x2f, 0x5d, 0xaa, 0x62, 0x98, 0xbf, 0x08,
|
||||||
|
0x62, 0xa3, 0x84, 0xb2, 0x8d, 0x3d, 0x3c, 0x60, 0x28, 0xfd, 0x47, 0xa7,
|
||||||
|
0x18, 0x16, 0x27, 0x47, 0xbd, 0xa8, 0x77, 0x44, 0x43, 0x33, 0x94, 0xff,
|
||||||
|
0x0e, 0x54, 0xff, 0x55, 0xee, 0x8c, 0x58, 0x1c, 0xf8, 0xb2, 0xd9, 0xa2,
|
||||||
|
0x0e, 0x15, 0xff, 0xf9, 0x7c, 0x86, 0xc8, 0xb0, 0x0b, 0x17, 0x58, 0xd4,
|
||||||
|
0x4e, 0x03, 0x2d, 0xba, 0x34, 0x34, 0xd5, 0xa7, 0xc0, 0xca, 0x68, 0x30,
|
||||||
|
0x52, 0x39, 0x2f, 0xa9, 0x0f, 0x9a, 0xba, 0x21, 0x78, 0x97, 0x66, 0xb3,
|
||||||
|
0x34, 0xc3, 0xcd, 0x60, 0xf5, 0x8c, 0xe5, 0x7a, 0xf4, 0x14, 0x79, 0xaf,
|
||||||
|
0x27, 0xbc, 0x26, 0xc3, 0xd6, 0xac, 0xa9, 0x4f, 0xb9, 0xc6, 0xfd, 0x25,
|
||||||
|
0xe0, 0x98, 0x56, 0x23, 0x17, 0xc3, 0x72, 0x6e, 0x3a, 0xb1, 0x82, 0x1d,
|
||||||
|
0x98, 0x8f, 0x41, 0x0f, 0x95, 0x7e, 0x49, 0x88, 0x16, 0xcd, 0x98, 0xac,
|
||||||
|
0x05, 0xd2, 0x1c, 0x92, 0x8c, 0x64, 0xa4, 0x70, 0x06, 0xf6, 0x89, 0x94,
|
||||||
|
0x39, 0x2c, 0xd2, 0x1e, 0x1d, 0x3a, 0x33, 0xb8, 0x42, 0xbb, 0x3d, 0x4a,
|
||||||
|
0x40, 0x12, 0xcb, 0x24, 0xe9, 0x7a, 0xe7, 0xc5, 0xfb, 0x94, 0x6d, 0x62,
|
||||||
|
0xf1, 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, 0x0b, 0x6d,
|
||||||
|
0xa4, 0x54, 0x4b, 0xa1, 0x45, 0x81, 0xb6, 0x1a, 0x0c, 0x14, 0x9b, 0x8a,
|
||||||
|
0xa6, 0xb5, 0xd6, 0x9b, 0xe4, 0x12, 0x2e, 0x5d, 0x76, 0xe3, 0xee, 0x0d,
|
||||||
|
0x43, 0xfb, 0xe6, 0xa3, 0x1f, 0xa0, 0x0f, 0xf6, 0xb5, 0x9f, 0xa0, 0x3e,
|
||||||
|
0x00, 0x53, 0x66, 0xea, 0xf8, 0xe6, 0xf8, 0xe8, 0xb3, 0xe3, 0xa3, 0x7e,
|
||||||
|
0x0a, 0x1d, 0xcf, 0xdd, 0x4d, 0x09, 0x90, 0xd8, 0xca, 0x66, 0xe6, 0x9e,
|
||||||
|
0x9c, 0x73, 0x7e, 0xe7, 0x9c, 0x3d, 0xff, 0xee, 0xfe, 0xfa, 0xcf, 0xb3,
|
||||||
|
0xe7, 0x00, 0x2e, 0xc0, 0x37, 0x31, 0x8c, 0x09, 0x03, 0x97, 0x4c, 0x34,
|
||||||
|
0x61, 0xb2, 0x0d, 0x53, 0xb8, 0x1c, 0xc7, 0x15, 0x13, 0xd3, 0xf8, 0xd0,
|
||||||
|
0xc0, 0x47, 0x26, 0x0c, 0x4c, 0xc4, 0x31, 0xa3, 0xe9, 0xac, 0x46, 0xcc,
|
||||||
|
0xe9, 0x7f, 0x57, 0xe3, 0xb8, 0xa6, 0x99, 0xeb, 0x71, 0x7c, 0xac, 0xe9,
|
||||||
|
0x27, 0x71, 0xa4, 0x35, 0x9d, 0x37, 0xf0, 0xa9, 0x89, 0x6e, 0x4c, 0xea,
|
||||||
|
0x23, 0xa3, 0x8f, 0x05, 0x03, 0x8b, 0x71, 0xdc, 0x30, 0xd1, 0x1b, 0x09,
|
||||||
|
0x97, 0x4c, 0x0a, 0xf0, 0x99, 0x89, 0x9b, 0xc8, 0xc6, 0x71, 0xcb, 0xc0,
|
||||||
|
0xe7, 0x26, 0x06, 0x31, 0x61, 0x62, 0x19, 0x5f, 0x18, 0xf8, 0xd2, 0x40,
|
||||||
|
0x8e, 0xc1, 0x4a, 0xbb, 0xae, 0xf0, 0xe7, 0x1c, 0x1e, 0x04, 0x22, 0x60,
|
||||||
|
0x68, 0xbd, 0x2c, 0x5d, 0xa9, 0xa6, 0x19, 0x62, 0xc9, 0xd3, 0xcb, 0x0c,
|
||||||
|
0xcd, 0x73, 0x5e, 0x51, 0x30, 0x74, 0x66, 0xa4, 0x2b, 0x16, 0x2b, 0xeb,
|
||||||
|
0x79, 0xe1, 0xdf, 0xe2, 0x79, 0x87, 0x24, 0x89, 0x8c, 0x57, 0xe0, 0xce,
|
||||||
|
0x32, 0xf7, 0xa5, 0xe6, 0xab, 0xc2, 0x66, 0xb5, 0x2a, 0xc9, 0xc7, 0x78,
|
||||||
|
0xa6, 0xe0, 0xa6, 0x36, 0x25, 0xf7, 0x1e, 0xae, 0x7a, 0x95, 0xf3, 0xe3,
|
||||||
|
0xe3, 0xa9, 0xb5, 0x8a, 0x2c, 0x08, 0x5e, 0x12, 0xae, 0x4a, 0xf1, 0xb2,
|
||||||
|
0x4c, 0xcd, 0x6b, 0x76, 0x46, 0xb3, 0xb3, 0x9e, 0xa7, 0x02, 0xe5, 0xf3,
|
||||||
|
0xf2, 0x14, 0x43, 0x4b, 0xa0, 0xb8, 0xaf, 0x18, 0x4e, 0x24, 0x33, 0x6b,
|
||||||
|
0x7c, 0x83, 0xa7, 0x1c, 0xee, 0x96, 0x52, 0x59, 0xe5, 0x4b, 0xb7, 0x34,
|
||||||
|
0xa5, 0x5f, 0xa5, 0x9d, 0xfb, 0xa5, 0xe0, 0x5e, 0x10, 0x0a, 0x74, 0xfc,
|
||||||
|
0x3a, 0x10, 0xc5, 0x97, 0xee, 0x8a, 0xc7, 0x70, 0xf6, 0x15, 0xf1, 0xd3,
|
||||||
|
0xee, 0x9a, 0x28, 0x28, 0xe9, 0xb9, 0x69, 0x82, 0x93, 0x99, 0xe1, 0xc8,
|
||||||
|
0xbc, 0xcf, 0xfd, 0x07, 0x0c, 0xc7, 0x22, 0xaf, 0xd2, 0x4b, 0x5d, 0x97,
|
||||||
|
0x8e, 0x20, 0x55, 0x47, 0x56, 0xf1, 0xc2, 0xfd, 0x05, 0x5e, 0x0e, 0x33,
|
||||||
|
0xa4, 0xb6, 0x51, 0xc9, 0x19, 0xcc, 0xac, 0x57, 0xf1, 0x0b, 0x42, 0x63,
|
||||||
|
0x18, 0xfa, 0x1a, 0xa4, 0x73, 0x4e, 0xbb, 0xb1, 0x70, 0x0a, 0x6f, 0x33,
|
||||||
|
0x8c, 0x1c, 0xe1, 0x65, 0xb4, 0xc9, 0xa8, 0x81, 0xdb, 0x16, 0xee, 0xe0,
|
||||||
|
0x2b, 0x86, 0xe1, 0x3b, 0x35, 0xdf, 0xf6, 0xcc, 0x52, 0xfa, 0xae, 0x7d,
|
||||||
|
0xe5, 0xf0, 0x63, 0xe0, 0xae, 0x85, 0xaf, 0x31, 0xca, 0xd0, 0x7b, 0xb8,
|
||||||
|
0x20, 0xb3, 0x15, 0xe9, 0x14, 0x85, 0xdf, 0xc8, 0xcd, 0x9c, 0xe7, 0xae,
|
||||||
|
0xc8, 0x92, 0xbd, 0x2c, 0xfc, 0x80, 0x22, 0xdb, 0x93, 0xb6, 0x85, 0x7b,
|
||||||
|
0xf8, 0xc6, 0x02, 0x47, 0xde, 0x42, 0x01, 0x79, 0x86, 0x64, 0x9d, 0x4d,
|
||||||
|
0x8d, 0x27, 0x76, 0x9e, 0xfb, 0x4b, 0x5c, 0xad, 0x86, 0x96, 0x45, 0x8d,
|
||||||
|
0x4f, 0xbd, 0x04, 0xbf, 0xc8, 0x95, 0xdc, 0x10, 0x99, 0xa8, 0xc8, 0x7b,
|
||||||
|
0x66, 0x42, 0x9b, 0x0d, 0xd6, 0x99, 0xdd, 0xac, 0xb8, 0x4a, 0xae, 0x8b,
|
||||||
|
0xab, 0xd2, 0x0f, 0x51, 0x2b, 0x1a, 0x65, 0xed, 0xef, 0x8a, 0x85, 0x12,
|
||||||
|
0x56, 0x2d, 0x48, 0xac, 0x32, 0xf4, 0xd7, 0x72, 0xae, 0xda, 0x5d, 0xdb,
|
||||||
|
0x2c, 0x88, 0xb2, 0x2e, 0x27, 0xc3, 0xd0, 0x3e, 0xd7, 0xd5, 0x0e, 0xdb,
|
||||||
|
0xae, 0xa7, 0xec, 0x15, 0xaf, 0xe2, 0x16, 0x6d, 0xae, 0xb4, 0xfb, 0x35,
|
||||||
|
0x9d, 0xf0, 0x7d, 0x5d, 0x73, 0xc7, 0xc2, 0x3a, 0x0e, 0x59, 0xe9, 0x55,
|
||||||
|
0x90, 0xdc, 0x91, 0x0f, 0xb9, 0xf6, 0x68, 0xaf, 0x70, 0x0a, 0x5f, 0x1c,
|
||||||
|
0xa2, 0x01, 0x3f, 0xf2, 0x7c, 0x9f, 0x1a, 0x33, 0x40, 0xdd, 0x2d, 0xe3,
|
||||||
|
0x5b, 0x86, 0xb1, 0x23, 0x5b, 0x33, 0x74, 0xd5, 0x12, 0xbd, 0x91, 0xd7,
|
||||||
|
0x03, 0x73, 0x40, 0x94, 0x7d, 0x10, 0x28, 0xb1, 0x4e, 0x3b, 0xeb, 0x55,
|
||||||
|
0xf4, 0x02, 0xed, 0x0d, 0xf1, 0x12, 0x8d, 0x81, 0xa2, 0x61, 0x10, 0x7c,
|
||||||
|
0x9d, 0x66, 0xb9, 0xbb, 0x81, 0x98, 0x86, 0xbf, 0xac, 0x39, 0x87, 0x32,
|
||||||
|
0x6f, 0xe5, 0xe5, 0xb2, 0x70, 0x8b, 0xb4, 0x3f, 0x8d, 0x36, 0xb0, 0x4e,
|
||||||
|
0x54, 0x1d, 0x2f, 0x72, 0x6c, 0x96, 0x84, 0xaa, 0x8e, 0x12, 0x43, 0x4f,
|
||||||
|
0xb2, 0x1e, 0x4a, 0x98, 0xb8, 0xf2, 0xb2, 0xd5, 0xd5, 0xed, 0x25, 0x78,
|
||||||
|
0xa3, 0x61, 0xa2, 0x69, 0x38, 0xa0, 0xa9, 0x1b, 0x1b, 0x5a, 0x47, 0x02,
|
||||||
|
0xd4, 0x06, 0x84, 0x5e, 0x59, 0x6c, 0xca, 0x40, 0x05, 0xe1, 0x6d, 0x75,
|
||||||
|
0x9b, 0x58, 0x19, 0x44, 0x3b, 0xd9, 0x49, 0xb8, 0x99, 0x7c, 0xe0, 0x39,
|
||||||
|
0x15, 0x25, 0x22, 0xcb, 0x66, 0xc7, 0xe3, 0x94, 0x5a, 0xf2, 0xff, 0xd6,
|
||||||
|
0x3e, 0xbc, 0x4c, 0xe4, 0x7f, 0x5d, 0x47, 0x14, 0xeb, 0xe2, 0xcb, 0x3d,
|
||||||
|
0xe5, 0x5f, 0xf4, 0x2e, 0xb5, 0xd7, 0xc5, 0x59, 0x5f, 0x16, 0x4b, 0xf4,
|
||||||
|
0x72, 0xed, 0x81, 0x50, 0x4b, 0xbe, 0xb7, 0x21, 0xc3, 0xe5, 0xbc, 0x94,
|
||||||
|
0x7c, 0xc5, 0x6d, 0x55, 0xf3, 0x94, 0xa1, 0x14, 0x84, 0x1f, 0xb9, 0xa1,
|
||||||
|
0x2b, 0x11, 0x43, 0xf4, 0x1b, 0x86, 0x7e, 0x9a, 0xc0, 0xf4, 0x65, 0x43,
|
||||||
|
0xe7, 0x3b, 0xc4, 0xa5, 0x88, 0x32, 0xa2, 0x2d, 0x67, 0xb6, 0xc1, 0x9e,
|
||||||
|
0x86, 0xea, 0x77, 0xe9, 0x6c, 0x0d, 0x85, 0x6d, 0x48, 0xd2, 0x69, 0x45,
|
||||||
|
0x00, 0x9c, 0xc6, 0x99, 0x50, 0x36, 0x82, 0xd1, 0xc8, 0x98, 0x95, 0xd1,
|
||||||
|
0x8c, 0x18, 0xc9, 0xfe, 0xda, 0x45, 0x53, 0x8e, 0x1c, 0xc4, 0x32, 0x3f,
|
||||||
|
0xa2, 0x39, 0xd1, 0xb2, 0x85, 0x56, 0xa2, 0xbb, 0x30, 0x72, 0xdb, 0x88,
|
||||||
|
0x27, 0xda, 0xb6, 0x60, 0x8e, 0x6c, 0xa1, 0x9d, 0xc8, 0x16, 0xac, 0x83,
|
||||||
|
0xba, 0x8e, 0x48, 0x77, 0xac, 0x91, 0xae, 0x33, 0xd2, 0x75, 0x35, 0xd2,
|
||||||
|
0x1d, 0x8f, 0x74, 0x89, 0xfd, 0xba, 0x30, 0xee, 0x2e, 0xba, 0x73, 0xda,
|
||||||
|
0x68, 0x1b, 0x3d, 0x0b, 0xa3, 0x5b, 0x38, 0xf1, 0x03, 0x4c, 0x22, 0xaf,
|
||||||
|
0x3d, 0xc6, 0xd0, 0x2e, 0x7a, 0x73, 0x2f, 0xcc, 0xfb, 0x0e, 0xb8, 0xde,
|
||||||
|
0xc6, 0xc9, 0x9f, 0x08, 0xd4, 0xbf, 0x83, 0xd7, 0xb5, 0xcf, 0x1d, 0xbc,
|
||||||
|
0xf1, 0x18, 0x1d, 0x1a, 0x9e, 0x18, 0xd0, 0xaa, 0x5d, 0x0c, 0x92, 0xd1,
|
||||||
|
0x9b, 0x3b, 0xb0, 0x75, 0x79, 0x62, 0x61, 0x79, 0xa6, 0xd1, 0x19, 0x16,
|
||||||
|
0xa6, 0x8d, 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, 0x00, 0x00,
|
||||||
|
0x35, 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, 0x4a, 0x61, 0x72, 0x4c, 0x6f, 0x61,
|
||||||
|
0x64, 0x65, 0x72, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x95, 0x57, 0x7b,
|
||||||
|
0x74, 0x14, 0x57, 0x19, 0xff, 0xdd, 0x49, 0xb2, 0x33, 0xbb, 0x99, 0x64,
|
||||||
|
0xc9, 0x92, 0x00, 0x0b, 0x81, 0x4e, 0x79, 0x26, 0x21, 0xc9, 0xd2, 0x00,
|
||||||
|
0x11, 0x36, 0x84, 0x57, 0x1e, 0x10, 0x5c, 0x02, 0x92, 0x94, 0x98, 0xc6,
|
||||||
|
0xb4, 0x4e, 0x76, 0x27, 0xc9, 0x84, 0xcd, 0xce, 0x3a, 0x3b, 0x0b, 0x04,
|
||||||
|
0xb5, 0xbe, 0x10, 0x45, 0xb4, 0x56, 0xeb, 0x0b, 0x7c, 0xd7, 0x47, 0x94,
|
||||||
|
0xd6, 0xb6, 0xa0, 0x6e, 0x80, 0x58, 0x90, 0x5a, 0xa3, 0xd6, 0xea, 0x5f,
|
||||||
|
0x1e, 0xff, 0xf0, 0x1c, 0x3d, 0xc7, 0x73, 0x3c, 0xfe, 0xed, 0x3f, 0xb6,
|
||||||
|
0xd2, 0xc3, 0xa1, 0x7e, 0x77, 0x66, 0x93, 0xcc, 0x26, 0xd9, 0xa4, 0xe5,
|
||||||
|
0x84, 0x7b, 0xef, 0x7c, 0xdf, 0xef, 0x7b, 0xdf, 0xfb, 0xdd, 0xbb, 0xaf,
|
||||||
|
0x3d, 0xb8, 0x75, 0x1b, 0xc0, 0x0e, 0xfc, 0xc9, 0x87, 0x5d, 0x18, 0xf1,
|
||||||
|
0xe2, 0x14, 0xe2, 0x22, 0x46, 0x7d, 0x28, 0xc0, 0x88, 0x84, 0x04, 0x9f,
|
||||||
|
0x0d, 0x3e, 0x24, 0x7d, 0xf8, 0x10, 0x4c, 0x11, 0x29, 0x1f, 0xbc, 0xb0,
|
||||||
|
0x24, 0xa4, 0xf9, 0x7c, 0x5a, 0xc2, 0x19, 0x09, 0x67, 0x25, 0x8c, 0x49,
|
||||||
|
0x38, 0x27, 0xe1, 0xc3, 0x12, 0x3e, 0x22, 0xe1, 0xa3, 0x22, 0x9e, 0xf4,
|
||||||
|
0xa1, 0x1c, 0x16, 0x1f, 0x3e, 0xc6, 0x87, 0x8f, 0xf3, 0xe1, 0x13, 0x12,
|
||||||
|
0x3e, 0xc9, 0xe7, 0x4f, 0xf1, 0xe1, 0xbc, 0x0f, 0x9f, 0xc6, 0x05, 0x09,
|
||||||
|
0x9f, 0xe1, 0xf3, 0x67, 0x39, 0xe5, 0xa2, 0x84, 0xcf, 0xf9, 0x70, 0x09,
|
||||||
|
0x9f, 0x97, 0xf0, 0x05, 0x09, 0x4f, 0x89, 0xf8, 0xa2, 0x84, 0xa7, 0x7d,
|
||||||
|
0xd8, 0x88, 0x2f, 0x49, 0xf8, 0x32, 0x77, 0xe0, 0x19, 0x09, 0x5f, 0x91,
|
||||||
|
0xf0, 0x55, 0x09, 0x5f, 0x93, 0xf0, 0x75, 0x11, 0xdf, 0x90, 0x70, 0xd9,
|
||||||
|
0x87, 0x3a, 0xee, 0xca, 0x15, 0x09, 0xdf, 0xf4, 0x51, 0x04, 0xdf, 0x92,
|
||||||
|
0xf0, 0x6d, 0x11, 0xdf, 0xe1, 0xcb, 0xef, 0x4a, 0xf8, 0x9e, 0x84, 0xef,
|
||||||
|
0x8b, 0x78, 0xd6, 0x87, 0x1f, 0xe0, 0x87, 0x12, 0x7e, 0x24, 0xe1, 0xc7,
|
||||||
|
0x12, 0xc6, 0xb9, 0xc4, 0x4f, 0x44, 0xfc, 0x94, 0xc1, 0xb3, 0x47, 0x4f,
|
||||||
|
0xe8, 0xd6, 0x5e, 0x86, 0x82, 0xaa, 0xea, 0x93, 0x0c, 0x85, 0x2d, 0x46,
|
||||||
|
0x4c, 0x63, 0xf0, 0x47, 0xf4, 0x84, 0xd6, 0x99, 0x1e, 0x1d, 0xd0, 0xcc,
|
||||||
|
0x6e, 0x75, 0x20, 0x4e, 0x94, 0x40, 0xc4, 0x88, 0xaa, 0xf1, 0x93, 0xaa,
|
||||||
|
0xa9, 0xf3, 0xef, 0x2c, 0xb1, 0xd0, 0x1a, 0xd6, 0x53, 0x0c, 0x8f, 0x44,
|
||||||
|
0xa2, 0x89, 0xd0, 0x59, 0x5d, 0x35, 0xce, 0x0d, 0x1b, 0xe9, 0x86, 0xed,
|
||||||
|
0xdb, 0x43, 0x23, 0x69, 0x3d, 0xaa, 0xa9, 0x43, 0x5a, 0xc2, 0x0a, 0xa9,
|
||||||
|
0x49, 0x3d, 0x34, 0x6a, 0xc4, 0xd2, 0x71, 0x2d, 0x15, 0x3a, 0xa2, 0x9a,
|
||||||
|
0x11, 0x43, 0x8d, 0x69, 0x66, 0x13, 0x83, 0x18, 0xa7, 0x15, 0x11, 0x18,
|
||||||
|
0x2a, 0xaa, 0x22, 0x23, 0xea, 0x69, 0x35, 0x14, 0x57, 0x13, 0x43, 0xa1,
|
||||||
|
0x2e, 0xcb, 0xd4, 0x13, 0x43, 0x4d, 0xdc, 0x15, 0x69, 0x50, 0x8f, 0x6b,
|
||||||
|
0x9d, 0xea, 0xa8, 0x6d, 0x7c, 0x1e, 0x22, 0xcb, 0x3f, 0xae, 0x5a, 0xc3,
|
||||||
|
0x0c, 0x8c, 0x30, 0x15, 0x2e, 0x4c, 0xdb, 0xd9, 0xa8, 0x96, 0xb4, 0x74,
|
||||||
|
0x23, 0x41, 0xb0, 0x42, 0x0e, 0x63, 0x28, 0x75, 0xd8, 0xba, 0x11, 0x6a,
|
||||||
|
0xa7, 0x6f, 0xee, 0x40, 0x2a, 0x1d, 0x8d, 0x6a, 0x29, 0x72, 0x9f, 0x75,
|
||||||
|
0x50, 0x1a, 0x06, 0x55, 0x22, 0xc7, 0x18, 0xbc, 0x31, 0xdd, 0xd4, 0xa2,
|
||||||
|
0x96, 0x61, 0x8e, 0x31, 0x14, 0x71, 0x51, 0x02, 0xf8, 0xfb, 0xe6, 0x0a,
|
||||||
|
0x17, 0x5b, 0xaa, 0x39, 0xa4, 0x59, 0x2d, 0x71, 0x95, 0x2b, 0x28, 0x73,
|
||||||
|
0x99, 0xb6, 0x49, 0x84, 0x90, 0x1d, 0xc4, 0x51, 0xcd, 0x1a, 0x36, 0x48,
|
||||||
|
0xed, 0x6a, 0x17, 0xc4, 0xd4, 0x06, 0xe3, 0x64, 0x22, 0xe4, 0xf0, 0x08,
|
||||||
|
0xeb, 0x49, 0xaa, 0xa6, 0x3a, 0x4a, 0x8a, 0xe4, 0x98, 0x96, 0xd2, 0x28,
|
||||||
|
0xc3, 0x71, 0xfd, 0x9c, 0x46, 0x99, 0x69, 0x58, 0x22, 0xaf, 0x69, 0x4b,
|
||||||
|
0x8f, 0xa7, 0x42, 0xad, 0x2e, 0x19, 0x1e, 0xd7, 0x88, 0x6a, 0x3a, 0x59,
|
||||||
|
0xf1, 0x11, 0xce, 0x1c, 0xcb, 0xfa, 0x58, 0x6c, 0x7f, 0x4c, 0xbb, 0x23,
|
||||||
|
0xeb, 0x89, 0x11, 0x72, 0x81, 0x32, 0xd4, 0xaa, 0x93, 0xa1, 0x15, 0xb9,
|
||||||
|
0xc5, 0x1d, 0x4b, 0x4e, 0x17, 0xb8, 0x7c, 0x6e, 0x64, 0x7b, 0x6a, 0xf6,
|
||||||
|
0x92, 0x8d, 0x92, 0x2e, 0x4b, 0x8d, 0x9e, 0x3a, 0xaa, 0x26, 0x6d, 0x98,
|
||||||
|
0x88, 0xab, 0x74, 0x1e, 0x68, 0xb7, 0x8b, 0xe8, 0xa6, 0xfd, 0x4a, 0x86,
|
||||||
|
0xbb, 0x8c, 0xb4, 0x19, 0xd5, 0xda, 0x9d, 0xc4, 0xcf, 0x54, 0xbd, 0x9e,
|
||||||
|
0xeb, 0x92, 0xb1, 0x0f, 0xfb, 0x45, 0x3c, 0x27, 0xe3, 0x79, 0xfc, 0x8c,
|
||||||
|
0x61, 0xe5, 0xdc, 0xc2, 0x1e, 0x4c, 0xeb, 0xf1, 0x18, 0x0f, 0x7e, 0x43,
|
||||||
|
0xdf, 0x11, 0x1e, 0xed, 0x01, 0x1e, 0xad, 0x32, 0xa3, 0xa3, 0x5f, 0x39,
|
||||||
|
0x64, 0x58, 0x8a, 0x93, 0xaf, 0xb0, 0x22, 0xe3, 0x05, 0xbc, 0x28, 0xe3,
|
||||||
|
0x25, 0x5c, 0x13, 0x71, 0x5d, 0xc6, 0xcf, 0x71, 0x88, 0x61, 0xdb, 0xbb,
|
||||||
|
0xcd, 0x19, 0xf7, 0x88, 0xe4, 0xc4, 0x23, 0x4e, 0xde, 0x64, 0xfc, 0x02,
|
||||||
|
0xbf, 0xa4, 0x18, 0xda, 0xdc, 0xc9, 0x6b, 0xcb, 0x49, 0x5e, 0x47, 0x4e,
|
||||||
|
0xf2, 0x94, 0x3c, 0x8e, 0x66, 0xf5, 0x85, 0x95, 0xfc, 0xb1, 0xcc, 0xda,
|
||||||
|
0xe0, 0xa8, 0x8d, 0x8b, 0xa1, 0x1c, 0xe3, 0x1c, 0xb6, 0x29, 0x0f, 0xcc,
|
||||||
|
0xed, 0x15, 0xc7, 0xc9, 0xee, 0x3d, 0x2b, 0x23, 0x83, 0x09, 0x19, 0x37,
|
||||||
|
0x70, 0x53, 0xc6, 0x2d, 0xdc, 0x64, 0x68, 0xcc, 0xa3, 0xa5, 0x2b, 0xaa,
|
||||||
|
0x26, 0x12, 0x54, 0x07, 0x65, 0x66, 0x87, 0x28, 0x33, 0x27, 0xa2, 0xbe,
|
||||||
|
0xbe, 0x5e, 0xc6, 0x24, 0x57, 0xf1, 0x2b, 0x9e, 0xf1, 0xab, 0x32, 0x5e,
|
||||||
|
0xc6, 0x35, 0x3a, 0x61, 0x54, 0x58, 0xca, 0xe2, 0x6d, 0xdc, 0x91, 0xf1,
|
||||||
|
0x6b, 0x4e, 0xa8, 0xcd, 0xa3, 0xbb, 0xdd, 0x48, 0x27, 0x62, 0x2e, 0xc5,
|
||||||
|
0x24, 0x16, 0x56, 0x44, 0xdc, 0x95, 0xf1, 0x0a, 0xee, 0x30, 0xd4, 0xe5,
|
||||||
|
0x11, 0xb3, 0xe7, 0x79, 0x72, 0x0c, 0x3b, 0xf3, 0x99, 0xb1, 0x8f, 0xb2,
|
||||||
|
0x62, 0x19, 0x0a, 0xef, 0x31, 0xf3, 0xe5, 0x96, 0x2f, 0xd0, 0x28, 0x18,
|
||||||
|
0x76, 0xe4, 0xcb, 0xbe, 0x69, 0x1a, 0xa6, 0xad, 0x29, 0x37, 0x2b, 0xb6,
|
||||||
|
0x32, 0x19, 0xbf, 0xc1, 0x7e, 0x86, 0xed, 0x4b, 0x95, 0x44, 0x19, 0xa4,
|
||||||
|
0x2e, 0x9b, 0x1a, 0xd6, 0x62, 0xf5, 0x4a, 0x97, 0xd3, 0x76, 0x9a, 0xf9,
|
||||||
|
0xde, 0x7d, 0x95, 0xfa, 0x4d, 0x6d, 0xd6, 0xdf, 0x66, 0x86, 0x7d, 0x4b,
|
||||||
|
0xaa, 0x99, 0x29, 0x85, 0x92, 0xa0, 0x63, 0x30, 0x68, 0xe7, 0x93, 0xbc,
|
||||||
|
0xd3, 0x46, 0x93, 0xd6, 0x18, 0x0f, 0xad, 0xf5, 0x1d, 0xec, 0x0d, 0x45,
|
||||||
|
0x4f, 0x29, 0x89, 0x74, 0x3c, 0x5e, 0xab, 0xa4, 0x4e, 0xe9, 0x49, 0x57,
|
||||||
|
0x44, 0xd9, 0x18, 0xeb, 0x19, 0x6a, 0x16, 0xa9, 0x04, 0xcf, 0x82, 0xdd,
|
||||||
|
0x4b, 0xa6, 0xd3, 0xb9, 0x7a, 0x36, 0x9d, 0x27, 0xd2, 0x09, 0x4b, 0x1f,
|
||||||
|
0xd5, 0x5c, 0x59, 0x2d, 0x9f, 0x53, 0x8c, 0x25, 0x4a, 0xd7, 0x36, 0xad,
|
||||||
|
0xd8, 0x46, 0x93, 0x5c, 0xb6, 0x49, 0x0f, 0x92, 0xbf, 0x63, 0xe4, 0x58,
|
||||||
|
0x55, 0x1e, 0xb9, 0x13, 0x5a, 0xca, 0x88, 0x9f, 0xe6, 0xae, 0x45, 0x9d,
|
||||||
|
0xd3, 0x24, 0xe3, 0xb7, 0x98, 0x62, 0xa8, 0x5e, 0x12, 0x3f, 0x3a, 0x73,
|
||||||
|
0xae, 0xfc, 0x73, 0x5a, 0x9d, 0x8c, 0xdf, 0xe1, 0xf7, 0xf9, 0x4d, 0x76,
|
||||||
|
0x24, 0x4e, 0x1b, 0xa7, 0x72, 0x35, 0x30, 0xf2, 0x70, 0xd9, 0xac, 0x96,
|
||||||
|
0x63, 0x03, 0x3c, 0xb3, 0x22, 0xfe, 0x20, 0xe3, 0x35, 0xfc, 0x91, 0x61,
|
||||||
|
0xf7, 0xa2, 0x41, 0x3b, 0x6a, 0xa8, 0x1c, 0xa4, 0x76, 0x7e, 0xe0, 0x4b,
|
||||||
|
0xef, 0x75, 0x47, 0x30, 0x5b, 0x1a, 0x47, 0x19, 0xc9, 0x05, 0xe6, 0x02,
|
||||||
|
0x78, 0x6a, 0xf6, 0xe1, 0x75, 0x86, 0xd0, 0xbb, 0xbc, 0xb3, 0x73, 0x42,
|
||||||
|
0x73, 0x7a, 0x75, 0x2e, 0x69, 0x2c, 0x65, 0x69, 0xa3, 0xf4, 0x8e, 0x30,
|
||||||
|
0xd2, 0xd6, 0xcc, 0x6d, 0x4c, 0xdd, 0xe7, 0x38, 0x21, 0x2d, 0xc2, 0x6b,
|
||||||
|
0xea, 0x28, 0xbf, 0xea, 0xd4, 0x64, 0x52, 0x4b, 0x50, 0x13, 0xad, 0x5b,
|
||||||
|
0xe8, 0xd6, 0x9f, 0x47, 0xca, 0xde, 0x06, 0xfc, 0xb6, 0xb7, 0x8c, 0x69,
|
||||||
|
0xa3, 0xe5, 0x55, 0xf3, 0x81, 0x4d, 0xd3, 0xc7, 0x3a, 0xd7, 0x22, 0xb5,
|
||||||
|
0xf5, 0x24, 0xff, 0x8a, 0xd3, 0x56, 0x2c, 0xa0, 0xeb, 0x98, 0x61, 0xd7,
|
||||||
|
0x02, 0x76, 0xdf, 0x89, 0x27, 0x64, 0xc0, 0x1b, 0xd7, 0x53, 0x56, 0xbb,
|
||||||
|
0xf3, 0x24, 0x28, 0xab, 0xaa, 0x9e, 0xf7, 0x28, 0xf0, 0x68, 0x67, 0x09,
|
||||||
|
0x90, 0xb2, 0x9f, 0x52, 0x8f, 0xd1, 0xa5, 0xa1, 0xa7, 0x5a, 0x67, 0xdf,
|
||||||
|
0x12, 0x1e, 0x3d, 0xe5, 0xdc, 0x87, 0x22, 0xb9, 0xe1, 0xbc, 0x6a, 0x8a,
|
||||||
|
0x2d, 0x23, 0x62, 0x9c, 0xd1, 0xcc, 0x16, 0x35, 0x45, 0x5f, 0x12, 0xa5,
|
||||||
|
0x25, 0xd5, 0xa3, 0xf3, 0x8b, 0x7b, 0xc1, 0x17, 0x11, 0x69, 0xf4, 0x93,
|
||||||
|
0xe8, 0x81, 0x01, 0xda, 0xb9, 0x69, 0x2b, 0xfb, 0xf0, 0xa9, 0x5a, 0xbc,
|
||||||
|
0x88, 0xb3, 0x7b, 0x86, 0xa1, 0x52, 0x8d, 0xc5, 0xba, 0x0d, 0xa7, 0x4a,
|
||||||
|
0xf6, 0xfe, 0x76, 0xca, 0xda, 0xa5, 0xa9, 0x66, 0x94, 0x34, 0xf9, 0x93,
|
||||||
|
0x4e, 0xd6, 0xe8, 0x5e, 0xef, 0x36, 0xd5, 0x28, 0x39, 0x54, 0x59, 0xd5,
|
||||||
|
0xb1, 0x58, 0x41, 0xc4, 0x41, 0xc3, 0x74, 0xe2, 0xd8, 0xb4, 0x44, 0x29,
|
||||||
|
0xa7, 0x9f, 0x44, 0x5e, 0xd7, 0x7b, 0x68, 0xff, 0x02, 0x32, 0x7d, 0xf3,
|
||||||
|
0x64, 0xaa, 0x17, 0x7b, 0x35, 0xad, 0xca, 0xc7, 0xe3, 0xc9, 0xb6, 0xf7,
|
||||||
|
0x3a, 0x1d, 0x39, 0xb7, 0x19, 0xe7, 0x3c, 0xe6, 0x98, 0xc9, 0x92, 0xaa,
|
||||||
|
0xe7, 0x93, 0xa8, 0x09, 0x2e, 0xbe, 0x53, 0xba, 0x87, 0x4d, 0xe3, 0x0c,
|
||||||
|
0x7f, 0xfe, 0xd0, 0x63, 0x15, 0x0f, 0x63, 0x2f, 0xfd, 0x6a, 0xe0, 0xff,
|
||||||
|
0x04, 0x30, 0xfe, 0xc2, 0xa1, 0xf1, 0x00, 0x7d, 0x85, 0x68, 0x66, 0x34,
|
||||||
|
0x17, 0xd5, 0x4c, 0x80, 0x5d, 0xb3, 0xd9, 0x07, 0x69, 0xf4, 0xd8, 0x44,
|
||||||
|
0x2f, 0x5a, 0x68, 0x94, 0x1d, 0x00, 0x5a, 0xd1, 0x66, 0xd3, 0xda, 0x71,
|
||||||
|
0xc8, 0x11, 0x2e, 0x0a, 0xa1, 0x10, 0xcb, 0x48, 0xe4, 0x8d, 0xeb, 0x10,
|
||||||
|
0x26, 0x51, 0xd0, 0x3b, 0x81, 0xc2, 0x40, 0x51, 0x06, 0x9e, 0x1a, 0xfa,
|
||||||
|
0x9f, 0x81, 0x98, 0x81, 0x34, 0x09, 0x6f, 0x2f, 0x69, 0xf6, 0x45, 0xb6,
|
||||||
|
0x06, 0x8a, 0x59, 0x06, 0xf2, 0xd1, 0xad, 0x81, 0x12, 0x3e, 0x77, 0x6e,
|
||||||
|
0x0d, 0x94, 0xf2, 0x39, 0x5c, 0xb8, 0x35, 0xe0, 0xb7, 0x17, 0x45, 0x2e,
|
||||||
|
0x1d, 0xcb, 0x48, 0xbe, 0x76, 0x46, 0x87, 0x8b, 0x51, 0x46, 0xc4, 0xba,
|
||||||
|
0x85, 0x18, 0x01, 0x22, 0x06, 0x0b, 0x17, 0xe2, 0x2c, 0xe7, 0x9c, 0xa2,
|
||||||
|
0x19, 0x4e, 0xb0, 0x68, 0x8a, 0x75, 0x4e, 0xa2, 0xbc, 0x37, 0x58, 0x34,
|
||||||
|
0x81, 0x8a, 0xb0, 0x27, 0x48, 0xf4, 0x15, 0x61, 0x91, 0x4f, 0x2b, 0x2f,
|
||||||
|
0xb3, 0x95, 0x7c, 0x5e, 0x75, 0x99, 0xf9, 0x83, 0xe2, 0x14, 0xf3, 0x91,
|
||||||
|
0x96, 0x40, 0x90, 0x64, 0x0a, 0x1a, 0xe9, 0xcf, 0x1b, 0x14, 0xc3, 0xbe,
|
||||||
|
0xa0, 0xef, 0x76, 0x63, 0x71, 0x41, 0xa3, 0x5c, 0x21, 0x57, 0x14, 0x3f,
|
||||||
|
0x8b, 0x57, 0x82, 0xbe, 0x0a, 0xb9, 0x21, 0x5c, 0x12, 0x2c, 0xc9, 0x60,
|
||||||
|
0xf5, 0x15, 0x78, 0xc6, 0x71, 0x95, 0x2f, 0xd7, 0x64, 0x50, 0x19, 0x2e,
|
||||||
|
0x0d, 0x96, 0x06, 0xd6, 0x66, 0xb0, 0xce, 0x26, 0x3f, 0xc3, 0xc9, 0x0f,
|
||||||
|
0x85, 0xfd, 0x2e, 0xb7, 0x14, 0xee, 0x96, 0x7f, 0xd6, 0x2d, 0xff, 0x0d,
|
||||||
|
0x3c, 0x7c, 0x19, 0x1b, 0xce, 0x4b, 0xcc, 0x05, 0x5a, 0x9f, 0x0b, 0x1a,
|
||||||
|
0x87, 0x72, 0xde, 0xeb, 0xe6, 0x6f, 0x98, 0xcb, 0xaf, 0x09, 0x97, 0xe6,
|
||||||
|
0x22, 0x36, 0x71, 0x04, 0x37, 0x3e, 0x6b, 0xa9, 0x34, 0x83, 0xcd, 0xe7,
|
||||||
|
0x65, 0x36, 0xfe, 0x76, 0xb3, 0x0b, 0xb7, 0x85, 0xf8, 0x15, 0x52, 0x06,
|
||||||
|
0x55, 0x81, 0x6a, 0xbe, 0xf2, 0xd2, 0x6a, 0x5a, 0xe7, 0x5a, 0x17, 0xac,
|
||||||
|
0x26, 0x37, 0x99, 0xe3, 0x28, 0xe6, 0x39, 0xda, 0x9a, 0x9b, 0xf1, 0xda,
|
||||||
|
0x9c, 0xea, 0xd5, 0x52, 0x60, 0x57, 0xb0, 0x6e, 0x12, 0x75, 0xbd, 0xd3,
|
||||||
|
0x80, 0xfa, 0x59, 0xc0, 0x04, 0x42, 0x77, 0xb8, 0x8a, 0x6d, 0xb9, 0x2a,
|
||||||
|
0x1e, 0xc9, 0xa9, 0x73, 0xdd, 0x0d, 0x34, 0x84, 0x3d, 0x2e, 0xf6, 0xf6,
|
||||||
|
0xdc, 0x6a, 0x07, 0xe9, 0xa3, 0xe0, 0x65, 0xec, 0xc8, 0x60, 0x67, 0x58,
|
||||||
|
0x74, 0xc1, 0x1a, 0xb3, 0x5a, 0x02, 0xef, 0x99, 0x83, 0x17, 0x19, 0xc1,
|
||||||
|
0x77, 0x65, 0xb0, 0xbb, 0x87, 0xdb, 0x0e, 0xdb, 0x91, 0xec, 0xb0, 0x2d,
|
||||||
|
0x04, 0x9a, 0xec, 0x4d, 0x3b, 0xeb, 0xeb, 0x9e, 0x85, 0x74, 0x04, 0x3d,
|
||||||
|
0x13, 0x68, 0xbe, 0x73, 0x8d, 0x76, 0xff, 0x03, 0xe6, 0x61, 0x17, 0xb1,
|
||||||
|
0x91, 0x79, 0xd9, 0x5a, 0x7b, 0x56, 0xd8, 0x05, 0x3e, 0x0b, 0x6d, 0xc2,
|
||||||
|
0x5d, 0xe1, 0x55, 0xfa, 0x4d, 0x5c, 0x68, 0x9f, 0xa6, 0x7f, 0x63, 0xb7,
|
||||||
|
0x7d, 0x8e, 0x82, 0x28, 0xc5, 0x7a, 0x3a, 0x31, 0x35, 0x28, 0x43, 0x03,
|
||||||
|
0x02, 0x68, 0xc2, 0x72, 0x3a, 0x55, 0x15, 0xe8, 0xc7, 0x0a, 0x9c, 0xc6,
|
||||||
|
0x4a, 0x3c, 0x8d, 0x55, 0xb8, 0x8a, 0xd5, 0x78, 0x11, 0x6b, 0xe8, 0x0d,
|
||||||
|
0x5c, 0x89, 0xbb, 0x58, 0x87, 0xbf, 0xe2, 0x21, 0xfc, 0x83, 0x8e, 0xef,
|
||||||
|
0x3f, 0x49, 0xf2, 0x5f, 0xa4, 0xf1, 0x01, 0x36, 0x33, 0x0f, 0xb6, 0x30,
|
||||||
|
0x2f, 0x6a, 0xd8, 0x72, 0xd4, 0xb2, 0xb5, 0xa8, 0x63, 0x0a, 0xb6, 0xb1,
|
||||||
|
0x2d, 0x68, 0x60, 0x07, 0xb0, 0x83, 0x75, 0x60, 0x27, 0x8b, 0xa0, 0x91,
|
||||||
|
0xe9, 0xd8, 0xc5, 0xe2, 0xd8, 0xcd, 0x2e, 0xd0, 0xf3, 0xef, 0x22, 0xf6,
|
||||||
|
0xb0, 0x4b, 0x68, 0x66, 0x4f, 0x61, 0x2f, 0x7b, 0x0e, 0xfb, 0xd8, 0x4b,
|
||||||
|
0xe4, 0x69, 0x06, 0x2d, 0xec, 0x6f, 0x68, 0x63, 0x7f, 0x47, 0x3b, 0x7b,
|
||||||
|
0x13, 0x87, 0xd9, 0x5b, 0xe8, 0x10, 0x04, 0x44, 0x84, 0x35, 0xe8, 0x14,
|
||||||
|
0xd6, 0xe3, 0x98, 0xd0, 0x8c, 0x13, 0x42, 0x1b, 0x1e, 0x15, 0x1e, 0x47,
|
||||||
|
0x8f, 0x10, 0x43, 0xaf, 0xf0, 0x24, 0xfa, 0x84, 0x4b, 0xe8, 0x17, 0x5e,
|
||||||
|
0xc0, 0x13, 0xc2, 0x4d, 0xa8, 0xc2, 0x5d, 0xe8, 0x14, 0x61, 0x54, 0x98,
|
||||||
|
0x42, 0x4c, 0xf8, 0x33, 0x34, 0xe1, 0xbf, 0x18, 0xb1, 0xbb, 0xc5, 0xf3,
|
||||||
|
0x28, 0x23, 0xbf, 0x52, 0x38, 0x8c, 0x0e, 0x94, 0x92, 0x57, 0x4f, 0xe0,
|
||||||
|
0x08, 0xad, 0xfc, 0x64, 0x7f, 0x13, 0xde, 0x8b, 0x08, 0x65, 0xe0, 0x01,
|
||||||
|
0xae, 0xe3, 0x28, 0x3a, 0x51, 0x42, 0x31, 0xdd, 0xc3, 0x31, 0x1c, 0x87,
|
||||||
|
0x44, 0x91, 0xbd, 0x81, 0xf7, 0xd1, 0xca, 0x8b, 0x5b, 0x8c, 0x2c, 0x13,
|
||||||
|
0xd7, 0x83, 0xbb, 0xac, 0x11, 0x5d, 0xe8, 0x86, 0x48, 0xf6, 0xfb, 0xf1,
|
||||||
|
0x28, 0x4e, 0xc2, 0x43, 0x1e, 0x34, 0xa2, 0x07, 0xef, 0x27, 0xda, 0x14,
|
||||||
|
0xb5, 0x2e, 0xae, 0xcf, 0xc3, 0xfb, 0x0f, 0x7a, 0xc9, 0x06, 0xb0, 0x5e,
|
||||||
|
0xf8, 0x0b, 0x1e, 0x43, 0x1f, 0x75, 0xa7, 0x1a, 0xe1, 0x75, 0x7c, 0x80,
|
||||||
|
0x68, 0x02, 0x1a, 0xc8, 0xcb, 0x7e, 0x5a, 0x15, 0xa0, 0x89, 0x36, 0xc6,
|
||||||
|
0xe3, 0xb4, 0x2a, 0x44, 0xab, 0x70, 0x9d, 0xfc, 0xea, 0xa0, 0x9e, 0xf6,
|
||||||
|
0x41, 0xa7, 0xbf, 0x65, 0x2d, 0xa8, 0xa4, 0x6d, 0x80, 0x28, 0x3d, 0xf0,
|
||||||
|
0xbf, 0x8d, 0xff, 0xa0, 0x44, 0x44, 0x54, 0x44, 0xcc, 0x1e, 0x67, 0xfe,
|
||||||
|
0xe8, 0xc7, 0xe4, 0x20, 0x63, 0xf6, 0x00, 0xdc, 0xc7, 0x2a, 0xa2, 0xdc,
|
||||||
|
0xc7, 0x0a, 0x62, 0xdd, 0xc7, 0x61, 0x1a, 0xef, 0xa1, 0xf2, 0xa0, 0x88,
|
||||||
|
0xa1, 0xb7, 0xb0, 0xf9, 0x7f, 0x28, 0xba, 0x87, 0xcd, 0xf7, 0x10, 0x14,
|
||||||
|
0xc4, 0xf0, 0x9b, 0xb8, 0x40, 0xc4, 0x6d, 0xe4, 0xd8, 0xb0, 0xdd, 0x62,
|
||||||
|
0xf5, 0xff, 0x03, 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, 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, 0xd4, 0x6d, 0x6a, 0x5e, 0x6d, 0x30, 0x6e, 0xd2,
|
||||||
|
0x49, 0x3b, 0x9d, 0x29, 0xd3, 0xe9, 0xf4, 0x87, 0xce, 0xf4, 0x4f, 0x68,
|
||||||
|
0xfe, 0x88, 0x4e, 0x87, 0x69, 0x7a, 0xee, 0x95, 0x90, 0x1f, 0x5a, 0xb7,
|
||||||
|
0x30, 0x78, 0xaf, 0xbe, 0xfb, 0xdd, 0xef, 0x9e, 0x7b, 0xee, 0xf7, 0xda,
|
||||||
|
0xe5, 0xaf, 0xff, 0xf9, 0xf0, 0x63, 0x00, 0x0f, 0xe3, 0x43, 0x1d, 0x51,
|
||||||
|
0x64, 0x34, 0x3c, 0xab, 0xa3, 0x02, 0x99, 0x10, 0x3e, 0x8b, 0xac, 0x18,
|
||||||
|
0x72, 0x3a, 0x07, 0x57, 0x47, 0x1d, 0xf2, 0x1a, 0x66, 0x74, 0x04, 0x91,
|
||||||
|
0x11, 0x93, 0xe7, 0x84, 0x74, 0x52, 0x0c, 0x79, 0x31, 0x9c, 0x12, 0x9b,
|
||||||
|
0x4e, 0x0b, 0xe9, 0x79, 0x21, 0xbd, 0x20, 0x86, 0x17, 0x35, 0x9c, 0x11,
|
||||||
|
0xa6, 0x2f, 0x09, 0x84, 0x97, 0x75, 0xbc, 0x82, 0x57, 0x35, 0x7c, 0x45,
|
||||||
|
0x68, 0xce, 0xea, 0xf8, 0x2a, 0xbe, 0x26, 0xa4, 0xaf, 0xeb, 0xf8, 0x06,
|
||||||
|
0xce, 0x09, 0xe9, 0x35, 0x1d, 0xdf, 0xc4, 0xb7, 0x84, 0xf4, 0xba, 0x18,
|
||||||
|
0xbe, 0x1d, 0xc4, 0x77, 0xc4, 0xef, 0x1b, 0x41, 0xbc, 0x19, 0xc4, 0x5b,
|
||||||
|
0x41, 0x7c, 0x57, 0x40, 0xbe, 0x2d, 0x86, 0x77, 0xc4, 0xf0, 0x3d, 0x0d,
|
||||||
|
0xdf, 0xd7, 0xf0, 0x03, 0x05, 0x6a, 0xd2, 0x74, 0x4d, 0x05, 0x75, 0x83,
|
||||||
|
0x93, 0xe6, 0x8c, 0x19, 0x4f, 0x99, 0xce, 0x78, 0x7c, 0xd8, 0xcd, 0xda,
|
||||||
|
0xce, 0x78, 0xa7, 0x02, 0xdf, 0xb4, 0x99, 0x51, 0xb0, 0xae, 0xb0, 0x94,
|
||||||
|
0x77, 0xed, 0x54, 0xfc, 0x71, 0x33, 0x37, 0x71, 0xd0, 0xcc, 0x70, 0x2d,
|
||||||
|
0x34, 0x6c, 0x8f, 0x3b, 0xa6, 0x9b, 0xcf, 0x5a, 0x0a, 0x1e, 0x2d, 0xb7,
|
||||||
|
0xd8, 0x53, 0x8e, 0x57, 0xae, 0xe9, 0x22, 0x4e, 0x60, 0x8f, 0xed, 0xd8,
|
||||||
|
0x6e, 0x97, 0x82, 0x48, 0xb4, 0xdc, 0xa0, 0xf9, 0x08, 0x09, 0xf6, 0xa4,
|
||||||
|
0x93, 0x3c, 0xa3, 0x66, 0xd0, 0x76, 0xac, 0xa1, 0xfc, 0xf4, 0xa8, 0x95,
|
||||||
|
0x7d, 0xd2, 0x1c, 0x4d, 0x59, 0x82, 0x72, 0x3a, 0x61, 0xa6, 0x8e, 0x98,
|
||||||
|
0x59, 0x5b, 0xcc, 0x8b, 0x4a, 0xd5, 0x9d, 0xb0, 0x73, 0x0a, 0x76, 0x0e,
|
||||||
|
0x26, 0x9c, 0xf8, 0x49, 0xdb, 0x4c, 0x9f, 0x9e, 0x48, 0xe7, 0x77, 0xee,
|
||||||
|
0xda, 0x15, 0x9f, 0xcc, 0xdb, 0x09, 0xcb, 0x1c, 0xb7, 0x1c, 0x37, 0x6e,
|
||||||
|
0x66, 0x6c, 0x49, 0x35, 0x17, 0xef, 0xb5, 0x72, 0x16, 0x77, 0xa7, 0xec,
|
||||||
|
0xd3, 0x56, 0x96, 0x54, 0xfc, 0x19, 0x33, 0x9b, 0x23, 0x86, 0x92, 0xe0,
|
||||||
|
0xd3, 0xc3, 0xb9, 0xed, 0x64, 0xf2, 0x2e, 0xdd, 0x30, 0x65, 0x9d, 0x52,
|
||||||
|
0xd0, 0x50, 0x46, 0xaf, 0x3b, 0x6f, 0xa7, 0x92, 0x85, 0x9d, 0x33, 0x66,
|
||||||
|
0x2a, 0xcf, 0x9d, 0x7a, 0xd6, 0x32, 0x93, 0x5c, 0x79, 0x42, 0x6c, 0x50,
|
||||||
|
0x46, 0x14, 0x68, 0x56, 0x2e, 0x61, 0x66, 0xac, 0x24, 0x4d, 0x12, 0x13,
|
||||||
|
0x44, 0x57, 0x50, 0xf1, 0x14, 0x91, 0xab, 0x86, 0x5d, 0x33, 0x31, 0x45,
|
||||||
|
0x37, 0x49, 0xd6, 0x32, 0x14, 0x67, 0x98, 0x1d, 0x1a, 0xf6, 0x29, 0xa8,
|
||||||
|
0x4c, 0x2e, 0xb1, 0x12, 0x5e, 0x69, 0xf6, 0x74, 0x7f, 0xa7, 0x97, 0xfe,
|
||||||
|
0x8e, 0x9d, 0xee, 0x9b, 0x30, 0x73, 0x6b, 0x78, 0x9c, 0xa4, 0x7d, 0xe3,
|
||||||
|
0x16, 0x6f, 0xbd, 0xdb, 0x63, 0xd5, 0xc3, 0xde, 0x33, 0x6f, 0x92, 0xd6,
|
||||||
|
0x18, 0x23, 0x4b, 0x98, 0x7e, 0x87, 0x48, 0xeb, 0x3d, 0x90, 0xfa, 0x9b,
|
||||||
|
0xfb, 0xe9, 0x21, 0x71, 0xc1, 0x65, 0x6b, 0xfb, 0x4f, 0x26, 0xac, 0x8c,
|
||||||
|
0x6b, 0xa7, 0x1d, 0x62, 0x28, 0xfd, 0x4c, 0x76, 0x3a, 0x90, 0x20, 0x83,
|
||||||
|
0x69, 0x67, 0xdc, 0x1b, 0x65, 0xa0, 0x79, 0x80, 0x96, 0x7c, 0x42, 0x34,
|
||||||
|
0xeb, 0x4d, 0xe7, 0x65, 0x0a, 0x78, 0x19, 0xf6, 0x36, 0xf7, 0xd2, 0x90,
|
||||||
|
0x4f, 0x90, 0x86, 0x7d, 0xa9, 0xb4, 0xb9, 0x06, 0xad, 0xbe, 0xe6, 0x3e,
|
||||||
|
0xda, 0xf1, 0xd1, 0x69, 0xd7, 0x9d, 0x4e, 0xa7, 0x2c, 0xd3, 0xf1, 0xb6,
|
||||||
|
0x1c, 0x11, 0x9e, 0x52, 0x73, 0x32, 0x48, 0xbe, 0xa8, 0xb8, 0x8d, 0x66,
|
||||||
|
0xe7, 0xf6, 0x4f, 0x67, 0xdc, 0x53, 0x72, 0x3e, 0x22, 0x22, 0xce, 0xdd,
|
||||||
|
0x59, 0x39, 0x63, 0x1a, 0xfb, 0xcd, 0xdc, 0x41, 0x51, 0x4d, 0xe1, 0x15,
|
||||||
|
0x81, 0x2b, 0x04, 0xb3, 0x7d, 0xb5, 0xee, 0x8e, 0x03, 0x29, 0xdc, 0xd3,
|
||||||
|
0x2b, 0x0b, 0xb8, 0x3e, 0xea, 0x19, 0x8a, 0x8d, 0x87, 0xf3, 0x8e, 0x6b,
|
||||||
|
0x4f, 0x5b, 0xfd, 0xce, 0x8c, 0x9d, 0xb3, 0xe9, 0x9f, 0x7d, 0x8e, 0x93,
|
||||||
|
0x76, 0x4d, 0xe1, 0xe4, 0x9c, 0x28, 0xa1, 0x54, 0x7a, 0x7a, 0x34, 0x3d,
|
||||||
|
0x15, 0x3f, 0x60, 0x39, 0x56, 0xd6, 0x74, 0xad, 0x64, 0x67, 0x21, 0x6e,
|
||||||
|
0x92, 0xaa, 0x3e, 0x9c, 0xce, 0x67, 0x13, 0x56, 0x9f, 0x2d, 0xbc, 0x1a,
|
||||||
|
0x5e, 0x5e, 0x2c, 0x0f, 0x8a, 0x93, 0x0c, 0xc4, 0x21, 0x16, 0xca, 0xd2,
|
||||||
|
0xd0, 0x40, 0x0b, 0xb6, 0x1b, 0x68, 0x46, 0xcc, 0x40, 0x1b, 0x76, 0x18,
|
||||||
|
0x98, 0x05, 0x09, 0xde, 0xb3, 0x46, 0xf9, 0x18, 0x38, 0x8f, 0x1f, 0x1a,
|
||||||
|
0xf8, 0x11, 0x7e, 0x6c, 0xe0, 0x27, 0x98, 0x34, 0xf0, 0x53, 0x5c, 0x30,
|
||||||
|
0xf0, 0x33, 0xbc, 0x6b, 0xe0, 0xe7, 0xb8, 0x68, 0x60, 0x10, 0xef, 0x29,
|
||||||
|
0xa8, 0x5d, 0xbd, 0xd9, 0xc0, 0x2f, 0x30, 0x27, 0x16, 0x0f, 0x6a, 0xf8,
|
||||||
|
0xa5, 0x81, 0x5f, 0xe1, 0x7d, 0x36, 0x2a, 0x8f, 0x4c, 0x12, 0x76, 0xbf,
|
||||||
|
0xd6, 0x30, 0x6f, 0xe0, 0x12, 0x2e, 0x8b, 0xc9, 0x15, 0x0d, 0x57, 0x0d,
|
||||||
|
0x5c, 0xc3, 0x6f, 0xc4, 0xe4, 0xb7, 0x1a, 0x3e, 0x30, 0x70, 0x1d, 0x0b,
|
||||||
|
0x62, 0x72, 0xc3, 0xc0, 0x22, 0x26, 0x45, 0x0b, 0xc9, 0xe6, 0x2d, 0x03,
|
||||||
|
0xbf, 0xc3, 0x45, 0xa6, 0xc2, 0x43, 0x8c, 0xdc, 0x98, 0x99, 0x92, 0x6d,
|
||||||
|
0x81, 0x37, 0x79, 0x06, 0xbc, 0xf6, 0x28, 0x12, 0x06, 0x92, 0xe2, 0xee,
|
||||||
|
0x3b, 0xee, 0xb6, 0xcb, 0xac, 0xb8, 0xc9, 0xa1, 0xd1, 0x49, 0x2b, 0xc1,
|
||||||
|
0x44, 0x0c, 0xa4, 0x2c, 0x67, 0xdc, 0x9d, 0x60, 0xe9, 0xbb, 0xe9, 0x1e,
|
||||||
|
0x76, 0x89, 0x7d, 0xd9, 0xac, 0xc9, 0x2c, 0x52, 0xa3, 0xcd, 0xa2, 0x57,
|
||||||
|
0x04, 0xcc, 0x4c, 0xc6, 0x72, 0xd8, 0x41, 0x1a, 0xa3, 0x3d, 0xe5, 0x21,
|
||||||
|
0x5e, 0xea, 0x41, 0x41, 0x37, 0x5d, 0x50, 0x31, 0xe3, 0x64, 0xdb, 0x5a,
|
||||||
|
0x51, 0xc0, 0x85, 0xb3, 0x3a, 0xcb, 0x35, 0xcd, 0xe5, 0x2a, 0x96, 0x53,
|
||||||
|
0x8e, 0x55, 0x57, 0x24, 0xa5, 0x46, 0xfb, 0x45, 0xfe, 0x56, 0x26, 0xd2,
|
||||||
|
0x8e, 0x6b, 0xda, 0x4e, 0x4e, 0xf6, 0xb6, 0x88, 0x07, 0xb6, 0xc8, 0xf9,
|
||||||
|
0x6d, 0x5e, 0x7a, 0xaf, 0x13, 0x34, 0xd9, 0x31, 0x0f, 0x8d, 0x09, 0xa8,
|
||||||
|
0x7e, 0xcf, 0xcc, 0x0d, 0x2f, 0xe9, 0xd8, 0x45, 0xac, 0x71, 0xe1, 0xbc,
|
||||||
|
0xa0, 0xec, 0xd0, 0xb2, 0xa9, 0x78, 0x36, 0xaf, 0x7e, 0xa1, 0x1f, 0xf0,
|
||||||
|
0x84, 0xab, 0x5e, 0xd2, 0x15, 0xfa, 0x49, 0x48, 0x62, 0x15, 0x64, 0x4f,
|
||||||
|
0xb0, 0x01, 0xa1, 0xef, 0xf5, 0x04, 0x5b, 0x16, 0xc4, 0xdb, 0x5d, 0xa7,
|
||||||
|
0x52, 0xc2, 0xdd, 0x9e, 0x79, 0x02, 0xf6, 0x0a, 0x7d, 0x9f, 0x27, 0x60,
|
||||||
|
0xcd, 0x92, 0xae, 0xd8, 0x9d, 0x74, 0x89, 0x57, 0x9c, 0x78, 0xc2, 0xf5,
|
||||||
|
0x09, 0xfd, 0x88, 0x27, 0x1c, 0x13, 0x69, 0x30, 0xfd, 0x9c, 0x95, 0xed,
|
||||||
|
0x31, 0x45, 0xe2, 0x06, 0xac, 0x67, 0xf3, 0x4c, 0x61, 0x6c, 0xe6, 0x77,
|
||||||
|
0x44, 0x94, 0xdf, 0x2a, 0x15, 0xfc, 0x2e, 0x60, 0x71, 0x52, 0xaa, 0x13,
|
||||||
|
0x95, 0x0a, 0x05, 0xad, 0x52, 0xfb, 0x20, 0x6a, 0x29, 0xc7, 0xb1, 0x83,
|
||||||
|
0xe3, 0x43, 0xd4, 0x9c, 0x80, 0x8f, 0x5a, 0x60, 0x43, 0xec, 0x06, 0x94,
|
||||||
|
0xd8, 0x47, 0xa8, 0x38, 0x76, 0x03, 0xbe, 0xeb, 0x50, 0x63, 0x2d, 0xd7,
|
||||||
|
0xe1, 0x8f, 0xb5, 0xdc, 0x40, 0xe0, 0x9a, 0xdc, 0xb7, 0x93, 0xe3, 0x7a,
|
||||||
|
0xf8, 0x39, 0x56, 0x43, 0x85, 0x81, 0x1a, 0xfe, 0xab, 0x27, 0x56, 0x03,
|
||||||
|
0xc2, 0xd8, 0x25, 0xd7, 0x24, 0x0a, 0xbf, 0x91, 0x1e, 0x01, 0xa4, 0x24,
|
||||||
|
0x4e, 0xe7, 0xab, 0x50, 0x74, 0x87, 0xc2, 0x59, 0x15, 0x61, 0x9e, 0x55,
|
||||||
|
0xc9, 0xb5, 0x4f, 0x5a, 0x6e, 0x42, 0x6f, 0x59, 0x80, 0x76, 0x1e, 0xea,
|
||||||
|
0xb5, 0x8f, 0x10, 0xe4, 0x91, 0xa1, 0x83, 0xc5, 0xdf, 0x21, 0xb5, 0x4d,
|
||||||
|
0xf5, 0xb5, 0xf9, 0xb9, 0xaa, 0x77, 0x04, 0x1a, 0x02, 0x1d, 0x5a, 0x83,
|
||||||
|
0xf6, 0x71, 0x5b, 0xd0, 0xd7, 0x16, 0x8a, 0x84, 0x22, 0xc1, 0x77, 0xf1,
|
||||||
|
0x76, 0x83, 0x16, 0x09, 0x3d, 0xdc, 0xa6, 0x47, 0xfc, 0xb3, 0x68, 0x8a,
|
||||||
|
0xa8, 0xb3, 0xa8, 0xda, 0x1e, 0xd1, 0x17, 0x50, 0x79, 0x74, 0x0e, 0x7a,
|
||||||
|
0x6b, 0x41, 0xe2, 0xee, 0x39, 0x8c, 0x45, 0xf4, 0xda, 0xa7, 0x2f, 0x20,
|
||||||
|
0xa4, 0x8a, 0xc9, 0x31, 0x61, 0x58, 0x4b, 0xcd, 0x5e, 0x6a, 0x7c, 0x6d,
|
||||||
|
0xea, 0x1c, 0x0e, 0x70, 0xd2, 0x79, 0x01, 0xb1, 0xed, 0x0b, 0x30, 0x66,
|
||||||
|
0xb1, 0x2e, 0xf6, 0x01, 0x54, 0x8a, 0x55, 0xad, 0x7c, 0x16, 0x50, 0x7d,
|
||||||
|
0x74, 0xbb, 0x6f, 0x01, 0x35, 0xad, 0x62, 0x50, 0x85, 0x75, 0x83, 0xf7,
|
||||||
|
0x41, 0x67, 0x43, 0xca, 0xdc, 0xa7, 0x53, 0x6b, 0x40, 0x08, 0xaf, 0xf9,
|
||||||
|
0xa4, 0xd7, 0x5e, 0xc3, 0x16, 0x8e, 0xf5, 0xbc, 0x79, 0x84, 0x7e, 0xbb,
|
||||||
|
0x97, 0x52, 0x03, 0x1a, 0xb1, 0x11, 0x4d, 0x1c, 0xb7, 0xe0, 0x7e, 0x46,
|
||||||
|
0x6b, 0x13, 0xba, 0x29, 0x1d, 0xc0, 0x03, 0x6c, 0x75, 0x5b, 0x71, 0x04,
|
||||||
|
0xdb, 0x70, 0x9c, 0xda, 0x67, 0xe8, 0xc1, 0x04, 0x23, 0x37, 0xc9, 0xc8,
|
||||||
|
0x4d, 0x33, 0x6e, 0x19, 0xfa, 0xf0, 0x05, 0x22, 0xbe, 0x44, 0x7f, 0xbf,
|
||||||
|
0x4a, 0xaf, 0x9e, 0x43, 0x3b, 0xde, 0xc0, 0x6e, 0x5c, 0x40, 0x27, 0xde,
|
||||||
|
0xc3, 0x1e, 0xbc, 0x8f, 0xbd, 0xec, 0x7f, 0x5d, 0xb8, 0x8a, 0x7d, 0xec,
|
||||||
|
0x76, 0xdd, 0xf8, 0x03, 0x7a, 0x71, 0x93, 0xd8, 0x7f, 0xc3, 0xe3, 0xf8,
|
||||||
|
0x07, 0xfa, 0xf1, 0x4f, 0x3c, 0x21, 0x23, 0x75, 0x98, 0x1f, 0xa0, 0xdd,
|
||||||
|
0x38, 0xcb, 0xdd, 0xbb, 0xa1, 0x8b, 0x68, 0x94, 0x62, 0xf6, 0x09, 0x1e,
|
||||||
|
0x95, 0x31, 0xab, 0xc7, 0xdf, 0xd1, 0x41, 0xd4, 0x0a, 0x32, 0xfc, 0x0b,
|
||||||
|
0x91, 0x3b, 0x79, 0x93, 0x26, 0xfc, 0x99, 0xf8, 0x5d, 0x8c, 0xfd, 0x16,
|
||||||
|
0xfc, 0x09, 0x9f, 0xa3, 0xe4, 0x27, 0xc7, 0xdf, 0xe3, 0x31, 0x9e, 0x16,
|
||||||
|
0x20, 0x1e, 0x88, 0x5d, 0x5d, 0x89, 0x4f, 0x99, 0x7e, 0xba, 0x86, 0x1e,
|
||||||
|
0x0d, 0xbd, 0x1a, 0xf6, 0xf3, 0x4f, 0x51, 0x34, 0xf4, 0xf1, 0x4f, 0x51,
|
||||||
|
0x80, 0x5b, 0xd8, 0xac, 0x04, 0xfc, 0x46, 0xf8, 0xbe, 0x9a, 0xea, 0x7f,
|
||||||
|
0x23, 0xf0, 0x2f, 0xf8, 0xd7, 0xf3, 0xb0, 0x03, 0xa4, 0x57, 0x21, 0x53,
|
||||||
|
0x31, 0xce, 0x19, 0xad, 0x98, 0x76, 0xf4, 0xe5, 0xd5, 0x52, 0xd6, 0x05,
|
||||||
|
0xa4, 0x72, 0x48, 0x72, 0x37, 0x0a, 0x06, 0x45, 0xc6, 0x85, 0x8c, 0xee,
|
||||||
|
0xa7, 0x6e, 0x80, 0x77, 0x2b, 0xe4, 0xf3, 0x5e, 0x6a, 0x44, 0x26, 0x86,
|
||||||
|
0x04, 0x08, 0xb3, 0xa8, 0x76, 0x7e, 0x15, 0xd0, 0xe1, 0x65, 0xe9, 0x1a,
|
||||||
|
0x2a, 0x5d, 0x3d, 0xc4, 0x0b, 0xc7, 0xe4, 0xf9, 0x7c, 0xdb, 0x14, 0xa1,
|
||||||
|
0x5c, 0xda, 0xa8, 0xc2, 0xb6, 0x08, 0x15, 0xfe, 0x23, 0xea, 0x86, 0x5a,
|
||||||
|
0x6f, 0x42, 0x6b, 0x9d, 0x63, 0xac, 0xaf, 0x96, 0x02, 0xac, 0x4b, 0xac,
|
||||||
|
0x23, 0x24, 0x77, 0x54, 0x62, 0xc7, 0x0a, 0xbb, 0x4a, 0xd8, 0xeb, 0x8b,
|
||||||
|
0xd8, 0x42, 0x1a, 0xa2, 0x54, 0x41, 0x4b, 0x9d, 0x6e, 0x8d, 0x71, 0x7f,
|
||||||
|
0xb7, 0xbc, 0x54, 0xc5, 0x2d, 0xd4, 0xd3, 0x63, 0x8f, 0xf1, 0xa1, 0xdd,
|
||||||
|
0x21, 0x7c, 0xbe, 0xc4, 0xc0, 0x27, 0xb1, 0x6a, 0x63, 0x2d, 0x8d, 0x8b,
|
||||||
|
0x58, 0xb7, 0x80, 0xfa, 0x45, 0x44, 0xe6, 0x87, 0x1a, 0xe7, 0x25, 0x9a,
|
||||||
|
0x81, 0x2a, 0x22, 0x16, 0x38, 0x54, 0xf3, 0x17, 0x78, 0x9a, 0x9a, 0xe3,
|
||||||
|
0x94, 0x4f, 0x94, 0x78, 0x54, 0xf3, 0xb4, 0x2f, 0xf0, 0xce, 0x62, 0xb5,
|
||||||
|
0xb6, 0xc4, 0xa8, 0xb6, 0xc4, 0xa8, 0x96, 0x8c, 0x86, 0x69, 0xd3, 0x5d,
|
||||||
|
0xf0, 0x0f, 0x5f, 0xb4, 0x4f, 0x52, 0xff, 0x45, 0xde, 0xa6, 0xc0, 0x20,
|
||||||
|
0x4f, 0x0c, 0x51, 0xf4, 0xe1, 0x58, 0xcb, 0xa6, 0x45, 0xdc, 0x23, 0x19,
|
||||||
|
0xdc, 0x7b, 0xa9, 0x43, 0xdd, 0x74, 0x69, 0x0d, 0x0a, 0x49, 0x6a, 0x2c,
|
||||||
|
0xf6, 0x86, 0xb1, 0x12, 0x85, 0x9a, 0x22, 0x05, 0x71, 0x91, 0x70, 0x89,
|
||||||
|
0x42, 0xb8, 0x44, 0x21, 0x4c, 0x0a, 0x47, 0xcb, 0x28, 0x7c, 0x09, 0xc7,
|
||||||
|
0xca, 0x29, 0x44, 0x17, 0xd1, 0x20, 0x29, 0x6c, 0xb8, 0xd2, 0xa1, 0x46,
|
||||||
|
0xaf, 0xac, 0x41, 0x21, 0x45, 0xcd, 0x34, 0x8f, 0x75, 0xee, 0x8a, 0xc2,
|
||||||
|
0x48, 0x19, 0x85, 0xa7, 0xe8, 0xcf, 0xb2, 0x38, 0x6c, 0x5d, 0xc4, 0x46,
|
||||||
|
0x49, 0xa1, 0xf1, 0xf2, 0xd0, 0xd6, 0xcb, 0x6b, 0x30, 0x70, 0xa9, 0xc9,
|
||||||
|
0x53, 0x9e, 0xb9, 0xab, 0x38, 0x1c, 0x2f, 0x63, 0x70, 0x02, 0x5f, 0x2e,
|
||||||
|
0x32, 0xb8, 0x58, 0x64, 0xd0, 0x2e, 0x33, 0xe1, 0x3e, 0x32, 0x58, 0xc0,
|
||||||
|
0xfd, 0x43, 0x75, 0x4d, 0x6c, 0x37, 0x9b, 0xce, 0xc3, 0xa8, 0xdb, 0x2c,
|
||||||
|
0x84, 0x59, 0xf8, 0xd5, 0xf9, 0xba, 0x2d, 0xb7, 0x75, 0x0f, 0x14, 0x75,
|
||||||
|
0xbe, 0xf9, 0xc6, 0xf9, 0x52, 0xb2, 0x6e, 0x20, 0x3c, 0xf0, 0x3c, 0x09,
|
||||||
|
0xbe, 0xc8, 0x9a, 0x3e, 0xc3, 0xf7, 0xc5, 0x2b, 0xb2, 0x9f, 0x3c, 0xc2,
|
||||||
|
0xff, 0x6d, 0x2e, 0x25, 0x6f, 0x7b, 0x89, 0x62, 0x7b, 0x89, 0x62, 0x3b,
|
||||||
|
0x29, 0x76, 0x91, 0x62, 0x15, 0xe7, 0x4b, 0xc9, 0x5b, 0x09, 0xf5, 0x16,
|
||||||
|
0x9a, 0x98, 0xb8, 0x4a, 0x58, 0x54, 0x0f, 0xbf, 0x9d, 0x8a, 0x8c, 0x77,
|
||||||
|
0x16, 0xab, 0x39, 0x28, 0xaa, 0x67, 0x01, 0x5b, 0x57, 0xd7, 0xe1, 0xb9,
|
||||||
|
0x65, 0x05, 0x1d, 0x2c, 0x1e, 0xa7, 0x88, 0xcf, 0x2e, 0xef, 0xfd, 0x9f,
|
||||||
|
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
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
const int CONFIG_VERSION = 2;
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
|
||||||
#include <Winsock2.h>
|
#include <winsock2.h>
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
add_library(log.c STATIC
|
|
||||||
log.c
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(log.c PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
@@ -1,232 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2020 rxi
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to
|
|
||||||
* deal in the Software without restriction, including without limitation the
|
|
||||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
||||||
* sell copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
||||||
* IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified by xiaozhou233 (2025), based on work by rxi (MIT License).
|
|
||||||
* - Add log setting
|
|
||||||
* - log time switch
|
|
||||||
* - log level switch
|
|
||||||
* - log filename switch
|
|
||||||
* - log line number switch
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "log.h"
|
|
||||||
|
|
||||||
#define MAX_CALLBACKS 32
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
log_LogFn fn;
|
|
||||||
void *udata;
|
|
||||||
int level;
|
|
||||||
} Callback;
|
|
||||||
|
|
||||||
static struct {
|
|
||||||
void *udata;
|
|
||||||
log_LockFn lock;
|
|
||||||
int level;
|
|
||||||
bool quiet;
|
|
||||||
Callback callbacks[MAX_CALLBACKS];
|
|
||||||
|
|
||||||
bool is_log_time;
|
|
||||||
bool is_log_level;
|
|
||||||
bool is_log_filename;
|
|
||||||
bool is_log_line;
|
|
||||||
} L = {
|
|
||||||
.is_log_time = true,
|
|
||||||
.is_log_level = true,
|
|
||||||
.is_log_filename = true,
|
|
||||||
.is_log_line = true
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static const char *level_strings[] = {
|
|
||||||
"TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef LOG_USE_COLOR
|
|
||||||
static const char *level_colors[] = {
|
|
||||||
"\x1b[94m", "\x1b[36m", "\x1b[32m", "\x1b[33m", "\x1b[31m", "\x1b[35m"
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static void stdout_callback(log_Event *ev) {
|
|
||||||
char buf[64] = {0};
|
|
||||||
|
|
||||||
if (L.is_log_time) {
|
|
||||||
strftime(buf, sizeof(buf), "%H:%M:%S", ev->time);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef LOG_USE_COLOR
|
|
||||||
fprintf(ev->udata, "%s", LOG_USE_COLOR ? level_colors[ev->level] : "");
|
|
||||||
|
|
||||||
if (L.is_log_time)
|
|
||||||
fprintf(ev->udata, "%s ", buf);
|
|
||||||
|
|
||||||
if (L.is_log_level)
|
|
||||||
fprintf(ev->udata, "%-5s ", level_strings[ev->level]);
|
|
||||||
|
|
||||||
fprintf(ev->udata, "\x1b[0m");
|
|
||||||
|
|
||||||
if (L.is_log_filename)
|
|
||||||
fprintf(ev->udata, "\x1b[90m%s", ev->file);
|
|
||||||
|
|
||||||
if (L.is_log_line)
|
|
||||||
fprintf(ev->udata, ":%d", ev->line);
|
|
||||||
|
|
||||||
if (L.is_log_filename || L.is_log_line)
|
|
||||||
fprintf(ev->udata, ":\x1b[0m ");
|
|
||||||
#else
|
|
||||||
if (L.is_log_time)
|
|
||||||
fprintf(ev->udata, "%s ", buf);
|
|
||||||
|
|
||||||
if (L.is_log_level)
|
|
||||||
fprintf(ev->udata, "%-5s ", level_strings[ev->level]);
|
|
||||||
|
|
||||||
if (L.is_log_filename)
|
|
||||||
fprintf(ev->udata, "%s", ev->file);
|
|
||||||
|
|
||||||
if (L.is_log_line)
|
|
||||||
fprintf(ev->udata, ":%d", ev->line);
|
|
||||||
|
|
||||||
if (L.is_log_filename || L.is_log_line)
|
|
||||||
fprintf(ev->udata, ": ");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
vfprintf(ev->udata, ev->fmt, ev->ap);
|
|
||||||
fprintf(ev->udata, "\n");
|
|
||||||
fflush(ev->udata);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void file_callback(log_Event *ev) {
|
|
||||||
char buf[64];
|
|
||||||
buf[strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", ev->time)] = '\0';
|
|
||||||
fprintf(
|
|
||||||
ev->udata, "%s %-5s %s:%d: ",
|
|
||||||
buf, level_strings[ev->level], ev->file, ev->line);
|
|
||||||
vfprintf(ev->udata, ev->fmt, ev->ap);
|
|
||||||
fprintf(ev->udata, "\n");
|
|
||||||
fflush(ev->udata);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void lock(void) {
|
|
||||||
if (L.lock) { L.lock(true, L.udata); }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void unlock(void) {
|
|
||||||
if (L.lock) { L.lock(false, L.udata); }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const char* log_level_string(int level) {
|
|
||||||
return level_strings[level];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void log_set_lock(log_LockFn fn, void *udata) {
|
|
||||||
L.lock = fn;
|
|
||||||
L.udata = udata;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void log_set_level(int level) {
|
|
||||||
L.level = level;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void log_set_quiet(bool enable) {
|
|
||||||
L.quiet = enable;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int log_add_callback(log_LogFn fn, void *udata, int level) {
|
|
||||||
for (int i = 0; i < MAX_CALLBACKS; i++) {
|
|
||||||
if (!L.callbacks[i].fn) {
|
|
||||||
L.callbacks[i] = (Callback) { fn, udata, level };
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int log_add_fp(FILE *fp, int level) {
|
|
||||||
return log_add_callback(file_callback, fp, level);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void init_event(log_Event *ev, void *udata) {
|
|
||||||
if (!ev->time) {
|
|
||||||
time_t t = time(NULL);
|
|
||||||
ev->time = localtime(&t);
|
|
||||||
}
|
|
||||||
ev->udata = udata;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void log_log(int level, const char *file, int line, const char *fmt, ...) {
|
|
||||||
|
|
||||||
log_Event ev = {
|
|
||||||
.fmt = fmt,
|
|
||||||
.file = file,
|
|
||||||
.line = line,
|
|
||||||
.level = level,
|
|
||||||
};
|
|
||||||
|
|
||||||
lock();
|
|
||||||
|
|
||||||
if (!L.quiet && level >= L.level) {
|
|
||||||
init_event(&ev, stderr);
|
|
||||||
va_start(ev.ap, fmt);
|
|
||||||
stdout_callback(&ev);
|
|
||||||
va_end(ev.ap);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < MAX_CALLBACKS && L.callbacks[i].fn; i++) {
|
|
||||||
Callback *cb = &L.callbacks[i];
|
|
||||||
if (level >= cb->level) {
|
|
||||||
init_event(&ev, cb->udata);
|
|
||||||
va_start(ev.ap, fmt);
|
|
||||||
cb->fn(&ev);
|
|
||||||
va_end(ev.ap);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void log_is_log_time(bool enable) {
|
|
||||||
L.is_log_time = enable;
|
|
||||||
}
|
|
||||||
void log_is_log_level(bool enable) {
|
|
||||||
L.is_log_level = enable;
|
|
||||||
}
|
|
||||||
void log_is_log_filename(bool enable) {
|
|
||||||
L.is_log_filename = enable;
|
|
||||||
}
|
|
||||||
void log_is_log_line(bool enable) {
|
|
||||||
L.is_log_line = enable;
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2020 rxi
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the MIT license. See `log.c` for details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified by xiaozhou233 (2025), based on work by rxi (MIT License).
|
|
||||||
* See `log.c` for details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef LOG_H
|
|
||||||
#define LOG_H
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
#define LOG_VERSION "0.1.0"
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
va_list ap;
|
|
||||||
const char *fmt;
|
|
||||||
const char *file;
|
|
||||||
struct tm *time;
|
|
||||||
void *udata;
|
|
||||||
int line;
|
|
||||||
int level;
|
|
||||||
} log_Event;
|
|
||||||
|
|
||||||
typedef void (*log_LogFn)(log_Event *ev);
|
|
||||||
typedef void (*log_LockFn)(bool lock, void *udata);
|
|
||||||
|
|
||||||
enum { LOG_TRACE, LOG_DEBUG, LOG_INFO, LOG_WARN, LOG_ERROR, LOG_FATAL };
|
|
||||||
|
|
||||||
#define log_trace(...) log_log(LOG_TRACE, __FILE__, __LINE__, __VA_ARGS__)
|
|
||||||
#define log_debug(...) log_log(LOG_DEBUG, __FILE__, __LINE__, __VA_ARGS__)
|
|
||||||
#define log_info(...) log_log(LOG_INFO, __FILE__, __LINE__, __VA_ARGS__)
|
|
||||||
#define log_warn(...) log_log(LOG_WARN, __FILE__, __LINE__, __VA_ARGS__)
|
|
||||||
#define log_error(...) log_log(LOG_ERROR, __FILE__, __LINE__, __VA_ARGS__)
|
|
||||||
#define log_fatal(...) log_log(LOG_FATAL, __FILE__, __LINE__, __VA_ARGS__)
|
|
||||||
|
|
||||||
const char* log_level_string(int level);
|
|
||||||
void log_set_lock(log_LockFn fn, void *udata);
|
|
||||||
void log_set_level(int level);
|
|
||||||
void log_set_quiet(bool enable);
|
|
||||||
int log_add_callback(log_LogFn fn, void *udata, int level);
|
|
||||||
int log_add_fp(FILE *fp, int level);
|
|
||||||
|
|
||||||
// Add custom log formatting function
|
|
||||||
void log_is_log_time(bool enable);
|
|
||||||
void log_is_log_level(bool enable);
|
|
||||||
void log_is_log_filename(bool enable);
|
|
||||||
void log_is_log_line(bool enable);
|
|
||||||
|
|
||||||
void log_log(int level, const char *file, int line, const char *fmt, ...);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
//
|
||||||
|
// Async logging using global thread pool
|
||||||
|
// All loggers created here share same global thread pool.
|
||||||
|
// Each log message is pushed to a queue along with a shared pointer to the
|
||||||
|
// logger.
|
||||||
|
// If a logger deleted while having pending messages in the queue, it's actual
|
||||||
|
// destruction will defer
|
||||||
|
// until all its messages are processed by the thread pool.
|
||||||
|
// This is because each message in the queue holds a shared_ptr to the
|
||||||
|
// originating logger.
|
||||||
|
|
||||||
|
#include <spdlog/async_logger.h>
|
||||||
|
#include <spdlog/details/registry.h>
|
||||||
|
#include <spdlog/details/thread_pool.h>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <memory>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
|
||||||
|
namespace details {
|
||||||
|
static const size_t default_async_q_size = 8192;
|
||||||
|
}
|
||||||
|
|
||||||
|
// async logger factory - creates async loggers backed with thread pool.
|
||||||
|
// if a global thread pool doesn't already exist, create it with default queue
|
||||||
|
// size of 8192 items and single thread.
|
||||||
|
template <async_overflow_policy OverflowPolicy = async_overflow_policy::block>
|
||||||
|
struct async_factory_impl {
|
||||||
|
template <typename Sink, typename... SinkArgs>
|
||||||
|
static std::shared_ptr<async_logger> create(std::string logger_name, SinkArgs &&...args) {
|
||||||
|
auto ®istry_inst = details::registry::instance();
|
||||||
|
|
||||||
|
// create global thread pool if not already exists..
|
||||||
|
|
||||||
|
auto &mutex = registry_inst.tp_mutex();
|
||||||
|
std::lock_guard<std::recursive_mutex> tp_lock(mutex);
|
||||||
|
auto tp = registry_inst.get_tp();
|
||||||
|
if (tp == nullptr) {
|
||||||
|
tp = std::make_shared<details::thread_pool>(details::default_async_q_size, 1U);
|
||||||
|
registry_inst.set_tp(tp);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto sink = std::make_shared<Sink>(std::forward<SinkArgs>(args)...);
|
||||||
|
auto new_logger = std::make_shared<async_logger>(std::move(logger_name), std::move(sink),
|
||||||
|
std::move(tp), OverflowPolicy);
|
||||||
|
registry_inst.initialize_logger(new_logger);
|
||||||
|
return new_logger;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
using async_factory = async_factory_impl<async_overflow_policy::block>;
|
||||||
|
using async_factory_nonblock = async_factory_impl<async_overflow_policy::overrun_oldest>;
|
||||||
|
|
||||||
|
template <typename Sink, typename... SinkArgs>
|
||||||
|
inline std::shared_ptr<spdlog::logger> create_async(std::string logger_name,
|
||||||
|
SinkArgs &&...sink_args) {
|
||||||
|
return async_factory::create<Sink>(std::move(logger_name),
|
||||||
|
std::forward<SinkArgs>(sink_args)...);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Sink, typename... SinkArgs>
|
||||||
|
inline std::shared_ptr<spdlog::logger> create_async_nb(std::string logger_name,
|
||||||
|
SinkArgs &&...sink_args) {
|
||||||
|
return async_factory_nonblock::create<Sink>(std::move(logger_name),
|
||||||
|
std::forward<SinkArgs>(sink_args)...);
|
||||||
|
}
|
||||||
|
|
||||||
|
// set global thread pool.
|
||||||
|
inline void init_thread_pool(size_t q_size,
|
||||||
|
size_t thread_count,
|
||||||
|
std::function<void()> on_thread_start,
|
||||||
|
std::function<void()> on_thread_stop) {
|
||||||
|
auto tp = std::make_shared<details::thread_pool>(q_size, thread_count, on_thread_start,
|
||||||
|
on_thread_stop);
|
||||||
|
details::registry::instance().set_tp(std::move(tp));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void init_thread_pool(size_t q_size,
|
||||||
|
size_t thread_count,
|
||||||
|
std::function<void()> on_thread_start) {
|
||||||
|
init_thread_pool(q_size, thread_count, on_thread_start, [] {});
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void init_thread_pool(size_t q_size, size_t thread_count) {
|
||||||
|
init_thread_pool(q_size, thread_count, [] {}, [] {});
|
||||||
|
}
|
||||||
|
|
||||||
|
// get the global thread pool.
|
||||||
|
inline std::shared_ptr<spdlog::details::thread_pool> thread_pool() {
|
||||||
|
return details::registry::instance().get_tp();
|
||||||
|
}
|
||||||
|
} // namespace spdlog
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
|
#include <spdlog/async_logger.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <spdlog/details/thread_pool.h>
|
||||||
|
#include <spdlog/sinks/sink.h>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
SPDLOG_INLINE spdlog::async_logger::async_logger(std::string logger_name,
|
||||||
|
sinks_init_list sinks_list,
|
||||||
|
std::weak_ptr<details::thread_pool> tp,
|
||||||
|
async_overflow_policy overflow_policy)
|
||||||
|
: async_logger(std::move(logger_name),
|
||||||
|
sinks_list.begin(),
|
||||||
|
sinks_list.end(),
|
||||||
|
std::move(tp),
|
||||||
|
overflow_policy) {}
|
||||||
|
|
||||||
|
SPDLOG_INLINE spdlog::async_logger::async_logger(std::string logger_name,
|
||||||
|
sink_ptr single_sink,
|
||||||
|
std::weak_ptr<details::thread_pool> tp,
|
||||||
|
async_overflow_policy overflow_policy)
|
||||||
|
: async_logger(
|
||||||
|
std::move(logger_name), {std::move(single_sink)}, std::move(tp), overflow_policy) {}
|
||||||
|
|
||||||
|
// send the log message to the thread pool
|
||||||
|
SPDLOG_INLINE void spdlog::async_logger::sink_it_(const details::log_msg &msg){
|
||||||
|
SPDLOG_TRY{if (auto pool_ptr = thread_pool_.lock()){
|
||||||
|
pool_ptr -> post_log(shared_from_this(), msg, overflow_policy_);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw_spdlog_ex("async log: thread pool doesn't exist anymore");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SPDLOG_LOGGER_CATCH(msg.source)
|
||||||
|
}
|
||||||
|
|
||||||
|
// send flush request to the thread pool
|
||||||
|
SPDLOG_INLINE void spdlog::async_logger::flush_(){
|
||||||
|
SPDLOG_TRY{if (auto pool_ptr = thread_pool_.lock()){
|
||||||
|
pool_ptr -> post_flush(shared_from_this(), overflow_policy_);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw_spdlog_ex("async flush: thread pool doesn't exist anymore");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SPDLOG_LOGGER_CATCH(source_loc())
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// backend functions - called from the thread pool to do the actual job
|
||||||
|
//
|
||||||
|
SPDLOG_INLINE void spdlog::async_logger::backend_sink_it_(const details::log_msg &msg) {
|
||||||
|
for (auto &sink : sinks_) {
|
||||||
|
if (sink->should_log(msg.level)) {
|
||||||
|
SPDLOG_TRY { sink->log(msg); }
|
||||||
|
SPDLOG_LOGGER_CATCH(msg.source)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (should_flush_(msg)) {
|
||||||
|
backend_flush_();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void spdlog::async_logger::backend_flush_() {
|
||||||
|
for (auto &sink : sinks_) {
|
||||||
|
SPDLOG_TRY { sink->flush(); }
|
||||||
|
SPDLOG_LOGGER_CATCH(source_loc())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE std::shared_ptr<spdlog::logger> spdlog::async_logger::clone(std::string new_name) {
|
||||||
|
auto cloned = std::make_shared<spdlog::async_logger>(*this);
|
||||||
|
cloned->name_ = std::move(new_name);
|
||||||
|
return cloned;
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// Fast asynchronous logger.
|
||||||
|
// Uses pre allocated queue.
|
||||||
|
// Creates a single back thread to pop messages from the queue and log them.
|
||||||
|
//
|
||||||
|
// Upon each log write the logger:
|
||||||
|
// 1. Checks if its log level is enough to log the message
|
||||||
|
// 2. Push a new copy of the message to a queue (or block the caller until
|
||||||
|
// space is available in the queue)
|
||||||
|
// Upon destruction, logs all remaining messages in the queue before
|
||||||
|
// destructing..
|
||||||
|
|
||||||
|
#include <spdlog/logger.h>
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
|
||||||
|
// Async overflow policy - block by default.
|
||||||
|
enum class async_overflow_policy {
|
||||||
|
block, // Block until message can be enqueued
|
||||||
|
overrun_oldest, // Discard oldest message in the queue if full when trying to
|
||||||
|
// add new item.
|
||||||
|
discard_new // Discard new message if the queue is full when trying to add new item.
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace details {
|
||||||
|
class thread_pool;
|
||||||
|
}
|
||||||
|
|
||||||
|
class SPDLOG_API async_logger final : public std::enable_shared_from_this<async_logger>,
|
||||||
|
public logger {
|
||||||
|
friend class details::thread_pool;
|
||||||
|
|
||||||
|
public:
|
||||||
|
template <typename It>
|
||||||
|
async_logger(std::string logger_name,
|
||||||
|
It begin,
|
||||||
|
It end,
|
||||||
|
std::weak_ptr<details::thread_pool> tp,
|
||||||
|
async_overflow_policy overflow_policy = async_overflow_policy::block)
|
||||||
|
: logger(std::move(logger_name), begin, end),
|
||||||
|
thread_pool_(std::move(tp)),
|
||||||
|
overflow_policy_(overflow_policy) {}
|
||||||
|
|
||||||
|
async_logger(std::string logger_name,
|
||||||
|
sinks_init_list sinks_list,
|
||||||
|
std::weak_ptr<details::thread_pool> tp,
|
||||||
|
async_overflow_policy overflow_policy = async_overflow_policy::block);
|
||||||
|
|
||||||
|
async_logger(std::string logger_name,
|
||||||
|
sink_ptr single_sink,
|
||||||
|
std::weak_ptr<details::thread_pool> tp,
|
||||||
|
async_overflow_policy overflow_policy = async_overflow_policy::block);
|
||||||
|
|
||||||
|
std::shared_ptr<logger> clone(std::string new_name) override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void sink_it_(const details::log_msg &msg) override;
|
||||||
|
void flush_() override;
|
||||||
|
void backend_sink_it_(const details::log_msg &incoming_log_msg);
|
||||||
|
void backend_flush_();
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::weak_ptr<details::thread_pool> thread_pool_;
|
||||||
|
async_overflow_policy overflow_policy_;
|
||||||
|
};
|
||||||
|
} // namespace spdlog
|
||||||
|
|
||||||
|
#ifdef SPDLOG_HEADER_ONLY
|
||||||
|
#include "async_logger-inl.h"
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include <spdlog/cfg/helpers.h>
|
||||||
|
#include <spdlog/details/registry.h>
|
||||||
|
|
||||||
|
//
|
||||||
|
// Init log levels using each argv entry that starts with "SPDLOG_LEVEL="
|
||||||
|
//
|
||||||
|
// set all loggers to debug level:
|
||||||
|
// example.exe "SPDLOG_LEVEL=debug"
|
||||||
|
|
||||||
|
// set logger1 to trace level
|
||||||
|
// example.exe "SPDLOG_LEVEL=logger1=trace"
|
||||||
|
|
||||||
|
// turn off all logging except for logger1 and logger2:
|
||||||
|
// example.exe "SPDLOG_LEVEL=off,logger1=debug,logger2=info"
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace cfg {
|
||||||
|
|
||||||
|
// search for SPDLOG_LEVEL= in the args and use it to init the levels
|
||||||
|
inline void load_argv_levels(int argc, const char **argv) {
|
||||||
|
const std::string spdlog_level_prefix = "SPDLOG_LEVEL=";
|
||||||
|
for (int i = 1; i < argc; i++) {
|
||||||
|
std::string arg = argv[i];
|
||||||
|
if (arg.find(spdlog_level_prefix) == 0) {
|
||||||
|
auto levels_string = arg.substr(spdlog_level_prefix.size());
|
||||||
|
helpers::load_levels(levels_string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void load_argv_levels(int argc, char **argv) {
|
||||||
|
load_argv_levels(argc, const_cast<const char **>(argv));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace cfg
|
||||||
|
} // namespace spdlog
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include <spdlog/cfg/helpers.h>
|
||||||
|
#include <spdlog/details/os.h>
|
||||||
|
#include <spdlog/details/registry.h>
|
||||||
|
|
||||||
|
//
|
||||||
|
// Init levels and patterns from env variables SPDLOG_LEVEL
|
||||||
|
// Inspired from Rust's "env_logger" crate (https://crates.io/crates/env_logger).
|
||||||
|
// Note - fallback to "info" level on unrecognized levels
|
||||||
|
//
|
||||||
|
// Examples:
|
||||||
|
//
|
||||||
|
// set global level to debug:
|
||||||
|
// export SPDLOG_LEVEL=debug
|
||||||
|
//
|
||||||
|
// turn off all logging except for logger1:
|
||||||
|
// export SPDLOG_LEVEL="*=off,logger1=debug"
|
||||||
|
//
|
||||||
|
|
||||||
|
// turn off all logging except for logger1 and logger2:
|
||||||
|
// export SPDLOG_LEVEL="off,logger1=debug,logger2=info"
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace cfg {
|
||||||
|
inline void load_env_levels(const char* var = "SPDLOG_LEVEL") {
|
||||||
|
auto env_val = details::os::getenv(var);
|
||||||
|
if (!env_val.empty()) {
|
||||||
|
helpers::load_levels(env_val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace cfg
|
||||||
|
} // namespace spdlog
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
|
#include <spdlog/cfg/helpers.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <spdlog/details/os.h>
|
||||||
|
#include <spdlog/details/registry.h>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <sstream>
|
||||||
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace cfg {
|
||||||
|
namespace helpers {
|
||||||
|
|
||||||
|
// inplace convert to lowercase
|
||||||
|
inline std::string &to_lower_(std::string &str) {
|
||||||
|
std::transform(str.begin(), str.end(), str.begin(), [](char ch) {
|
||||||
|
return static_cast<char>((ch >= 'A' && ch <= 'Z') ? ch + ('a' - 'A') : ch);
|
||||||
|
});
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
// inplace trim spaces
|
||||||
|
inline std::string &trim_(std::string &str) {
|
||||||
|
const char *spaces = " \n\r\t";
|
||||||
|
str.erase(str.find_last_not_of(spaces) + 1);
|
||||||
|
str.erase(0, str.find_first_not_of(spaces));
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
// return (name,value) trimmed pair from the given "name = value" string.
|
||||||
|
// return empty string on missing parts
|
||||||
|
// "key=val" => ("key", "val")
|
||||||
|
// " key = val " => ("key", "val")
|
||||||
|
// "key=" => ("key", "")
|
||||||
|
// "val" => ("", "val")
|
||||||
|
|
||||||
|
inline std::pair<std::string, std::string> extract_kv_(char sep, const std::string &str) {
|
||||||
|
auto n = str.find(sep);
|
||||||
|
std::string k, v;
|
||||||
|
if (n == std::string::npos) {
|
||||||
|
v = str;
|
||||||
|
} else {
|
||||||
|
k = str.substr(0, n);
|
||||||
|
v = str.substr(n + 1);
|
||||||
|
}
|
||||||
|
return std::make_pair(trim_(k), trim_(v));
|
||||||
|
}
|
||||||
|
|
||||||
|
// return vector of key/value pairs from a sequence of "K1=V1,K2=V2,.."
|
||||||
|
// "a=AAA,b=BBB,c=CCC,.." => {("a","AAA"),("b","BBB"),("c", "CCC"),...}
|
||||||
|
inline std::unordered_map<std::string, std::string> extract_key_vals_(const std::string &str) {
|
||||||
|
std::string token;
|
||||||
|
std::istringstream token_stream(str);
|
||||||
|
std::unordered_map<std::string, std::string> rv{};
|
||||||
|
while (std::getline(token_stream, token, ',')) {
|
||||||
|
if (token.empty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
auto kv = extract_kv_('=', token);
|
||||||
|
rv[kv.first] = kv.second;
|
||||||
|
}
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void load_levels(const std::string &input) {
|
||||||
|
if (input.empty() || input.size() >= 32768) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto key_vals = extract_key_vals_(input);
|
||||||
|
std::unordered_map<std::string, level::level_enum> levels;
|
||||||
|
level::level_enum global_level = level::info;
|
||||||
|
bool global_level_found = false;
|
||||||
|
|
||||||
|
for (auto &name_level : key_vals) {
|
||||||
|
const auto &logger_name = name_level.first;
|
||||||
|
const auto &level_name = to_lower_(name_level.second);
|
||||||
|
auto level = level::from_str(level_name);
|
||||||
|
// ignore unrecognized level names
|
||||||
|
if (level == level::off && level_name != "off") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (logger_name.empty()) // no logger name indicates global level
|
||||||
|
{
|
||||||
|
global_level_found = true;
|
||||||
|
global_level = level;
|
||||||
|
} else {
|
||||||
|
levels[logger_name] = level;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
details::registry::instance().set_levels(std::move(levels),
|
||||||
|
global_level_found ? &global_level : nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace helpers
|
||||||
|
} // namespace cfg
|
||||||
|
} // namespace spdlog
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <spdlog/common.h>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace cfg {
|
||||||
|
namespace helpers {
|
||||||
|
//
|
||||||
|
// Init levels from given string
|
||||||
|
//
|
||||||
|
// Examples:
|
||||||
|
//
|
||||||
|
// set global level to debug: "debug"
|
||||||
|
// turn off all logging except for logger1: "off,logger1=debug"
|
||||||
|
// turn off all logging except for logger1 and logger2: "off,logger1=debug,logger2=info"
|
||||||
|
//
|
||||||
|
SPDLOG_API void load_levels(const std::string &txt);
|
||||||
|
} // namespace helpers
|
||||||
|
|
||||||
|
} // namespace cfg
|
||||||
|
} // namespace spdlog
|
||||||
|
|
||||||
|
#ifdef SPDLOG_HEADER_ONLY
|
||||||
|
#include "helpers-inl.h"
|
||||||
|
#endif // SPDLOG_HEADER_ONLY
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
|
#include <spdlog/common.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <iterator>
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace level {
|
||||||
|
|
||||||
|
#if __cplusplus >= 201703L
|
||||||
|
constexpr
|
||||||
|
#endif
|
||||||
|
static string_view_t level_string_views[] SPDLOG_LEVEL_NAMES;
|
||||||
|
|
||||||
|
static const char *short_level_names[] SPDLOG_SHORT_LEVEL_NAMES;
|
||||||
|
|
||||||
|
SPDLOG_INLINE const string_view_t &to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT {
|
||||||
|
return level_string_views[l];
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE const char *to_short_c_str(spdlog::level::level_enum l) SPDLOG_NOEXCEPT {
|
||||||
|
return short_level_names[l];
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE spdlog::level::level_enum from_str(const std::string &name) SPDLOG_NOEXCEPT {
|
||||||
|
auto it = std::find(std::begin(level_string_views), std::end(level_string_views), name);
|
||||||
|
if (it != std::end(level_string_views))
|
||||||
|
return static_cast<level::level_enum>(std::distance(std::begin(level_string_views), it));
|
||||||
|
|
||||||
|
// check also for "warn" and "err" before giving up..
|
||||||
|
if (name == "warn") {
|
||||||
|
return level::warn;
|
||||||
|
}
|
||||||
|
if (name == "err") {
|
||||||
|
return level::err;
|
||||||
|
}
|
||||||
|
return level::off;
|
||||||
|
}
|
||||||
|
} // namespace level
|
||||||
|
|
||||||
|
SPDLOG_INLINE spdlog_ex::spdlog_ex(std::string msg)
|
||||||
|
: msg_(std::move(msg)) {}
|
||||||
|
|
||||||
|
SPDLOG_INLINE spdlog_ex::spdlog_ex(const std::string &msg, int last_errno) {
|
||||||
|
#ifdef SPDLOG_USE_STD_FORMAT
|
||||||
|
msg_ = std::system_error(std::error_code(last_errno, std::generic_category()), msg).what();
|
||||||
|
#else
|
||||||
|
memory_buf_t outbuf;
|
||||||
|
fmt::format_system_error(outbuf, last_errno, msg.c_str());
|
||||||
|
msg_ = fmt::to_string(outbuf);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE const char *spdlog_ex::what() const SPDLOG_NOEXCEPT { return msg_.c_str(); }
|
||||||
|
|
||||||
|
SPDLOG_INLINE void throw_spdlog_ex(const std::string &msg, int last_errno) {
|
||||||
|
SPDLOG_THROW(spdlog_ex(msg, last_errno));
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void throw_spdlog_ex(std::string msg) { SPDLOG_THROW(spdlog_ex(std::move(msg))); }
|
||||||
|
|
||||||
|
} // namespace spdlog
|
||||||
@@ -0,0 +1,406 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <spdlog/details/null_mutex.h>
|
||||||
|
#include <spdlog/tweakme.h>
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
|
#include <chrono>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <exception>
|
||||||
|
#include <functional>
|
||||||
|
#include <initializer_list>
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
|
#ifdef SPDLOG_USE_STD_FORMAT
|
||||||
|
#include <version>
|
||||||
|
#if __cpp_lib_format >= 202207L
|
||||||
|
#include <format>
|
||||||
|
#else
|
||||||
|
#include <string_view>
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SPDLOG_COMPILED_LIB
|
||||||
|
#undef SPDLOG_HEADER_ONLY
|
||||||
|
#if defined(SPDLOG_SHARED_LIB)
|
||||||
|
#if defined(_WIN32)
|
||||||
|
#ifdef spdlog_EXPORTS
|
||||||
|
#define SPDLOG_API __declspec(dllexport)
|
||||||
|
#else // !spdlog_EXPORTS
|
||||||
|
#define SPDLOG_API __declspec(dllimport)
|
||||||
|
#endif
|
||||||
|
#else // !defined(_WIN32)
|
||||||
|
#define SPDLOG_API __attribute__((visibility("default")))
|
||||||
|
#endif
|
||||||
|
#else // !defined(SPDLOG_SHARED_LIB)
|
||||||
|
#define SPDLOG_API
|
||||||
|
#endif
|
||||||
|
#define SPDLOG_INLINE
|
||||||
|
#else // !defined(SPDLOG_COMPILED_LIB)
|
||||||
|
#define SPDLOG_API
|
||||||
|
#define SPDLOG_HEADER_ONLY
|
||||||
|
#define SPDLOG_INLINE inline
|
||||||
|
#endif // #ifdef SPDLOG_COMPILED_LIB
|
||||||
|
|
||||||
|
#include <spdlog/fmt/fmt.h>
|
||||||
|
|
||||||
|
#if !defined(SPDLOG_USE_STD_FORMAT) && \
|
||||||
|
FMT_VERSION >= 80000 // backward compatibility with fmt versions older than 8
|
||||||
|
#define SPDLOG_FMT_RUNTIME(format_string) fmt::runtime(format_string)
|
||||||
|
#define SPDLOG_FMT_STRING(format_string) FMT_STRING(format_string)
|
||||||
|
#if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT)
|
||||||
|
#include <spdlog/fmt/xchar.h>
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define SPDLOG_FMT_RUNTIME(format_string) format_string
|
||||||
|
#define SPDLOG_FMT_STRING(format_string) format_string
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// visual studio up to 2013 does not support noexcept nor constexpr
|
||||||
|
#if defined(_MSC_VER) && (_MSC_VER < 1900)
|
||||||
|
#define SPDLOG_NOEXCEPT _NOEXCEPT
|
||||||
|
#define SPDLOG_CONSTEXPR
|
||||||
|
#else
|
||||||
|
#define SPDLOG_NOEXCEPT noexcept
|
||||||
|
#define SPDLOG_CONSTEXPR constexpr
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// If building with std::format, can just use constexpr, otherwise if building with fmt
|
||||||
|
// SPDLOG_CONSTEXPR_FUNC needs to be set the same as FMT_CONSTEXPR to avoid situations where
|
||||||
|
// a constexpr function in spdlog could end up calling a non-constexpr function in fmt
|
||||||
|
// depending on the compiler
|
||||||
|
// If fmt determines it can't use constexpr, we should inline the function instead
|
||||||
|
#ifdef SPDLOG_USE_STD_FORMAT
|
||||||
|
#define SPDLOG_CONSTEXPR_FUNC constexpr
|
||||||
|
#else // Being built with fmt
|
||||||
|
#if FMT_USE_CONSTEXPR
|
||||||
|
#define SPDLOG_CONSTEXPR_FUNC FMT_CONSTEXPR
|
||||||
|
#else
|
||||||
|
#define SPDLOG_CONSTEXPR_FUNC inline
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
|
#define SPDLOG_DEPRECATED __attribute__((deprecated))
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#define SPDLOG_DEPRECATED __declspec(deprecated)
|
||||||
|
#else
|
||||||
|
#define SPDLOG_DEPRECATED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// disable thread local on msvc 2013
|
||||||
|
#ifndef SPDLOG_NO_TLS
|
||||||
|
#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || defined(__cplusplus_winrt)
|
||||||
|
#define SPDLOG_NO_TLS 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SPDLOG_FUNCTION
|
||||||
|
#define SPDLOG_FUNCTION static_cast<const char *>(__FUNCTION__)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SPDLOG_NO_EXCEPTIONS
|
||||||
|
#define SPDLOG_TRY
|
||||||
|
#define SPDLOG_THROW(ex) \
|
||||||
|
do { \
|
||||||
|
printf("spdlog fatal error: %s\n", ex.what()); \
|
||||||
|
std::abort(); \
|
||||||
|
} while (0)
|
||||||
|
#define SPDLOG_CATCH_STD
|
||||||
|
#else
|
||||||
|
#define SPDLOG_TRY try
|
||||||
|
#define SPDLOG_THROW(ex) throw(ex)
|
||||||
|
#define SPDLOG_CATCH_STD \
|
||||||
|
catch (const std::exception &) { \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
|
||||||
|
class formatter;
|
||||||
|
|
||||||
|
namespace sinks {
|
||||||
|
class sink;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES)
|
||||||
|
using filename_t = std::wstring;
|
||||||
|
// allow macro expansion to occur in SPDLOG_FILENAME_T
|
||||||
|
#define SPDLOG_FILENAME_T_INNER(s) L##s
|
||||||
|
#define SPDLOG_FILENAME_T(s) SPDLOG_FILENAME_T_INNER(s)
|
||||||
|
#else
|
||||||
|
using filename_t = std::string;
|
||||||
|
#define SPDLOG_FILENAME_T(s) s
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using log_clock = std::chrono::system_clock;
|
||||||
|
using sink_ptr = std::shared_ptr<sinks::sink>;
|
||||||
|
using sinks_init_list = std::initializer_list<sink_ptr>;
|
||||||
|
using err_handler = std::function<void(const std::string &err_msg)>;
|
||||||
|
#ifdef SPDLOG_USE_STD_FORMAT
|
||||||
|
namespace fmt_lib = std;
|
||||||
|
|
||||||
|
using string_view_t = std::string_view;
|
||||||
|
using memory_buf_t = std::string;
|
||||||
|
|
||||||
|
template <typename... Args>
|
||||||
|
#if __cpp_lib_format >= 202207L
|
||||||
|
using format_string_t = std::format_string<Args...>;
|
||||||
|
#else
|
||||||
|
using format_string_t = std::string_view;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template <class T, class Char = char>
|
||||||
|
struct is_convertible_to_basic_format_string
|
||||||
|
: std::integral_constant<bool, std::is_convertible<T, std::basic_string_view<Char>>::value> {};
|
||||||
|
|
||||||
|
#if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT)
|
||||||
|
using wstring_view_t = std::wstring_view;
|
||||||
|
using wmemory_buf_t = std::wstring;
|
||||||
|
|
||||||
|
template <typename... Args>
|
||||||
|
#if __cpp_lib_format >= 202207L
|
||||||
|
using wformat_string_t = std::wformat_string<Args...>;
|
||||||
|
#else
|
||||||
|
using wformat_string_t = std::wstring_view;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#define SPDLOG_BUF_TO_STRING(x) x
|
||||||
|
#else // use fmt lib instead of std::format
|
||||||
|
namespace fmt_lib = fmt;
|
||||||
|
|
||||||
|
using string_view_t = fmt::basic_string_view<char>;
|
||||||
|
using memory_buf_t = fmt::basic_memory_buffer<char, 250>;
|
||||||
|
|
||||||
|
template <typename... Args>
|
||||||
|
using format_string_t = fmt::format_string<Args...>;
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
using remove_cvref_t = typename std::remove_cv<typename std::remove_reference<T>::type>::type;
|
||||||
|
|
||||||
|
template <typename Char>
|
||||||
|
#if FMT_VERSION >= 90101
|
||||||
|
using fmt_runtime_string = fmt::runtime_format_string<Char>;
|
||||||
|
#else
|
||||||
|
using fmt_runtime_string = fmt::basic_runtime<Char>;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// clang doesn't like SFINAE disabled constructor in std::is_convertible<> so have to repeat the
|
||||||
|
// condition from basic_format_string here, in addition, fmt::basic_runtime<Char> is only
|
||||||
|
// convertible to basic_format_string<Char> but not basic_string_view<Char>
|
||||||
|
template <class T, class Char = char>
|
||||||
|
struct is_convertible_to_basic_format_string
|
||||||
|
: std::integral_constant<bool,
|
||||||
|
std::is_convertible<T, fmt::basic_string_view<Char>>::value ||
|
||||||
|
std::is_same<remove_cvref_t<T>, fmt_runtime_string<Char>>::value> {
|
||||||
|
};
|
||||||
|
|
||||||
|
#if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT)
|
||||||
|
using wstring_view_t = fmt::basic_string_view<wchar_t>;
|
||||||
|
using wmemory_buf_t = fmt::basic_memory_buffer<wchar_t, 250>;
|
||||||
|
|
||||||
|
template <typename... Args>
|
||||||
|
using wformat_string_t = fmt::wformat_string<Args...>;
|
||||||
|
#endif
|
||||||
|
#define SPDLOG_BUF_TO_STRING(x) fmt::to_string(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
|
||||||
|
#ifndef _WIN32
|
||||||
|
#error SPDLOG_WCHAR_TO_UTF8_SUPPORT only supported on windows
|
||||||
|
#endif // _WIN32
|
||||||
|
#endif // SPDLOG_WCHAR_TO_UTF8_SUPPORT
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct is_convertible_to_any_format_string
|
||||||
|
: std::integral_constant<bool,
|
||||||
|
is_convertible_to_basic_format_string<T, char>::value ||
|
||||||
|
is_convertible_to_basic_format_string<T, wchar_t>::value> {};
|
||||||
|
|
||||||
|
#if defined(SPDLOG_NO_ATOMIC_LEVELS)
|
||||||
|
using level_t = details::null_atomic_int;
|
||||||
|
#else
|
||||||
|
using level_t = std::atomic<int>;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define SPDLOG_LEVEL_TRACE 0
|
||||||
|
#define SPDLOG_LEVEL_DEBUG 1
|
||||||
|
#define SPDLOG_LEVEL_INFO 2
|
||||||
|
#define SPDLOG_LEVEL_WARN 3
|
||||||
|
#define SPDLOG_LEVEL_ERROR 4
|
||||||
|
#define SPDLOG_LEVEL_CRITICAL 5
|
||||||
|
#define SPDLOG_LEVEL_OFF 6
|
||||||
|
|
||||||
|
#if !defined(SPDLOG_ACTIVE_LEVEL)
|
||||||
|
#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_INFO
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Log level enum
|
||||||
|
namespace level {
|
||||||
|
enum level_enum : int {
|
||||||
|
trace = SPDLOG_LEVEL_TRACE,
|
||||||
|
debug = SPDLOG_LEVEL_DEBUG,
|
||||||
|
info = SPDLOG_LEVEL_INFO,
|
||||||
|
warn = SPDLOG_LEVEL_WARN,
|
||||||
|
err = SPDLOG_LEVEL_ERROR,
|
||||||
|
critical = SPDLOG_LEVEL_CRITICAL,
|
||||||
|
off = SPDLOG_LEVEL_OFF,
|
||||||
|
n_levels
|
||||||
|
};
|
||||||
|
|
||||||
|
#define SPDLOG_LEVEL_NAME_TRACE spdlog::string_view_t("trace", 5)
|
||||||
|
#define SPDLOG_LEVEL_NAME_DEBUG spdlog::string_view_t("debug", 5)
|
||||||
|
#define SPDLOG_LEVEL_NAME_INFO spdlog::string_view_t("info", 4)
|
||||||
|
#define SPDLOG_LEVEL_NAME_WARNING spdlog::string_view_t("warning", 7)
|
||||||
|
#define SPDLOG_LEVEL_NAME_ERROR spdlog::string_view_t("error", 5)
|
||||||
|
#define SPDLOG_LEVEL_NAME_CRITICAL spdlog::string_view_t("critical", 8)
|
||||||
|
#define SPDLOG_LEVEL_NAME_OFF spdlog::string_view_t("off", 3)
|
||||||
|
|
||||||
|
#if !defined(SPDLOG_LEVEL_NAMES)
|
||||||
|
#define SPDLOG_LEVEL_NAMES \
|
||||||
|
{ \
|
||||||
|
SPDLOG_LEVEL_NAME_TRACE, SPDLOG_LEVEL_NAME_DEBUG, SPDLOG_LEVEL_NAME_INFO, \
|
||||||
|
SPDLOG_LEVEL_NAME_WARNING, SPDLOG_LEVEL_NAME_ERROR, SPDLOG_LEVEL_NAME_CRITICAL, \
|
||||||
|
SPDLOG_LEVEL_NAME_OFF \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(SPDLOG_SHORT_LEVEL_NAMES)
|
||||||
|
|
||||||
|
#define SPDLOG_SHORT_LEVEL_NAMES \
|
||||||
|
{ "T", "D", "I", "W", "E", "C", "O" }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
SPDLOG_API const string_view_t &to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT;
|
||||||
|
SPDLOG_API const char *to_short_c_str(spdlog::level::level_enum l) SPDLOG_NOEXCEPT;
|
||||||
|
SPDLOG_API spdlog::level::level_enum from_str(const std::string &name) SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
|
} // namespace level
|
||||||
|
|
||||||
|
//
|
||||||
|
// Color mode used by sinks with color support.
|
||||||
|
//
|
||||||
|
enum class color_mode { always, automatic, never };
|
||||||
|
|
||||||
|
//
|
||||||
|
// Pattern time - specific time getting to use for pattern_formatter.
|
||||||
|
// local time by default
|
||||||
|
//
|
||||||
|
enum class pattern_time_type {
|
||||||
|
local, // log localtime
|
||||||
|
utc // log utc
|
||||||
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
// Log exception
|
||||||
|
//
|
||||||
|
class SPDLOG_API spdlog_ex : public std::exception {
|
||||||
|
public:
|
||||||
|
explicit spdlog_ex(std::string msg);
|
||||||
|
spdlog_ex(const std::string &msg, int last_errno);
|
||||||
|
const char *what() const SPDLOG_NOEXCEPT override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string msg_;
|
||||||
|
};
|
||||||
|
|
||||||
|
[[noreturn]] SPDLOG_API void throw_spdlog_ex(const std::string &msg, int last_errno);
|
||||||
|
[[noreturn]] SPDLOG_API void throw_spdlog_ex(std::string msg);
|
||||||
|
|
||||||
|
struct source_loc {
|
||||||
|
SPDLOG_CONSTEXPR source_loc() = default;
|
||||||
|
SPDLOG_CONSTEXPR source_loc(const char *filename_in, int line_in, const char *funcname_in)
|
||||||
|
: filename{filename_in},
|
||||||
|
line{line_in},
|
||||||
|
funcname{funcname_in} {}
|
||||||
|
|
||||||
|
SPDLOG_CONSTEXPR bool empty() const SPDLOG_NOEXCEPT { return line <= 0; }
|
||||||
|
const char *filename{nullptr};
|
||||||
|
int line{0};
|
||||||
|
const char *funcname{nullptr};
|
||||||
|
};
|
||||||
|
|
||||||
|
struct file_event_handlers {
|
||||||
|
file_event_handlers()
|
||||||
|
: before_open(nullptr),
|
||||||
|
after_open(nullptr),
|
||||||
|
before_close(nullptr),
|
||||||
|
after_close(nullptr) {}
|
||||||
|
|
||||||
|
std::function<void(const filename_t &filename)> before_open;
|
||||||
|
std::function<void(const filename_t &filename, std::FILE *file_stream)> after_open;
|
||||||
|
std::function<void(const filename_t &filename, std::FILE *file_stream)> before_close;
|
||||||
|
std::function<void(const filename_t &filename)> after_close;
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace details {
|
||||||
|
|
||||||
|
// to_string_view
|
||||||
|
|
||||||
|
SPDLOG_CONSTEXPR_FUNC spdlog::string_view_t to_string_view(const memory_buf_t &buf)
|
||||||
|
SPDLOG_NOEXCEPT {
|
||||||
|
return spdlog::string_view_t{buf.data(), buf.size()};
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_CONSTEXPR_FUNC spdlog::string_view_t to_string_view(spdlog::string_view_t str)
|
||||||
|
SPDLOG_NOEXCEPT {
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT)
|
||||||
|
SPDLOG_CONSTEXPR_FUNC spdlog::wstring_view_t to_string_view(const wmemory_buf_t &buf)
|
||||||
|
SPDLOG_NOEXCEPT {
|
||||||
|
return spdlog::wstring_view_t{buf.data(), buf.size()};
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_CONSTEXPR_FUNC spdlog::wstring_view_t to_string_view(spdlog::wstring_view_t str)
|
||||||
|
SPDLOG_NOEXCEPT {
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(SPDLOG_USE_STD_FORMAT) && __cpp_lib_format >= 202207L
|
||||||
|
template <typename T, typename... Args>
|
||||||
|
SPDLOG_CONSTEXPR_FUNC std::basic_string_view<T> to_string_view(
|
||||||
|
std::basic_format_string<T, Args...> fmt) SPDLOG_NOEXCEPT {
|
||||||
|
return fmt.get();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// make_unique support for pre c++14
|
||||||
|
#if __cplusplus >= 201402L // C++14 and beyond
|
||||||
|
using std::enable_if_t;
|
||||||
|
using std::make_unique;
|
||||||
|
#else
|
||||||
|
template <bool B, class T = void>
|
||||||
|
using enable_if_t = typename std::enable_if<B, T>::type;
|
||||||
|
|
||||||
|
template <typename T, typename... Args>
|
||||||
|
std::unique_ptr<T> make_unique(Args &&...args) {
|
||||||
|
static_assert(!std::is_array<T>::value, "arrays not supported");
|
||||||
|
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// to avoid useless casts (see https://github.com/nlohmann/json/issues/2893#issuecomment-889152324)
|
||||||
|
template <typename T, typename U, enable_if_t<!std::is_same<T, U>::value, int> = 0>
|
||||||
|
constexpr T conditional_static_cast(U value) {
|
||||||
|
return static_cast<T>(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, typename U, enable_if_t<std::is_same<T, U>::value, int> = 0>
|
||||||
|
constexpr T conditional_static_cast(U value) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
|
|
||||||
|
#ifdef SPDLOG_HEADER_ONLY
|
||||||
|
#include "common-inl.h"
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
|
#include <spdlog/details/backtracer.h>
|
||||||
|
#endif
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
SPDLOG_INLINE backtracer::backtracer(const backtracer &other) {
|
||||||
|
std::lock_guard<std::mutex> lock(other.mutex_);
|
||||||
|
enabled_ = other.enabled();
|
||||||
|
messages_ = other.messages_;
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE backtracer::backtracer(backtracer &&other) SPDLOG_NOEXCEPT {
|
||||||
|
std::lock_guard<std::mutex> lock(other.mutex_);
|
||||||
|
enabled_ = other.enabled();
|
||||||
|
messages_ = std::move(other.messages_);
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE backtracer &backtracer::operator=(backtracer other) {
|
||||||
|
std::lock_guard<std::mutex> lock(mutex_);
|
||||||
|
enabled_ = other.enabled();
|
||||||
|
messages_ = std::move(other.messages_);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void backtracer::enable(size_t size) {
|
||||||
|
std::lock_guard<std::mutex> lock{mutex_};
|
||||||
|
enabled_.store(true, std::memory_order_relaxed);
|
||||||
|
messages_ = circular_q<log_msg_buffer>{size};
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void backtracer::disable() {
|
||||||
|
std::lock_guard<std::mutex> lock{mutex_};
|
||||||
|
enabled_.store(false, std::memory_order_relaxed);
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE bool backtracer::enabled() const { return enabled_.load(std::memory_order_relaxed); }
|
||||||
|
|
||||||
|
SPDLOG_INLINE void backtracer::push_back(const log_msg &msg) {
|
||||||
|
std::lock_guard<std::mutex> lock{mutex_};
|
||||||
|
messages_.push_back(log_msg_buffer{msg});
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE bool backtracer::empty() const {
|
||||||
|
std::lock_guard<std::mutex> lock{mutex_};
|
||||||
|
return messages_.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
// pop all items in the q and apply the given fun on each of them.
|
||||||
|
SPDLOG_INLINE void backtracer::foreach_pop(std::function<void(const details::log_msg &)> fun) {
|
||||||
|
std::lock_guard<std::mutex> lock{mutex_};
|
||||||
|
while (!messages_.empty()) {
|
||||||
|
auto &front_msg = messages_.front();
|
||||||
|
fun(front_msg);
|
||||||
|
messages_.pop_front();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <spdlog/details/circular_q.h>
|
||||||
|
#include <spdlog/details/log_msg_buffer.h>
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
|
#include <functional>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
|
// Store log messages in circular buffer.
|
||||||
|
// Useful for storing debug data in case of error/warning happens.
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
class SPDLOG_API backtracer {
|
||||||
|
mutable std::mutex mutex_;
|
||||||
|
std::atomic<bool> enabled_{false};
|
||||||
|
circular_q<log_msg_buffer> messages_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
backtracer() = default;
|
||||||
|
backtracer(const backtracer &other);
|
||||||
|
|
||||||
|
backtracer(backtracer &&other) SPDLOG_NOEXCEPT;
|
||||||
|
backtracer &operator=(backtracer other);
|
||||||
|
|
||||||
|
void enable(size_t size);
|
||||||
|
void disable();
|
||||||
|
bool enabled() const;
|
||||||
|
void push_back(const log_msg &msg);
|
||||||
|
bool empty() const;
|
||||||
|
|
||||||
|
// pop all items in the q and apply the given fun on each of them.
|
||||||
|
void foreach_pop(std::function<void(const details::log_msg &)> fun);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
|
|
||||||
|
#ifdef SPDLOG_HEADER_ONLY
|
||||||
|
#include "backtracer-inl.h"
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
// circular q view of std::vector.
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "spdlog/common.h"
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
template <typename T>
|
||||||
|
class circular_q {
|
||||||
|
size_t max_items_ = 0;
|
||||||
|
typename std::vector<T>::size_type head_ = 0;
|
||||||
|
typename std::vector<T>::size_type tail_ = 0;
|
||||||
|
size_t overrun_counter_ = 0;
|
||||||
|
std::vector<T> v_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
using value_type = T;
|
||||||
|
|
||||||
|
// empty ctor - create a disabled queue with no elements allocated at all
|
||||||
|
circular_q() = default;
|
||||||
|
|
||||||
|
explicit circular_q(size_t max_items)
|
||||||
|
: max_items_(max_items + 1) // one item is reserved as marker for full q
|
||||||
|
,
|
||||||
|
v_(max_items_) {}
|
||||||
|
|
||||||
|
circular_q(const circular_q &) = default;
|
||||||
|
circular_q &operator=(const circular_q &) = default;
|
||||||
|
|
||||||
|
// move cannot be default,
|
||||||
|
// since we need to reset head_, tail_, etc to zero in the moved object
|
||||||
|
circular_q(circular_q &&other) SPDLOG_NOEXCEPT { copy_moveable(std::move(other)); }
|
||||||
|
|
||||||
|
circular_q &operator=(circular_q &&other) SPDLOG_NOEXCEPT {
|
||||||
|
copy_moveable(std::move(other));
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// push back, overrun (oldest) item if no room left
|
||||||
|
void push_back(T &&item) {
|
||||||
|
if (max_items_ > 0) {
|
||||||
|
v_[tail_] = std::move(item);
|
||||||
|
tail_ = (tail_ + 1) % max_items_;
|
||||||
|
|
||||||
|
if (tail_ == head_) // overrun last item if full
|
||||||
|
{
|
||||||
|
head_ = (head_ + 1) % max_items_;
|
||||||
|
++overrun_counter_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return reference to the front item.
|
||||||
|
// If there are no elements in the container, the behavior is undefined.
|
||||||
|
const T &front() const { return v_[head_]; }
|
||||||
|
|
||||||
|
T &front() { return v_[head_]; }
|
||||||
|
|
||||||
|
// Return number of elements actually stored
|
||||||
|
size_t size() const {
|
||||||
|
if (tail_ >= head_) {
|
||||||
|
return tail_ - head_;
|
||||||
|
} else {
|
||||||
|
return max_items_ - (head_ - tail_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return const reference to item by index.
|
||||||
|
// If index is out of range 0…size()-1, the behavior is undefined.
|
||||||
|
const T &at(size_t i) const {
|
||||||
|
assert(i < size());
|
||||||
|
return v_[(head_ + i) % max_items_];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pop item from front.
|
||||||
|
// If there are no elements in the container, the behavior is undefined.
|
||||||
|
void pop_front() { head_ = (head_ + 1) % max_items_; }
|
||||||
|
|
||||||
|
bool empty() const { return tail_ == head_; }
|
||||||
|
|
||||||
|
bool full() const {
|
||||||
|
// head is ahead of the tail by 1
|
||||||
|
if (max_items_ > 0) {
|
||||||
|
return ((tail_ + 1) % max_items_) == head_;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t overrun_counter() const { return overrun_counter_; }
|
||||||
|
|
||||||
|
void reset_overrun_counter() { overrun_counter_ = 0; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
// copy from other&& and reset it to disabled state
|
||||||
|
void copy_moveable(circular_q &&other) SPDLOG_NOEXCEPT {
|
||||||
|
max_items_ = other.max_items_;
|
||||||
|
head_ = other.head_;
|
||||||
|
tail_ = other.tail_;
|
||||||
|
overrun_counter_ = other.overrun_counter_;
|
||||||
|
v_ = std::move(other.v_);
|
||||||
|
|
||||||
|
// put &&other in disabled, but valid state
|
||||||
|
other.max_items_ = 0;
|
||||||
|
other.head_ = other.tail_ = 0;
|
||||||
|
other.overrun_counter_ = 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
|
#include <spdlog/details/null_mutex.h>
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
|
||||||
|
struct console_mutex {
|
||||||
|
using mutex_t = std::mutex;
|
||||||
|
static mutex_t &mutex() {
|
||||||
|
static mutex_t s_mutex;
|
||||||
|
return s_mutex;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct console_nullmutex {
|
||||||
|
using mutex_t = null_mutex;
|
||||||
|
static mutex_t &mutex() {
|
||||||
|
static mutex_t s_mutex;
|
||||||
|
return s_mutex;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
|
#include <spdlog/details/file_helper.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <spdlog/common.h>
|
||||||
|
#include <spdlog/details/os.h>
|
||||||
|
|
||||||
|
#include <cerrno>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <string>
|
||||||
|
#include <tuple>
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
|
||||||
|
SPDLOG_INLINE file_helper::file_helper(const file_event_handlers &event_handlers)
|
||||||
|
: event_handlers_(event_handlers) {}
|
||||||
|
|
||||||
|
SPDLOG_INLINE file_helper::~file_helper() { close(); }
|
||||||
|
|
||||||
|
SPDLOG_INLINE void file_helper::open(const filename_t &fname, bool truncate) {
|
||||||
|
close();
|
||||||
|
filename_ = fname;
|
||||||
|
|
||||||
|
auto *mode = SPDLOG_FILENAME_T("ab");
|
||||||
|
auto *trunc_mode = SPDLOG_FILENAME_T("wb");
|
||||||
|
|
||||||
|
if (event_handlers_.before_open) {
|
||||||
|
event_handlers_.before_open(filename_);
|
||||||
|
}
|
||||||
|
for (int tries = 0; tries < open_tries_; ++tries) {
|
||||||
|
// create containing folder if not exists already.
|
||||||
|
os::create_dir(os::dir_name(fname));
|
||||||
|
if (truncate) {
|
||||||
|
// Truncate by opening-and-closing a tmp file in "wb" mode, always
|
||||||
|
// opening the actual log-we-write-to in "ab" mode, since that
|
||||||
|
// interacts more politely with eternal processes that might
|
||||||
|
// rotate/truncate the file underneath us.
|
||||||
|
std::FILE *tmp;
|
||||||
|
if (os::fopen_s(&tmp, fname, trunc_mode)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
std::fclose(tmp);
|
||||||
|
}
|
||||||
|
if (!os::fopen_s(&fd_, fname, mode)) {
|
||||||
|
if (event_handlers_.after_open) {
|
||||||
|
event_handlers_.after_open(filename_, fd_);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
details::os::sleep_for_millis(open_interval_);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw_spdlog_ex("Failed opening file " + os::filename_to_str(filename_) + " for writing",
|
||||||
|
errno);
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void file_helper::reopen(bool truncate) {
|
||||||
|
if (filename_.empty()) {
|
||||||
|
throw_spdlog_ex("Failed re opening file - was not opened before");
|
||||||
|
}
|
||||||
|
this->open(filename_, truncate);
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void file_helper::flush() {
|
||||||
|
if (std::fflush(fd_) != 0) {
|
||||||
|
throw_spdlog_ex("Failed flush to file " + os::filename_to_str(filename_), errno);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void file_helper::sync() {
|
||||||
|
if (!os::fsync(fd_)) {
|
||||||
|
throw_spdlog_ex("Failed to fsync file " + os::filename_to_str(filename_), errno);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void file_helper::close() {
|
||||||
|
if (fd_ != nullptr) {
|
||||||
|
if (event_handlers_.before_close) {
|
||||||
|
event_handlers_.before_close(filename_, fd_);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::fclose(fd_);
|
||||||
|
fd_ = nullptr;
|
||||||
|
|
||||||
|
if (event_handlers_.after_close) {
|
||||||
|
event_handlers_.after_close(filename_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void file_helper::write(const memory_buf_t &buf) {
|
||||||
|
if (fd_ == nullptr) return;
|
||||||
|
size_t msg_size = buf.size();
|
||||||
|
auto data = buf.data();
|
||||||
|
|
||||||
|
if (!details::os::fwrite_bytes(data, msg_size, fd_)) {
|
||||||
|
throw_spdlog_ex("Failed writing to file " + os::filename_to_str(filename_), errno);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE size_t file_helper::size() const {
|
||||||
|
if (fd_ == nullptr) {
|
||||||
|
throw_spdlog_ex("Cannot use size() on closed file " + os::filename_to_str(filename_));
|
||||||
|
}
|
||||||
|
return os::filesize(fd_);
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE const filename_t &file_helper::filename() const { return filename_; }
|
||||||
|
|
||||||
|
//
|
||||||
|
// return file path and its extension:
|
||||||
|
//
|
||||||
|
// "mylog.txt" => ("mylog", ".txt")
|
||||||
|
// "mylog" => ("mylog", "")
|
||||||
|
// "mylog." => ("mylog.", "")
|
||||||
|
// "/dir1/dir2/mylog.txt" => ("/dir1/dir2/mylog", ".txt")
|
||||||
|
//
|
||||||
|
// the starting dot in filenames is ignored (hidden files):
|
||||||
|
//
|
||||||
|
// ".mylog" => (".mylog". "")
|
||||||
|
// "my_folder/.mylog" => ("my_folder/.mylog", "")
|
||||||
|
// "my_folder/.mylog.txt" => ("my_folder/.mylog", ".txt")
|
||||||
|
SPDLOG_INLINE std::tuple<filename_t, filename_t> file_helper::split_by_extension(
|
||||||
|
const filename_t &fname) {
|
||||||
|
auto ext_index = fname.rfind('.');
|
||||||
|
|
||||||
|
// no valid extension found - return whole path and empty string as
|
||||||
|
// extension
|
||||||
|
if (ext_index == filename_t::npos || ext_index == 0 || ext_index == fname.size() - 1) {
|
||||||
|
return std::make_tuple(fname, filename_t());
|
||||||
|
}
|
||||||
|
|
||||||
|
// treat cases like "/etc/rc.d/somelogfile or "/abc/.hiddenfile"
|
||||||
|
auto folder_index = fname.find_last_of(details::os::folder_seps_filename);
|
||||||
|
if (folder_index != filename_t::npos && folder_index >= ext_index - 1) {
|
||||||
|
return std::make_tuple(fname, filename_t());
|
||||||
|
}
|
||||||
|
|
||||||
|
// finally - return a valid base and extension tuple
|
||||||
|
return std::make_tuple(fname.substr(0, ext_index), fname.substr(ext_index));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <spdlog/common.h>
|
||||||
|
#include <tuple>
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
|
||||||
|
// Helper class for file sinks.
|
||||||
|
// When failing to open a file, retry several times(5) with a delay interval(10 ms).
|
||||||
|
// Throw spdlog_ex exception on errors.
|
||||||
|
|
||||||
|
class SPDLOG_API file_helper {
|
||||||
|
public:
|
||||||
|
file_helper() = default;
|
||||||
|
explicit file_helper(const file_event_handlers &event_handlers);
|
||||||
|
|
||||||
|
file_helper(const file_helper &) = delete;
|
||||||
|
file_helper &operator=(const file_helper &) = delete;
|
||||||
|
~file_helper();
|
||||||
|
|
||||||
|
void open(const filename_t &fname, bool truncate = false);
|
||||||
|
void reopen(bool truncate);
|
||||||
|
void flush();
|
||||||
|
void sync();
|
||||||
|
void close();
|
||||||
|
void write(const memory_buf_t &buf);
|
||||||
|
size_t size() const;
|
||||||
|
const filename_t &filename() const;
|
||||||
|
|
||||||
|
//
|
||||||
|
// return file path and its extension:
|
||||||
|
//
|
||||||
|
// "mylog.txt" => ("mylog", ".txt")
|
||||||
|
// "mylog" => ("mylog", "")
|
||||||
|
// "mylog." => ("mylog.", "")
|
||||||
|
// "/dir1/dir2/mylog.txt" => ("/dir1/dir2/mylog", ".txt")
|
||||||
|
//
|
||||||
|
// the starting dot in filenames is ignored (hidden files):
|
||||||
|
//
|
||||||
|
// ".mylog" => (".mylog". "")
|
||||||
|
// "my_folder/.mylog" => ("my_folder/.mylog", "")
|
||||||
|
// "my_folder/.mylog.txt" => ("my_folder/.mylog", ".txt")
|
||||||
|
static std::tuple<filename_t, filename_t> split_by_extension(const filename_t &fname);
|
||||||
|
|
||||||
|
private:
|
||||||
|
const int open_tries_ = 5;
|
||||||
|
const unsigned int open_interval_ = 10;
|
||||||
|
std::FILE *fd_{nullptr};
|
||||||
|
filename_t filename_;
|
||||||
|
file_event_handlers event_handlers_;
|
||||||
|
};
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
|
|
||||||
|
#ifdef SPDLOG_HEADER_ONLY
|
||||||
|
#include "file_helper-inl.h"
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <iterator>
|
||||||
|
#include <spdlog/common.h>
|
||||||
|
#include <spdlog/fmt/fmt.h>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
|
#ifdef SPDLOG_USE_STD_FORMAT
|
||||||
|
#include <charconv>
|
||||||
|
#include <limits>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Some fmt helpers to efficiently format and pad ints and strings
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
namespace fmt_helper {
|
||||||
|
|
||||||
|
inline void append_string_view(spdlog::string_view_t view, memory_buf_t &dest) {
|
||||||
|
auto *buf_ptr = view.data();
|
||||||
|
dest.append(buf_ptr, buf_ptr + view.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef SPDLOG_USE_STD_FORMAT
|
||||||
|
template <typename T>
|
||||||
|
inline void append_int(T n, memory_buf_t &dest) {
|
||||||
|
// Buffer should be large enough to hold all digits (digits10 + 1) and a sign
|
||||||
|
SPDLOG_CONSTEXPR const auto BUF_SIZE = std::numeric_limits<T>::digits10 + 2;
|
||||||
|
char buf[BUF_SIZE];
|
||||||
|
|
||||||
|
auto [ptr, ec] = std::to_chars(buf, buf + BUF_SIZE, n, 10);
|
||||||
|
if (ec == std::errc()) {
|
||||||
|
dest.append(buf, ptr);
|
||||||
|
} else {
|
||||||
|
throw_spdlog_ex("Failed to format int", static_cast<int>(ec));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
template <typename T>
|
||||||
|
inline void append_int(T n, memory_buf_t &dest) {
|
||||||
|
fmt::format_int i(n);
|
||||||
|
dest.append(i.data(), i.data() + i.size());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
SPDLOG_CONSTEXPR_FUNC unsigned int count_digits_fallback(T n) {
|
||||||
|
// taken from fmt: https://github.com/fmtlib/fmt/blob/8.0.1/include/fmt/format.h#L899-L912
|
||||||
|
unsigned int count = 1;
|
||||||
|
for (;;) {
|
||||||
|
// Integer division is slow so do it for a group of four digits instead
|
||||||
|
// of for every digit. The idea comes from the talk by Alexandrescu
|
||||||
|
// "Three Optimization Tips for C++". See speed-test for a comparison.
|
||||||
|
if (n < 10) return count;
|
||||||
|
if (n < 100) return count + 1;
|
||||||
|
if (n < 1000) return count + 2;
|
||||||
|
if (n < 10000) return count + 3;
|
||||||
|
n /= 10000u;
|
||||||
|
count += 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
inline unsigned int count_digits(T n) {
|
||||||
|
using count_type =
|
||||||
|
typename std::conditional<(sizeof(T) > sizeof(uint32_t)), uint64_t, uint32_t>::type;
|
||||||
|
#ifdef SPDLOG_USE_STD_FORMAT
|
||||||
|
return count_digits_fallback(static_cast<count_type>(n));
|
||||||
|
#else
|
||||||
|
return static_cast<unsigned int>(fmt::
|
||||||
|
// fmt 7.0.0 renamed the internal namespace to detail.
|
||||||
|
// See: https://github.com/fmtlib/fmt/issues/1538
|
||||||
|
#if FMT_VERSION < 70000
|
||||||
|
internal
|
||||||
|
#else
|
||||||
|
detail
|
||||||
|
#endif
|
||||||
|
::count_digits(static_cast<count_type>(n)));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void pad2(int n, memory_buf_t &dest) {
|
||||||
|
if (n >= 0 && n < 100) // 0-99
|
||||||
|
{
|
||||||
|
dest.push_back(static_cast<char>('0' + n / 10));
|
||||||
|
dest.push_back(static_cast<char>('0' + n % 10));
|
||||||
|
} else // unlikely, but just in case, let fmt deal with it
|
||||||
|
{
|
||||||
|
fmt_lib::format_to(std::back_inserter(dest), SPDLOG_FMT_STRING("{:02}"), n);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
inline void pad_uint(T n, unsigned int width, memory_buf_t &dest) {
|
||||||
|
static_assert(std::is_unsigned<T>::value, "pad_uint must get unsigned T");
|
||||||
|
for (auto digits = count_digits(n); digits < width; digits++) {
|
||||||
|
dest.push_back('0');
|
||||||
|
}
|
||||||
|
append_int(n, dest);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
inline void pad3(T n, memory_buf_t &dest) {
|
||||||
|
static_assert(std::is_unsigned<T>::value, "pad3 must get unsigned T");
|
||||||
|
if (n < 1000) {
|
||||||
|
dest.push_back(static_cast<char>(n / 100 + '0'));
|
||||||
|
n = n % 100;
|
||||||
|
dest.push_back(static_cast<char>((n / 10) + '0'));
|
||||||
|
dest.push_back(static_cast<char>((n % 10) + '0'));
|
||||||
|
} else {
|
||||||
|
append_int(n, dest);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
inline void pad6(T n, memory_buf_t &dest) {
|
||||||
|
pad_uint(n, 6, dest);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
inline void pad9(T n, memory_buf_t &dest) {
|
||||||
|
pad_uint(n, 9, dest);
|
||||||
|
}
|
||||||
|
|
||||||
|
// return fraction of a second of the given time_point.
|
||||||
|
// e.g.
|
||||||
|
// fraction<std::milliseconds>(tp) -> will return the millis part of the second
|
||||||
|
template <typename ToDuration>
|
||||||
|
inline ToDuration time_fraction(log_clock::time_point tp) {
|
||||||
|
using std::chrono::duration_cast;
|
||||||
|
using std::chrono::seconds;
|
||||||
|
auto duration = tp.time_since_epoch();
|
||||||
|
auto secs = duration_cast<seconds>(duration);
|
||||||
|
return duration_cast<ToDuration>(duration) - duration_cast<ToDuration>(secs);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace fmt_helper
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
|
#include <spdlog/details/log_msg.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <spdlog/details/os.h>
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
|
||||||
|
SPDLOG_INLINE log_msg::log_msg(spdlog::log_clock::time_point log_time,
|
||||||
|
spdlog::source_loc loc,
|
||||||
|
string_view_t a_logger_name,
|
||||||
|
spdlog::level::level_enum lvl,
|
||||||
|
spdlog::string_view_t msg)
|
||||||
|
: logger_name(a_logger_name),
|
||||||
|
level(lvl),
|
||||||
|
time(log_time)
|
||||||
|
#ifndef SPDLOG_NO_THREAD_ID
|
||||||
|
,
|
||||||
|
thread_id(os::thread_id())
|
||||||
|
#endif
|
||||||
|
,
|
||||||
|
source(loc),
|
||||||
|
payload(msg) {
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE log_msg::log_msg(spdlog::source_loc loc,
|
||||||
|
string_view_t a_logger_name,
|
||||||
|
spdlog::level::level_enum lvl,
|
||||||
|
spdlog::string_view_t msg)
|
||||||
|
: log_msg(os::now(), loc, a_logger_name, lvl, msg) {}
|
||||||
|
|
||||||
|
SPDLOG_INLINE log_msg::log_msg(string_view_t a_logger_name,
|
||||||
|
spdlog::level::level_enum lvl,
|
||||||
|
spdlog::string_view_t msg)
|
||||||
|
: log_msg(os::now(), source_loc{}, a_logger_name, lvl, msg) {}
|
||||||
|
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <spdlog/common.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
struct SPDLOG_API log_msg {
|
||||||
|
log_msg() = default;
|
||||||
|
log_msg(log_clock::time_point log_time,
|
||||||
|
source_loc loc,
|
||||||
|
string_view_t logger_name,
|
||||||
|
level::level_enum lvl,
|
||||||
|
string_view_t msg);
|
||||||
|
log_msg(source_loc loc, string_view_t logger_name, level::level_enum lvl, string_view_t msg);
|
||||||
|
log_msg(string_view_t logger_name, level::level_enum lvl, string_view_t msg);
|
||||||
|
log_msg(const log_msg &other) = default;
|
||||||
|
log_msg &operator=(const log_msg &other) = default;
|
||||||
|
|
||||||
|
string_view_t logger_name;
|
||||||
|
level::level_enum level{level::off};
|
||||||
|
log_clock::time_point time;
|
||||||
|
size_t thread_id{0};
|
||||||
|
|
||||||
|
// wrapping the formatted text with color (updated by pattern_formatter).
|
||||||
|
mutable size_t color_range_start{0};
|
||||||
|
mutable size_t color_range_end{0};
|
||||||
|
|
||||||
|
source_loc source;
|
||||||
|
string_view_t payload;
|
||||||
|
};
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
|
|
||||||
|
#ifdef SPDLOG_HEADER_ONLY
|
||||||
|
#include "log_msg-inl.h"
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
|
#include <spdlog/details/log_msg_buffer.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
|
||||||
|
SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg &orig_msg)
|
||||||
|
: log_msg{orig_msg} {
|
||||||
|
buffer.append(logger_name.begin(), logger_name.end());
|
||||||
|
buffer.append(payload.begin(), payload.end());
|
||||||
|
update_string_views();
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg_buffer &other)
|
||||||
|
: log_msg{other} {
|
||||||
|
buffer.append(logger_name.begin(), logger_name.end());
|
||||||
|
buffer.append(payload.begin(), payload.end());
|
||||||
|
update_string_views();
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE log_msg_buffer::log_msg_buffer(log_msg_buffer &&other) SPDLOG_NOEXCEPT
|
||||||
|
: log_msg{other},
|
||||||
|
buffer{std::move(other.buffer)} {
|
||||||
|
update_string_views();
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(const log_msg_buffer &other) {
|
||||||
|
log_msg::operator=(other);
|
||||||
|
buffer.clear();
|
||||||
|
buffer.append(other.buffer.data(), other.buffer.data() + other.buffer.size());
|
||||||
|
update_string_views();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(log_msg_buffer &&other) SPDLOG_NOEXCEPT {
|
||||||
|
log_msg::operator=(other);
|
||||||
|
buffer = std::move(other.buffer);
|
||||||
|
update_string_views();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void log_msg_buffer::update_string_views() {
|
||||||
|
logger_name = string_view_t{buffer.data(), logger_name.size()};
|
||||||
|
payload = string_view_t{buffer.data() + logger_name.size(), payload.size()};
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <spdlog/details/log_msg.h>
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
|
||||||
|
// Extend log_msg with internal buffer to store its payload.
|
||||||
|
// This is needed since log_msg holds string_views that points to stack data.
|
||||||
|
|
||||||
|
class SPDLOG_API log_msg_buffer : public log_msg {
|
||||||
|
memory_buf_t buffer;
|
||||||
|
void update_string_views();
|
||||||
|
|
||||||
|
public:
|
||||||
|
log_msg_buffer() = default;
|
||||||
|
explicit log_msg_buffer(const log_msg &orig_msg);
|
||||||
|
log_msg_buffer(const log_msg_buffer &other);
|
||||||
|
log_msg_buffer(log_msg_buffer &&other) SPDLOG_NOEXCEPT;
|
||||||
|
log_msg_buffer &operator=(const log_msg_buffer &other);
|
||||||
|
log_msg_buffer &operator=(log_msg_buffer &&other) SPDLOG_NOEXCEPT;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
|
|
||||||
|
#ifdef SPDLOG_HEADER_ONLY
|
||||||
|
#include "log_msg_buffer-inl.h"
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,177 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// multi producer-multi consumer blocking queue.
|
||||||
|
// enqueue(..) - will block until room found to put the new message.
|
||||||
|
// enqueue_nowait(..) - enqueue immediately. overruns oldest message if no
|
||||||
|
// room left.
|
||||||
|
// dequeue_for(..) - will block until the queue is not empty or timeout have
|
||||||
|
// passed.
|
||||||
|
|
||||||
|
#include <spdlog/details/circular_q.h>
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
|
#include <condition_variable>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
class mpmc_blocking_queue {
|
||||||
|
public:
|
||||||
|
using item_type = T;
|
||||||
|
explicit mpmc_blocking_queue(size_t max_items)
|
||||||
|
: q_(max_items) {}
|
||||||
|
|
||||||
|
#ifndef __MINGW32__
|
||||||
|
// try to enqueue and block if no room left
|
||||||
|
void enqueue(T &&item) {
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(queue_mutex_);
|
||||||
|
pop_cv_.wait(lock, [this] { return !this->q_.full(); });
|
||||||
|
q_.push_back(std::move(item));
|
||||||
|
}
|
||||||
|
push_cv_.notify_one();
|
||||||
|
}
|
||||||
|
|
||||||
|
// enqueue immediately. overrun oldest message in the queue if no room left.
|
||||||
|
void enqueue_nowait(T &&item) {
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(queue_mutex_);
|
||||||
|
q_.push_back(std::move(item));
|
||||||
|
}
|
||||||
|
push_cv_.notify_one();
|
||||||
|
}
|
||||||
|
|
||||||
|
void enqueue_if_have_room(T &&item) {
|
||||||
|
bool pushed = false;
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(queue_mutex_);
|
||||||
|
if (!q_.full()) {
|
||||||
|
q_.push_back(std::move(item));
|
||||||
|
pushed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pushed) {
|
||||||
|
push_cv_.notify_one();
|
||||||
|
} else {
|
||||||
|
++discard_counter_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// dequeue with a timeout.
|
||||||
|
// Return true, if succeeded dequeue item, false otherwise
|
||||||
|
bool dequeue_for(T &popped_item, std::chrono::milliseconds wait_duration) {
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(queue_mutex_);
|
||||||
|
if (!push_cv_.wait_for(lock, wait_duration, [this] { return !this->q_.empty(); })) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
popped_item = std::move(q_.front());
|
||||||
|
q_.pop_front();
|
||||||
|
}
|
||||||
|
pop_cv_.notify_one();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// blocking dequeue without a timeout.
|
||||||
|
void dequeue(T &popped_item) {
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(queue_mutex_);
|
||||||
|
push_cv_.wait(lock, [this] { return !this->q_.empty(); });
|
||||||
|
popped_item = std::move(q_.front());
|
||||||
|
q_.pop_front();
|
||||||
|
}
|
||||||
|
pop_cv_.notify_one();
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
// apparently mingw deadlocks if the mutex is released before cv.notify_one(),
|
||||||
|
// so release the mutex at the very end each function.
|
||||||
|
|
||||||
|
// try to enqueue and block if no room left
|
||||||
|
void enqueue(T &&item) {
|
||||||
|
std::unique_lock<std::mutex> lock(queue_mutex_);
|
||||||
|
pop_cv_.wait(lock, [this] { return !this->q_.full(); });
|
||||||
|
q_.push_back(std::move(item));
|
||||||
|
push_cv_.notify_one();
|
||||||
|
}
|
||||||
|
|
||||||
|
// enqueue immediately. overrun oldest message in the queue if no room left.
|
||||||
|
void enqueue_nowait(T &&item) {
|
||||||
|
std::unique_lock<std::mutex> lock(queue_mutex_);
|
||||||
|
q_.push_back(std::move(item));
|
||||||
|
push_cv_.notify_one();
|
||||||
|
}
|
||||||
|
|
||||||
|
void enqueue_if_have_room(T &&item) {
|
||||||
|
bool pushed = false;
|
||||||
|
std::unique_lock<std::mutex> lock(queue_mutex_);
|
||||||
|
if (!q_.full()) {
|
||||||
|
q_.push_back(std::move(item));
|
||||||
|
pushed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pushed) {
|
||||||
|
push_cv_.notify_one();
|
||||||
|
} else {
|
||||||
|
++discard_counter_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// dequeue with a timeout.
|
||||||
|
// Return true, if succeeded dequeue item, false otherwise
|
||||||
|
bool dequeue_for(T &popped_item, std::chrono::milliseconds wait_duration) {
|
||||||
|
std::unique_lock<std::mutex> lock(queue_mutex_);
|
||||||
|
if (!push_cv_.wait_for(lock, wait_duration, [this] { return !this->q_.empty(); })) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
popped_item = std::move(q_.front());
|
||||||
|
q_.pop_front();
|
||||||
|
pop_cv_.notify_one();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// blocking dequeue without a timeout.
|
||||||
|
void dequeue(T &popped_item) {
|
||||||
|
std::unique_lock<std::mutex> lock(queue_mutex_);
|
||||||
|
push_cv_.wait(lock, [this] { return !this->q_.empty(); });
|
||||||
|
popped_item = std::move(q_.front());
|
||||||
|
q_.pop_front();
|
||||||
|
pop_cv_.notify_one();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
size_t overrun_counter() {
|
||||||
|
std::lock_guard<std::mutex> lock(queue_mutex_);
|
||||||
|
return q_.overrun_counter();
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t discard_counter() { return discard_counter_.load(std::memory_order_relaxed); }
|
||||||
|
|
||||||
|
size_t size() {
|
||||||
|
std::lock_guard<std::mutex> lock(queue_mutex_);
|
||||||
|
return q_.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
void reset_overrun_counter() {
|
||||||
|
std::lock_guard<std::mutex> lock(queue_mutex_);
|
||||||
|
q_.reset_overrun_counter();
|
||||||
|
}
|
||||||
|
|
||||||
|
void reset_discard_counter() { discard_counter_.store(0, std::memory_order_relaxed); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::mutex queue_mutex_;
|
||||||
|
std::condition_variable push_cv_;
|
||||||
|
std::condition_variable pop_cv_;
|
||||||
|
spdlog::details::circular_q<T> q_;
|
||||||
|
std::atomic<size_t> discard_counter_{0};
|
||||||
|
};
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
|
#include <utility>
|
||||||
|
// null, no cost dummy "mutex" and dummy "atomic" int
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
struct null_mutex {
|
||||||
|
void lock() const {}
|
||||||
|
void unlock() const {}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct null_atomic_int {
|
||||||
|
int value;
|
||||||
|
null_atomic_int() = default;
|
||||||
|
|
||||||
|
explicit null_atomic_int(int new_value)
|
||||||
|
: value(new_value) {}
|
||||||
|
|
||||||
|
int load(std::memory_order = std::memory_order_relaxed) const { return value; }
|
||||||
|
|
||||||
|
void store(int new_value, std::memory_order = std::memory_order_relaxed) { value = new_value; }
|
||||||
|
|
||||||
|
int exchange(int new_value, std::memory_order = std::memory_order_relaxed) {
|
||||||
|
std::swap(new_value, value);
|
||||||
|
return new_value; // return value before the call
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
@@ -0,0 +1,570 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
|
#include <spdlog/details/os.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <spdlog/common.h>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <array>
|
||||||
|
#include <chrono>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cstring>
|
||||||
|
#include <ctime>
|
||||||
|
#include <string>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <spdlog/details/windows_include.h>
|
||||||
|
#include <io.h> // for _get_osfhandle, _isatty, _fileno
|
||||||
|
#include <process.h> // for _get_pid
|
||||||
|
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
#include <share.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) || defined(SPDLOG_WCHAR_FILENAMES)
|
||||||
|
#include <cassert>
|
||||||
|
#include <limits>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <direct.h> // for _mkdir/_wmkdir
|
||||||
|
|
||||||
|
#else // unix
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
#include <sys/syscall.h> //Use gettid() syscall under linux to get thread id
|
||||||
|
|
||||||
|
#elif defined(_AIX)
|
||||||
|
#include <pthread.h> // for pthread_getthrds_np
|
||||||
|
|
||||||
|
#elif defined(__DragonFly__) || defined(__FreeBSD__)
|
||||||
|
#include <pthread_np.h> // for pthread_getthreadid_np
|
||||||
|
|
||||||
|
#elif defined(__NetBSD__)
|
||||||
|
#include <lwp.h> // for _lwp_self
|
||||||
|
|
||||||
|
#elif defined(__sun)
|
||||||
|
#include <thread.h> // for thr_self
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // unix
|
||||||
|
|
||||||
|
#if defined __APPLE__
|
||||||
|
#include <AvailabilityMacros.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __has_feature // Clang - feature checking macros.
|
||||||
|
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
namespace os {
|
||||||
|
|
||||||
|
SPDLOG_INLINE spdlog::log_clock::time_point now() SPDLOG_NOEXCEPT {
|
||||||
|
#if defined __linux__ && defined SPDLOG_CLOCK_COARSE
|
||||||
|
timespec ts;
|
||||||
|
::clock_gettime(CLOCK_REALTIME_COARSE, &ts);
|
||||||
|
return std::chrono::time_point<log_clock, typename log_clock::duration>(
|
||||||
|
std::chrono::duration_cast<typename log_clock::duration>(
|
||||||
|
std::chrono::seconds(ts.tv_sec) + std::chrono::nanoseconds(ts.tv_nsec)));
|
||||||
|
|
||||||
|
#else
|
||||||
|
return log_clock::now();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
SPDLOG_INLINE std::tm localtime(const std::time_t &time_tt) SPDLOG_NOEXCEPT {
|
||||||
|
#ifdef _WIN32
|
||||||
|
std::tm tm;
|
||||||
|
::localtime_s(&tm, &time_tt);
|
||||||
|
#else
|
||||||
|
std::tm tm;
|
||||||
|
::localtime_r(&time_tt, &tm);
|
||||||
|
#endif
|
||||||
|
return tm;
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE std::tm localtime() SPDLOG_NOEXCEPT {
|
||||||
|
std::time_t now_t = ::time(nullptr);
|
||||||
|
return localtime(now_t);
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE std::tm gmtime(const std::time_t &time_tt) SPDLOG_NOEXCEPT {
|
||||||
|
#ifdef _WIN32
|
||||||
|
std::tm tm;
|
||||||
|
::gmtime_s(&tm, &time_tt);
|
||||||
|
#else
|
||||||
|
std::tm tm;
|
||||||
|
::gmtime_r(&time_tt, &tm);
|
||||||
|
#endif
|
||||||
|
return tm;
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE std::tm gmtime() SPDLOG_NOEXCEPT {
|
||||||
|
std::time_t now_t = ::time(nullptr);
|
||||||
|
return gmtime(now_t);
|
||||||
|
}
|
||||||
|
|
||||||
|
// fopen_s on non windows for writing
|
||||||
|
SPDLOG_INLINE bool fopen_s(FILE **fp, const filename_t &filename, const filename_t &mode) {
|
||||||
|
#ifdef _WIN32
|
||||||
|
#ifdef SPDLOG_WCHAR_FILENAMES
|
||||||
|
*fp = ::_wfsopen((filename.c_str()), mode.c_str(), _SH_DENYNO);
|
||||||
|
#else
|
||||||
|
*fp = ::_fsopen((filename.c_str()), mode.c_str(), _SH_DENYNO);
|
||||||
|
#endif
|
||||||
|
#if defined(SPDLOG_PREVENT_CHILD_FD)
|
||||||
|
if (*fp != nullptr) {
|
||||||
|
auto file_handle = reinterpret_cast<HANDLE>(_get_osfhandle(::_fileno(*fp)));
|
||||||
|
if (!::SetHandleInformation(file_handle, HANDLE_FLAG_INHERIT, 0)) {
|
||||||
|
::fclose(*fp);
|
||||||
|
*fp = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#else // unix
|
||||||
|
#if defined(SPDLOG_PREVENT_CHILD_FD)
|
||||||
|
const int mode_flag = mode == SPDLOG_FILENAME_T("ab") ? O_APPEND : O_TRUNC;
|
||||||
|
const int fd =
|
||||||
|
::open((filename.c_str()), O_CREAT | O_WRONLY | O_CLOEXEC | mode_flag, mode_t(0644));
|
||||||
|
if (fd == -1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
*fp = ::fdopen(fd, mode.c_str());
|
||||||
|
if (*fp == nullptr) {
|
||||||
|
::close(fd);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
*fp = ::fopen((filename.c_str()), mode.c_str());
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return *fp == nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE int remove(const filename_t &filename) SPDLOG_NOEXCEPT {
|
||||||
|
#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES)
|
||||||
|
return ::_wremove(filename.c_str());
|
||||||
|
#else
|
||||||
|
return std::remove(filename.c_str());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE int remove_if_exists(const filename_t &filename) SPDLOG_NOEXCEPT {
|
||||||
|
return path_exists(filename) ? remove(filename) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE int rename(const filename_t &filename1, const filename_t &filename2) SPDLOG_NOEXCEPT {
|
||||||
|
#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES)
|
||||||
|
return ::_wrename(filename1.c_str(), filename2.c_str());
|
||||||
|
#else
|
||||||
|
return std::rename(filename1.c_str(), filename2.c_str());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return true if path exists (file or directory)
|
||||||
|
SPDLOG_INLINE bool path_exists(const filename_t &filename) SPDLOG_NOEXCEPT {
|
||||||
|
#ifdef _WIN32
|
||||||
|
struct _stat buffer;
|
||||||
|
#ifdef SPDLOG_WCHAR_FILENAMES
|
||||||
|
return (::_wstat(filename.c_str(), &buffer) == 0);
|
||||||
|
#else
|
||||||
|
return (::_stat(filename.c_str(), &buffer) == 0);
|
||||||
|
#endif
|
||||||
|
#else // common linux/unix all have the stat system call
|
||||||
|
struct stat buffer;
|
||||||
|
return (::stat(filename.c_str(), &buffer) == 0);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
// avoid warning about unreachable statement at the end of filesize()
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 4702)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Return file size according to open FILE* object
|
||||||
|
SPDLOG_INLINE size_t filesize(FILE *f) {
|
||||||
|
if (f == nullptr) {
|
||||||
|
throw_spdlog_ex("Failed getting file size. fd is null");
|
||||||
|
}
|
||||||
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
|
int fd = ::_fileno(f);
|
||||||
|
#if defined(_WIN64) // 64 bits
|
||||||
|
__int64 ret = ::_filelengthi64(fd);
|
||||||
|
if (ret >= 0) {
|
||||||
|
return static_cast<size_t>(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else // windows 32 bits
|
||||||
|
long ret = ::_filelength(fd);
|
||||||
|
if (ret >= 0) {
|
||||||
|
return static_cast<size_t>(ret);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else // unix
|
||||||
|
// OpenBSD and AIX doesn't compile with :: before the fileno(..)
|
||||||
|
#if defined(__OpenBSD__) || defined(_AIX)
|
||||||
|
int fd = fileno(f);
|
||||||
|
#else
|
||||||
|
int fd = ::fileno(f);
|
||||||
|
#endif
|
||||||
|
// 64 bits(but not in osx, linux/musl or cygwin, where fstat64 is deprecated)
|
||||||
|
#if ((defined(__linux__) && defined(__GLIBC__)) || defined(__sun) || defined(_AIX)) && \
|
||||||
|
(defined(__LP64__) || defined(_LP64))
|
||||||
|
struct stat64 st;
|
||||||
|
if (::fstat64(fd, &st) == 0) {
|
||||||
|
return static_cast<size_t>(st.st_size);
|
||||||
|
}
|
||||||
|
#else // other unix or linux 32 bits or cygwin
|
||||||
|
struct stat st;
|
||||||
|
if (::fstat(fd, &st) == 0) {
|
||||||
|
return static_cast<size_t>(st.st_size);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
throw_spdlog_ex("Failed getting file size from fd", errno);
|
||||||
|
return 0; // will not be reached.
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(SPDLOG_NO_TZ_OFFSET)
|
||||||
|
#ifdef _WIN32
|
||||||
|
// Compare the timestamp as Local (mktime) vs UTC (_mkgmtime) to get the offset.
|
||||||
|
SPDLOG_INLINE int utc_minutes_offset(const std::tm &tm) {
|
||||||
|
std::tm local_tm = tm; // copy since mktime might adjust it (normalize dates, set tm_isdst)
|
||||||
|
std::time_t local_time_t = std::mktime(&local_tm);
|
||||||
|
if (local_time_t == -1) {
|
||||||
|
return 0; // fallback
|
||||||
|
}
|
||||||
|
|
||||||
|
std::time_t utc_time_t = _mkgmtime(&local_tm);
|
||||||
|
if (utc_time_t == -1) {
|
||||||
|
return 0; // fallback
|
||||||
|
}
|
||||||
|
auto offset_seconds = utc_time_t - local_time_t;
|
||||||
|
return static_cast<int>(offset_seconds / 60);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
// On unix simply use tm_gmtoff
|
||||||
|
SPDLOG_INLINE int utc_minutes_offset(const std::tm &tm) {
|
||||||
|
return static_cast<int>(tm.tm_gmtoff / 60);
|
||||||
|
}
|
||||||
|
#endif // _WIN32
|
||||||
|
#endif // SPDLOG_NO_TZ_OFFSET
|
||||||
|
|
||||||
|
// Return current thread id as size_t
|
||||||
|
// It exists because the std::this_thread::get_id() is much slower(especially
|
||||||
|
// under VS 2013)
|
||||||
|
SPDLOG_INLINE size_t _thread_id() SPDLOG_NOEXCEPT {
|
||||||
|
#ifdef _WIN32
|
||||||
|
return static_cast<size_t>(::GetCurrentThreadId());
|
||||||
|
#elif defined(__linux__)
|
||||||
|
#if defined(__ANDROID__) && defined(__ANDROID_API__) && (__ANDROID_API__ < 21)
|
||||||
|
#define SYS_gettid __NR_gettid
|
||||||
|
#endif
|
||||||
|
return static_cast<size_t>(::syscall(SYS_gettid));
|
||||||
|
#elif defined(_AIX)
|
||||||
|
struct __pthrdsinfo buf;
|
||||||
|
int reg_size = 0;
|
||||||
|
pthread_t pt = pthread_self();
|
||||||
|
int retval = pthread_getthrds_np(&pt, PTHRDSINFO_QUERY_TID, &buf, sizeof(buf), NULL, ®_size);
|
||||||
|
int tid = (!retval) ? buf.__pi_tid : 0;
|
||||||
|
return static_cast<size_t>(tid);
|
||||||
|
#elif defined(__DragonFly__) || defined(__FreeBSD__)
|
||||||
|
return static_cast<size_t>(::pthread_getthreadid_np());
|
||||||
|
#elif defined(__NetBSD__)
|
||||||
|
return static_cast<size_t>(::_lwp_self());
|
||||||
|
#elif defined(__OpenBSD__)
|
||||||
|
return static_cast<size_t>(::getthrid());
|
||||||
|
#elif defined(__sun)
|
||||||
|
return static_cast<size_t>(::thr_self());
|
||||||
|
#elif __APPLE__
|
||||||
|
uint64_t tid;
|
||||||
|
// There is no pthread_threadid_np prior to Mac OS X 10.6, and it is not supported on any PPC,
|
||||||
|
// including 10.6.8 Rosetta. __POWERPC__ is Apple-specific define encompassing ppc and ppc64.
|
||||||
|
#ifdef MAC_OS_X_VERSION_MAX_ALLOWED
|
||||||
|
{
|
||||||
|
#if (MAC_OS_X_VERSION_MAX_ALLOWED < 1060) || defined(__POWERPC__)
|
||||||
|
tid = pthread_mach_thread_np(pthread_self());
|
||||||
|
#elif MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
||||||
|
if (&pthread_threadid_np) {
|
||||||
|
pthread_threadid_np(nullptr, &tid);
|
||||||
|
} else {
|
||||||
|
tid = pthread_mach_thread_np(pthread_self());
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
pthread_threadid_np(nullptr, &tid);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
pthread_threadid_np(nullptr, &tid);
|
||||||
|
#endif
|
||||||
|
return static_cast<size_t>(tid);
|
||||||
|
#else // Default to standard C++11 (other Unix)
|
||||||
|
return static_cast<size_t>(std::hash<std::thread::id>()(std::this_thread::get_id()));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return current thread id as size_t (from thread local storage)
|
||||||
|
SPDLOG_INLINE size_t thread_id() SPDLOG_NOEXCEPT {
|
||||||
|
#if defined(SPDLOG_NO_TLS)
|
||||||
|
return _thread_id();
|
||||||
|
#else // cache thread id in tls
|
||||||
|
static thread_local const size_t tid = _thread_id();
|
||||||
|
return tid;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is avoid msvc issue in sleep_for that happens if the clock changes.
|
||||||
|
// See https://github.com/gabime/spdlog/issues/609
|
||||||
|
SPDLOG_INLINE void sleep_for_millis(unsigned int milliseconds) SPDLOG_NOEXCEPT {
|
||||||
|
#if defined(_WIN32)
|
||||||
|
::Sleep(milliseconds);
|
||||||
|
#else
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// wchar support for windows file names (SPDLOG_WCHAR_FILENAMES must be defined)
|
||||||
|
#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES)
|
||||||
|
SPDLOG_INLINE std::string filename_to_str(const filename_t &filename) {
|
||||||
|
memory_buf_t buf;
|
||||||
|
wstr_to_utf8buf(filename, buf);
|
||||||
|
return SPDLOG_BUF_TO_STRING(buf);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
SPDLOG_INLINE std::string filename_to_str(const filename_t &filename) { return filename; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
SPDLOG_INLINE int pid() SPDLOG_NOEXCEPT {
|
||||||
|
#ifdef _WIN32
|
||||||
|
return conditional_static_cast<int>(::GetCurrentProcessId());
|
||||||
|
#else
|
||||||
|
return conditional_static_cast<int>(::getpid());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine if the terminal supports colors
|
||||||
|
// Based on: https://github.com/agauniyal/rang/
|
||||||
|
SPDLOG_INLINE bool is_color_terminal() SPDLOG_NOEXCEPT {
|
||||||
|
#ifdef _WIN32
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
|
||||||
|
static const bool result = []() {
|
||||||
|
const char *env_colorterm_p = std::getenv("COLORTERM");
|
||||||
|
if (env_colorterm_p != nullptr) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr std::array<const char *, 16> terms = {
|
||||||
|
{"ansi", "color", "console", "cygwin", "gnome", "konsole", "kterm", "linux", "msys",
|
||||||
|
"putty", "rxvt", "screen", "vt100", "xterm", "alacritty", "vt102"}};
|
||||||
|
|
||||||
|
const char *env_term_p = std::getenv("TERM");
|
||||||
|
if (env_term_p == nullptr) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::any_of(terms.begin(), terms.end(), [&](const char *term) {
|
||||||
|
return std::strstr(env_term_p, term) != nullptr;
|
||||||
|
});
|
||||||
|
}();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine if the terminal attached
|
||||||
|
// Source: https://github.com/agauniyal/rang/
|
||||||
|
SPDLOG_INLINE bool in_terminal(FILE *file) SPDLOG_NOEXCEPT {
|
||||||
|
#ifdef _WIN32
|
||||||
|
return ::_isatty(_fileno(file)) != 0;
|
||||||
|
#else
|
||||||
|
return ::isatty(fileno(file)) != 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) || defined(SPDLOG_WCHAR_FILENAMES)) && defined(_WIN32)
|
||||||
|
SPDLOG_INLINE void wstr_to_utf8buf(wstring_view_t wstr, memory_buf_t &target) {
|
||||||
|
if (wstr.size() > static_cast<size_t>((std::numeric_limits<int>::max)()) / 4 - 1) {
|
||||||
|
throw_spdlog_ex("UTF-16 string is too big to be converted to UTF-8");
|
||||||
|
}
|
||||||
|
|
||||||
|
int wstr_size = static_cast<int>(wstr.size());
|
||||||
|
if (wstr_size == 0) {
|
||||||
|
target.resize(0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int result_size = static_cast<int>(target.capacity());
|
||||||
|
if ((wstr_size + 1) * 4 > result_size) {
|
||||||
|
result_size =
|
||||||
|
::WideCharToMultiByte(CP_UTF8, 0, wstr.data(), wstr_size, NULL, 0, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result_size > 0) {
|
||||||
|
target.resize(result_size);
|
||||||
|
result_size = ::WideCharToMultiByte(CP_UTF8, 0, wstr.data(), wstr_size, target.data(),
|
||||||
|
result_size, NULL, NULL);
|
||||||
|
|
||||||
|
if (result_size > 0) {
|
||||||
|
target.resize(result_size);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw_spdlog_ex(
|
||||||
|
fmt_lib::format("WideCharToMultiByte failed. Last error: {}", ::GetLastError()));
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void utf8_to_wstrbuf(string_view_t str, wmemory_buf_t &target) {
|
||||||
|
if (str.size() > static_cast<size_t>((std::numeric_limits<int>::max)()) - 1) {
|
||||||
|
throw_spdlog_ex("UTF-8 string is too big to be converted to UTF-16");
|
||||||
|
}
|
||||||
|
|
||||||
|
int str_size = static_cast<int>(str.size());
|
||||||
|
if (str_size == 0) {
|
||||||
|
target.resize(0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// find the size to allocate for the result buffer
|
||||||
|
int result_size = ::MultiByteToWideChar(CP_UTF8, 0, str.data(), str_size, NULL, 0);
|
||||||
|
|
||||||
|
if (result_size > 0) {
|
||||||
|
target.resize(result_size);
|
||||||
|
result_size =
|
||||||
|
::MultiByteToWideChar(CP_UTF8, 0, str.data(), str_size, target.data(), result_size);
|
||||||
|
if (result_size > 0) {
|
||||||
|
assert(result_size == static_cast<int>(target.size()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw_spdlog_ex(
|
||||||
|
fmt_lib::format("MultiByteToWideChar failed. Last error: {}", ::GetLastError()));
|
||||||
|
}
|
||||||
|
#endif // (defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) || defined(SPDLOG_WCHAR_FILENAMES)) &&
|
||||||
|
// defined(_WIN32)
|
||||||
|
|
||||||
|
// return true on success
|
||||||
|
static SPDLOG_INLINE bool mkdir_(const filename_t &path) {
|
||||||
|
#ifdef _WIN32
|
||||||
|
#ifdef SPDLOG_WCHAR_FILENAMES
|
||||||
|
return ::_wmkdir(path.c_str()) == 0;
|
||||||
|
#else
|
||||||
|
return ::_mkdir(path.c_str()) == 0;
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
return ::mkdir(path.c_str(), mode_t(0755)) == 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// create the given directory - and all directories leading to it
|
||||||
|
// return true on success or if the directory already exists
|
||||||
|
SPDLOG_INLINE bool create_dir(const filename_t &path) {
|
||||||
|
if (path_exists(path)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (path.empty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t search_offset = 0;
|
||||||
|
do {
|
||||||
|
auto token_pos = path.find_first_of(folder_seps_filename, search_offset);
|
||||||
|
// treat the entire path as a folder if no folder separator not found
|
||||||
|
if (token_pos == filename_t::npos) {
|
||||||
|
token_pos = path.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
auto subdir = path.substr(0, token_pos);
|
||||||
|
#ifdef _WIN32
|
||||||
|
// if subdir is just a drive letter, add a slash e.g. "c:"=>"c:\",
|
||||||
|
// otherwise path_exists(subdir) returns false (issue #3079)
|
||||||
|
const bool is_drive = subdir.length() == 2 && subdir[1] == ':';
|
||||||
|
if (is_drive) {
|
||||||
|
subdir += '\\';
|
||||||
|
token_pos++;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (!subdir.empty() && !path_exists(subdir) && !mkdir_(subdir)) {
|
||||||
|
return false; // return error if failed creating dir
|
||||||
|
}
|
||||||
|
search_offset = token_pos + 1;
|
||||||
|
} while (search_offset < path.size());
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return directory name from given path or empty string
|
||||||
|
// "abc/file" => "abc"
|
||||||
|
// "abc/" => "abc"
|
||||||
|
// "abc" => ""
|
||||||
|
// "abc///" => "abc//"
|
||||||
|
SPDLOG_INLINE filename_t dir_name(const filename_t &path) {
|
||||||
|
auto pos = path.find_last_of(folder_seps_filename);
|
||||||
|
return pos != filename_t::npos ? path.substr(0, pos) : filename_t{};
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 4996)
|
||||||
|
#endif // _MSC_VER
|
||||||
|
std::string SPDLOG_INLINE getenv(const char *field) {
|
||||||
|
#if defined(_MSC_VER) && defined(WINAPI_FAMILY) && defined(WINAPI_FAMILY_DESKTOP_APP) && \
|
||||||
|
(WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
|
||||||
|
return std::string{}; // not supported under uwp
|
||||||
|
#else
|
||||||
|
char *buf = std::getenv(field);
|
||||||
|
return buf ? buf : std::string{};
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif // _MSC_VER
|
||||||
|
|
||||||
|
// Do fsync by FILE handlerpointer
|
||||||
|
// Return true on success
|
||||||
|
SPDLOG_INLINE bool fsync(FILE *fp) {
|
||||||
|
#ifdef _WIN32
|
||||||
|
return FlushFileBuffers(reinterpret_cast<HANDLE>(_get_osfhandle(_fileno(fp)))) != 0;
|
||||||
|
#else
|
||||||
|
return ::fsync(fileno(fp)) == 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do non-locking fwrite if possible by the os or use the regular locking fwrite
|
||||||
|
// Return true on success.
|
||||||
|
SPDLOG_INLINE bool fwrite_bytes(const void *ptr, const size_t n_bytes, FILE *fp) {
|
||||||
|
#if defined(_WIN32) && defined(SPDLOG_FWRITE_UNLOCKED)
|
||||||
|
return _fwrite_nolock(ptr, 1, n_bytes, fp) == n_bytes;
|
||||||
|
#elif defined(SPDLOG_FWRITE_UNLOCKED)
|
||||||
|
return ::fwrite_unlocked(ptr, 1, n_bytes, fp) == n_bytes;
|
||||||
|
#else
|
||||||
|
return std::fwrite(ptr, 1, n_bytes, fp) == n_bytes;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace os
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <ctime> // std::time_t
|
||||||
|
#include <spdlog/common.h>
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
namespace os {
|
||||||
|
|
||||||
|
SPDLOG_API spdlog::log_clock::time_point now() SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
|
SPDLOG_API std::tm localtime(const std::time_t &time_tt) SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
|
SPDLOG_API std::tm localtime() SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
|
SPDLOG_API std::tm gmtime(const std::time_t &time_tt) SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
|
SPDLOG_API std::tm gmtime() SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
|
// eol definition
|
||||||
|
#if !defined(SPDLOG_EOL)
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define SPDLOG_EOL "\r\n"
|
||||||
|
#else
|
||||||
|
#define SPDLOG_EOL "\n"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
SPDLOG_CONSTEXPR static const char *default_eol = SPDLOG_EOL;
|
||||||
|
|
||||||
|
// folder separator
|
||||||
|
#if !defined(SPDLOG_FOLDER_SEPS)
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define SPDLOG_FOLDER_SEPS "\\/"
|
||||||
|
#else
|
||||||
|
#define SPDLOG_FOLDER_SEPS "/"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
SPDLOG_CONSTEXPR static const char folder_seps[] = SPDLOG_FOLDER_SEPS;
|
||||||
|
SPDLOG_CONSTEXPR static const filename_t::value_type folder_seps_filename[] =
|
||||||
|
SPDLOG_FILENAME_T(SPDLOG_FOLDER_SEPS);
|
||||||
|
|
||||||
|
// fopen_s on non windows for writing
|
||||||
|
SPDLOG_API bool fopen_s(FILE **fp, const filename_t &filename, const filename_t &mode);
|
||||||
|
|
||||||
|
// Remove filename. return 0 on success
|
||||||
|
SPDLOG_API int remove(const filename_t &filename) SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
|
// Remove file if exists. return 0 on success
|
||||||
|
// Note: Non atomic (might return failure to delete if concurrently deleted by other process/thread)
|
||||||
|
SPDLOG_API int remove_if_exists(const filename_t &filename) SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
|
SPDLOG_API int rename(const filename_t &filename1, const filename_t &filename2) SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
|
// Return if file exists.
|
||||||
|
SPDLOG_API bool path_exists(const filename_t &filename) SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
|
// Return file size according to open FILE* object
|
||||||
|
SPDLOG_API size_t filesize(FILE *f);
|
||||||
|
|
||||||
|
// Return utc offset in minutes or throw spdlog_ex on failure
|
||||||
|
SPDLOG_API int utc_minutes_offset(const std::tm &tm = details::os::localtime());
|
||||||
|
|
||||||
|
// Return current thread id as size_t
|
||||||
|
// It exists because the std::this_thread::get_id() is much slower(especially
|
||||||
|
// under VS 2013)
|
||||||
|
SPDLOG_API size_t _thread_id() SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
|
// Return current thread id as size_t (from thread local storage)
|
||||||
|
SPDLOG_API size_t thread_id() SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
|
// This is avoid msvc issue in sleep_for that happens if the clock changes.
|
||||||
|
// See https://github.com/gabime/spdlog/issues/609
|
||||||
|
SPDLOG_API void sleep_for_millis(unsigned int milliseconds) SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
|
SPDLOG_API std::string filename_to_str(const filename_t &filename);
|
||||||
|
|
||||||
|
SPDLOG_API int pid() SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
|
// Determine if the terminal supports colors
|
||||||
|
// Source: https://github.com/agauniyal/rang/
|
||||||
|
SPDLOG_API bool is_color_terminal() SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
|
// Determine if the terminal attached
|
||||||
|
// Source: https://github.com/agauniyal/rang/
|
||||||
|
SPDLOG_API bool in_terminal(FILE *file) SPDLOG_NOEXCEPT;
|
||||||
|
|
||||||
|
#if (defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) || defined(SPDLOG_WCHAR_FILENAMES)) && defined(_WIN32)
|
||||||
|
SPDLOG_API void wstr_to_utf8buf(wstring_view_t wstr, memory_buf_t &target);
|
||||||
|
|
||||||
|
SPDLOG_API void utf8_to_wstrbuf(string_view_t str, wmemory_buf_t &target);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Return directory name from given path or empty string
|
||||||
|
// "abc/file" => "abc"
|
||||||
|
// "abc/" => "abc"
|
||||||
|
// "abc" => ""
|
||||||
|
// "abc///" => "abc//"
|
||||||
|
SPDLOG_API filename_t dir_name(const filename_t &path);
|
||||||
|
|
||||||
|
// Create a dir from the given path.
|
||||||
|
// Return true if succeeded or if this dir already exists.
|
||||||
|
SPDLOG_API bool create_dir(const filename_t &path);
|
||||||
|
|
||||||
|
// non thread safe, cross platform getenv/getenv_s
|
||||||
|
// return empty string if field not found
|
||||||
|
SPDLOG_API std::string getenv(const char *field);
|
||||||
|
|
||||||
|
// Do fsync by FILE objectpointer.
|
||||||
|
// Return true on success.
|
||||||
|
SPDLOG_API bool fsync(FILE *fp);
|
||||||
|
|
||||||
|
// Do non-locking fwrite if possible by the os or use the regular locking fwrite
|
||||||
|
// Return true on success.
|
||||||
|
SPDLOG_API bool fwrite_bytes(const void *ptr, const size_t n_bytes, FILE *fp);
|
||||||
|
|
||||||
|
} // namespace os
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
|
|
||||||
|
#ifdef SPDLOG_HEADER_ONLY
|
||||||
|
#include "os-inl.h"
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef SPDLOG_HEADER_ONLY
|
||||||
|
#include <spdlog/details/periodic_worker.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
|
||||||
|
// stop the worker thread and join it
|
||||||
|
SPDLOG_INLINE periodic_worker::~periodic_worker() {
|
||||||
|
if (worker_thread_.joinable()) {
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(mutex_);
|
||||||
|
active_ = false;
|
||||||
|
}
|
||||||
|
cv_.notify_one();
|
||||||
|
worker_thread_.join();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// periodic worker thread - periodically executes the given callback function.
|
||||||
|
//
|
||||||
|
// RAII over the owned thread:
|
||||||
|
// creates the thread on construction.
|
||||||
|
// stops and joins the thread on destruction (if the thread is executing a callback, wait for it
|
||||||
|
// to finish first).
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <condition_variable>
|
||||||
|
#include <functional>
|
||||||
|
#include <mutex>
|
||||||
|
#include <thread>
|
||||||
|
namespace spdlog {
|
||||||
|
namespace details {
|
||||||
|
|
||||||
|
class SPDLOG_API periodic_worker {
|
||||||
|
public:
|
||||||
|
template <typename Rep, typename Period>
|
||||||
|
periodic_worker(const std::function<void()> &callback_fun,
|
||||||
|
std::chrono::duration<Rep, Period> interval) {
|
||||||
|
active_ = (interval > std::chrono::duration<Rep, Period>::zero());
|
||||||
|
if (!active_) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
worker_thread_ = std::thread([this, callback_fun, interval]() {
|
||||||
|
for (;;) {
|
||||||
|
std::unique_lock<std::mutex> lock(this->mutex_);
|
||||||
|
if (this->cv_.wait_for(lock, interval, [this] { return !this->active_; })) {
|
||||||
|
return; // active_ == false, so exit this thread
|
||||||
|
}
|
||||||
|
callback_fun();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
std::thread &get_thread() { return worker_thread_; }
|
||||||
|
periodic_worker(const periodic_worker &) = delete;
|
||||||
|
periodic_worker &operator=(const periodic_worker &) = delete;
|
||||||
|
// stop the worker thread and join it
|
||||||
|
~periodic_worker();
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool active_;
|
||||||
|
std::thread worker_thread_;
|
||||||
|
std::mutex mutex_;
|
||||||
|
std::condition_variable cv_;
|
||||||
|
};
|
||||||
|
} // namespace details
|
||||||
|
} // namespace spdlog
|
||||||
|
|
||||||
|
#ifdef SPDLOG_HEADER_ONLY
|
||||||
|
#include "periodic_worker-inl.h"
|
||||||
|
#endif
|
||||||
Loaded 100 of 313 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user