type
status
date
summary
slug
tags
category
icon
password

What

对于已知的系统调用(比如 prctl)IDA Pro的识别效果如下,系统调用被优化成了函数调用的形式,而且返回值和参数都被纳入了后续的分析、优化之中。
notion image
而对于未知的系统调用(比如 clone3)则被以外部指令 _asm { syscall } 的形式实现,看起来很难受,更重要的是这样会导致 IDA 再后续的分析中认为 eax 的值被赋值为常量 0x1b3,而不是 clone3 系统调用的返回值,进而导致后续反编译器在死代码移除阶段移除对应的子进程逻辑,造成反编译代码语义上的错误、不完整。
notion image

How

既然反编译器反编译出来了 sys_prctl 这个名字,那么安装目录下一定会有这个字符串,或者相关字符串,直接 grep 开搜
notion image
发现目标字符串只出现在 loadint 的代码及其编译产物中,尝试修改 linux64.cmt
notion image
关闭IDA Pro后,使用如下指令重新生成 ida.int
./tools/loadint/loadint -n=ida.hlp tools/loadint/comment.cmt ida.int
notion image
重新加载文件,反编译效果如下
notion image