非常感谢Pediy此书带我领进门,根据教程已经自己写了第一个CrackMe也掌握了smali分析以及IDA破解的方法
书还没看完,但是觉得书中第49页的比较指令对于读者来说逻辑性上会有些困扰。
书中的cmpl-float 与cmpg-float指令描述一模一样,实际上两个指令的解释应该是不同的。
参考上文3.3.10中的if-lt是if-little than 的缩写,if-gt 是if greater than的缩写
所以这里的 l 与 g 分别代表 little 与greater
Perform the indicated floating point or long comparison, setting a to 0 if b == c, 1 if b > c, or -1 if b < c. The "bias" listed for the floating point operations indicates how NaN comparisons are treated: "gt bias" instructions return 1 for NaN comparisons, and "lt bias" instructions return -1.
For example, to check to see if floating point x < y it is advisable to use cmpg-float; a result of -1 indicates that the test was true, and the other values indicate it was false either due to a valid comparison or because one of the values was NaN.
楼上兄弟,你说的我有点疑问,下面这句话理解有点问题
cmpl-float v0, v6, v7
Compares the float values in v6 and v7 then sets v0 accordingly. NaN bias is less-than, the instruction will return -1 if any of the parameters is NaN.
如果我理解为v6 < v7时,v0=-1的话,这与上面书中的描述相反,翻译有误吗?
A: destination register (8 bits)
A: 目的寄存器
B: first source register or pair
B: 第一源寄存器
C: second source register or pair
C: 第二源寄存器
Perform the indicated floating point or long comparison
浮点型以及long类型比较说明[抱歉这里的long我不知道是什么类型了]
setting a to 0 if b == c,
如果vBB=vCC 则将vAA设置为0
setting a to 1 if b > c,
如果vBB>vCC 则将vAA设置为1
setting a to -1 if b < c.
如果vBB<vCC 则将vAA设置为-1
The "bias" listed for the floating point operations indicates how NaN comparisons are treated: "gt bias" instructions return 1 for NaN comparisons, and "lt bias" instructions return -1.
比较"偏向" 列出浮点类型比较的处理方法:" 比较较大 " 返回1 ," 比较较小 "返回-1
For example, to check to see if floating point x < y it is advisable to use cmpg-float; a result of -1 indicates that the test was true,
例如,如果 x < y , 如果使用cmpg-float(比较较大数值), 这里的返回值就是-1
补充:如果 x < y , 如果使用cmpl-float(比较较小数值), 这里的返回值也是-1
and the other values indicate it was false either due to a valid comparison or because one of the values was NaN.