1. Objectives
When doing code restoration, sometimes you will analyze a set of results and hope to set a conditional breakpoint in the middle, such as triggering a breakpoint at code line 0x1234, R0=0x5678.
Let’s try it today.
Tip:
The Unidbg code has been synchronized to the latest official version, which already supports the display of floating-point registers.
2. Steps
Write a floatdemotwo first
Upgrade the ancestral algorithm
extern "C" JNIEXPORT jstring JNICALL
Java_com_h1yx_app_floatdemo_MainActivity_stringFromJNI(
JNIEnv* env,
jobject Obj, jdouble value) {
std::string hello = "Hello from C++";
double p=3.14159;
double s,v,rc;
for(int i=0 ; i< 10; i++){
hello +="\n";
v = 2*p* (value + i);
s = p * (value + i) * (value + i);
rc = v+s;
hello += std::to_string(rc);
}
return env->NewStringUTF(hello.c_str());
}
Calculate the sum of the circumference and area of 10 circles.