File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,16 @@ extern"C" JNIEXPORT jbyteArray JNICALL Java_helloworld_ByteCodeEncryptor_encrypt
14
14
env->SetByteArrayRegion (j_array, 0 , strlen (dst), (jbyte*)dst);
15
15
return j_array;
16
16
}
17
-
17
+ extern " C" JNIEXPORT jbyteArray JNICALL Java_helloworld_ByteCodeEncryptor_decrypt (JNIEnv* env, jclass cla, jbyteArray j_array)
18
+ {
19
+ char * dst = (char *)env->GetByteArrayElements (j_array, 0 );
20
+ des_init (0 );
21
+ des_set_key ((char *)key);
22
+ des_decrypt (dst);
23
+ // des_done();
24
+ env->SetByteArrayRegion (j_array, 0 , strlen (dst), (jbyte*)dst);
25
+ return j_array;
26
+ }
18
27
void JNICALL ClassDecryptCallback (
19
28
jvmtiEnv* jvmti_env,
20
29
JNIEnv* jni_env,
@@ -42,7 +51,7 @@ void JNICALL ClassDecryptCallback(
42
51
des_init (0 );
43
52
des_set_key ((char *)key);
44
53
des_decrypt ((char *)_data);
45
- des_done ();
54
+ // des_done();
46
55
}
47
56
else {
48
57
for (int i = 0 ; i < class_data_len; i++)
You can’t perform that action at this time.
0 commit comments