吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1448|回复: 0
收起左侧

[iOS 求助] frida Stalker.follow 死循环

[复制链接]
charleyha 发表于 2022-10-31 17:49

我希望通过Stalker.follow 去读一段汇编的寄存器。现在这种写法会导致 一直在几个指令里循环,如果我不去看寄存器,而是通过console.log(instruction.address.sub(base_addr) + "\t:\t" + instruction); 去看执行的指令,是可以正常执行。

有没有大佬能给解答一下。

    var mou = Process.getModuleByName(MODULE_NAME)
    var tid = Process.getCurrentThreadId()
    Stalker.follow(tid, {

        transform: (iterator) => {
            const instruction = iterator.next();
            const startAddress = instruction.address;
            const isModuleCode = startAddress.compare(mou.base) >= 0 &&  (mou.base.add(mou.size)).sub(startAddress) > 0;
            do {
                iterator.keep();
                if (isModuleCode) {
                                                //console.log(instruction.address.sub(base_addr) + "\t:\t" + instruction);
                    iterator.putCallout((context) => {
                        let funcAddress = getFuncAddress(context.pc, exportTable);
                        console.log(JSON.stringify({
                            fromAddress: funcAddress,
                            x1 : context.x1,
                            x19:context.x19
                        }))
                    })
                }
            } while (iterator.next() !== null);
        }
    })

部分死循环的log

{"fromAddress":"0x1ca8f340","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f344","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f348","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f33c","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f340","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f344","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f348","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f33c","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f340","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f344","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f348","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f33c","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f340","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f344","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f348","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f33c","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f340","x1":"0x16f795577","x19":"0x11c66fe40"}
{"fromAddress":"0x1ca8f344","x1":"0x16f795577","x19":"0x11c66fe40"}

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-15 17:59

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表