Quantcast
Channel: 睿论坛 - 最新话题
Viewing all articles
Browse latest Browse all 5734

IOS如何对当前线程的寄存器进行读写操作?

$
0
0

@JerryXu wrote:

看到lldb调试可以register write/read,以及HookZz框架也可以实现寄存器读写,最近有需求要实现读写寄存器。
失败的思路

网上有对获取任意callStack的实现其中是配合系统API接口thread_get_state函数获取寄存器信息,但是翻看thread_get_state实现时发现内部实现会对线程进行锁定,也明确写出不能获取当前线程信息。
难道是内联汇编

目前想法

//使用内联汇编
uint64_t x0;
………
_asm这里不能打第二个下划线(“mov %[x0],%%x0\n\t”

:
:[x0]"=r"(x0)
:
);
printf(“Current X0 is %lX”,x0);

不知有没有其他方法,欢迎讨论:sailboat:

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5734

Latest Images

Trending Articles



Latest Images