在使用 IDA 调试 APK 时经常遇到变量无法识别的情况,需要在WatchView里面手动加入类型转换,如下图
但是官方给出的 DalvikDbg 文档里如下说:
Attention! An incorrect type may cause the Dalvik VM to crash. There is not much we can do about it. Our
recommendation is to never cast an integer variable to an object type, the Dalvik VM usually crashes if we
do that. But the integer cast “(int)” is safe in practice. If the “object ID safety check” debugger option is
selected then IDA tries to prevent such a situation. The only drawback is that this option adds some
overhead.
大概意思就是说你一直用 (Object*)v0 这种东西放在监视器里往下走的话很可能导致 IDA 崩溃,因为这样定义后IDA一直会去自动识别它,当这个值指飞了的时候就容易导致崩溃。有没有方法可以一直监视这个值又不会崩溃呢,个人的经验就是把 (Object*) 换成 (int*) 这样 IDA也会去自动识别类,而且还不会崩溃,至少我现在还没遇到过。