mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 13:05:53 +08:00
40 lines
1.2 KiB
C++
40 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <jni.h>
|
|
#include <jvmti.h>
|
|
#include <JuiceAgent/Logger.hpp>
|
|
#include <JuiceAgent.hpp>
|
|
#include <utils.hpp>
|
|
#include <global.hpp>
|
|
#include <algorithm>
|
|
|
|
// Generated by JuiceAgent-API
|
|
#include <cn_xiaozhou233_juiceagent_api_JuiceAgent.h>
|
|
|
|
// Event callbacks
|
|
// See https://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html#ClassFileLoadHook
|
|
void JNICALL ClassFileLoadHook(
|
|
jvmtiEnv* jvmti_env,
|
|
JNIEnv* jni_env,
|
|
jclass class_being_redefined,
|
|
jobject loader,
|
|
const char* name,
|
|
jobject protection_domain,
|
|
jint class_data_len,
|
|
const unsigned char* classbytes,
|
|
jint* new_class_data_len,
|
|
unsigned char** new_classbytes);
|
|
|
|
// See https://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html#MethodEntry
|
|
void JNICALL MethodEntry(jvmtiEnv *jvmti_env,
|
|
JNIEnv* jni_env,
|
|
jthread thread,
|
|
jmethodID method);
|
|
|
|
// See https://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html#MethodExit
|
|
void JNICALL MethodExit(jvmtiEnv *jvmti_env,
|
|
JNIEnv* jni_env,
|
|
jthread thread,
|
|
jmethodID method,
|
|
jboolean was_popped_by_exception,
|
|
jvalue return_value); |