Add Java binding for ctl set_cpu_model (#1600)

Add Java binding for ctl set_cpu_model
This commit is contained in:
JeroenRobbenFirmalyzer1
2022-04-24 13:29:48 +02:00
committed by GitHub
parent 0c975caf09
commit 36011e145c
2 changed files with 20 additions and 0 deletions

View File

@@ -779,3 +779,17 @@ JNIEXPORT void JNICALL Java_unicorn_Unicorn_context_1restore
throwException(env, err);
}
}
/*
* Class: unicorn_Unicorn
* Method: ctl_set_cpu_model
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_unicorn_Unicorn_ctl_1set_1cpu_1model
(JNIEnv *env, jobject self, jint cpu_model) {
uc_engine *eng = getEngine(env, self);
uc_err err = uc_ctl_set_cpu_model(eng, cpu_model);
if (err != UC_ERR_OK) {
throwException(env, err);
}
}