Files
JuiceAgent/src/libagent/includes/jni_impl.hpp
T

40 lines
1.2 KiB
C++

#pragma once
#include <jni.h>
#include <jvmti.h>
#include <JuiceAgent/Logger.hpp>
#include <libagent.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);