Exemplo n.º 1
0
        private void HandleClassLoad(jvmtiEnvHandle env, JNIEnvHandle jniEnv, jthread threadHandle, jclass classHandle)
        {
            JvmEnvironment     environment = JvmEnvironment.GetEnvironment(env);
            JvmThreadReference thread      = JvmThreadReference.FromHandle(environment, jniEnv, threadHandle, true);
            JvmClassReference  @class      = JvmClassReference.FromHandle(environment, jniEnv, classHandle, true);

            foreach (var processor in _processors)
            {
                processor.HandleClassLoad(environment, thread, @class);
            }
        }
Exemplo n.º 2
0
        private void HandleVMObjectAlloc(jvmtiEnvHandle env, JNIEnvHandle jniEnv, jthread threadHandle, jobject objectHandle, jclass objectClassHandle, long size)
        {
            JvmEnvironment     environment = JvmEnvironment.GetEnvironment(env);
            JvmThreadReference thread      = JvmThreadReference.FromHandle(environment, jniEnv, threadHandle, true);
            JvmObjectReference @object     = JvmObjectReference.FromHandle(environment, jniEnv, objectHandle, true);
            JvmClassReference  objectClass = JvmClassReference.FromHandle(environment, jniEnv, objectClassHandle, true);

            foreach (var processor in _processors)
            {
                processor.HandleVMObjectAllocation(environment, thread, @object, objectClass, size);
            }
        }
Exemplo n.º 3
0
        private void HandleClassFileLoadHook(jvmtiEnvHandle env, JNIEnvHandle jniEnv, jclass classBeingRedefinedHandle, jobject loaderHandle, ModifiedUTF8StringData name, jobject protectionDomainHandle, int classDataLength, IntPtr classData, ref int newClassDataLength, ref IntPtr newClassData)
        {
            JvmEnvironment     environment         = JvmEnvironment.GetEnvironment(env);
            JvmClassReference  classBeingRedefined = JvmClassReference.FromHandle(environment, jniEnv, classBeingRedefinedHandle, true);
            JvmObjectReference loader           = JvmObjectReference.FromHandle(environment, jniEnv, loaderHandle, true);
            JvmObjectReference protectionDomain = JvmObjectReference.FromHandle(environment, jniEnv, protectionDomainHandle, true);

            foreach (var processor in _processors)
            {
                processor.HandleClassFileLoadHook(environment, classBeingRedefined, loader, name.GetString(), protectionDomain);
            }
        }
Exemplo n.º 4
0
        private void HandleFieldModification(jvmtiEnvHandle env, JNIEnvHandle jniEnv, jthread threadHandle, jmethodID method, jlocation jlocation, jclass fieldClassHandle, jobject @objectHandle, jfieldID fieldId, byte signatureType, jvalue newValue)
        {
            JvmEnvironment     environment = JvmEnvironment.GetEnvironment(env);
            JvmThreadReference thread      = JvmThreadReference.FromHandle(environment, jniEnv, threadHandle, true);
            JvmLocation        location    = new JvmLocation(environment, method, jlocation);
            JvmClassReference  fieldClass  = JvmClassReference.FromHandle(environment, jniEnv, fieldClassHandle, true);
            JvmObjectReference @object     = JvmObjectReference.FromHandle(environment, jniEnv, objectHandle, true);
            JvmField           field       = new JvmField(environment, fieldId);

            foreach (var processor in _processors)
            {
                processor.HandleFieldModification(environment, thread, location, fieldClass, @object, field, signatureType, newValue);
            }
        }
 public virtual void HandleClassFileLoadHook(JvmEnvironment environment, JvmClassReference classBeingRedefined, JvmObjectReference loader, string name, JvmObjectReference protectionDomain /*, byte[] classData, ref byte[] newClassData*/)
 {
 }
 public virtual void HandleClassPrepare(JvmEnvironment environment, JvmThreadReference thread, JvmClassReference @class)
 {
 }
 public virtual void HandleFieldModification(JvmEnvironment environment, JvmThreadReference thread, JvmLocation location, JvmClassReference fieldClass, JvmObjectReference @object, JvmField field, byte signatureType, jvalue newValue)
 {
 }
 public virtual void HandleFieldAccess(JvmEnvironment environment, JvmThreadReference thread, JvmLocation location, JvmClassReference fieldClass, JvmObjectReference @object, JvmField field)
 {
 }
 public virtual void HandleVMObjectAllocation(JvmEnvironment environment, JvmThreadReference thread, JvmObjectReference @object, JvmClassReference objectClass, long size)
 {
 }