Add Java binding for ctl set_cpu_model (#1600)
Add Java binding for ctl set_cpu_model
This commit is contained in:
parent
0c975caf09
commit
36011e145c
|
@ -821,5 +821,11 @@ public class Unicorn implements UnicornConst, ArmConst, Arm64Const, M68kConst, S
|
|||
*/
|
||||
public native void context_restore(long context);
|
||||
|
||||
/**
|
||||
* Set the emulated cpu model.
|
||||
*
|
||||
* @param cpu_model CPU model type (see UC_CPU_*).
|
||||
*/
|
||||
public native void ctl_set_cpu_model(int cpu_model);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue