Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问binary文件夹里面patch文件和vuln文件是如何编译的? #2

Open
LHFlhf123 opened this issue May 12, 2024 · 2 comments

Comments

@LHFlhf123
Copy link

请问为什么我自己做的数据集和你的格式一样但是在运行ps3项目时,在debugparser2 = DebugParser2.from_binary(patch_path, vuln_path, funcnames) 这个函数中运行输出,经过调试发现是因为lno = int(tokens[2].split(' ')[0])中tokens[2]中的内容是“?",所以我猜测应该是patch文件和vuln文件有您给的有差别导致解析不出文件里面的内容,所以我想咨询一下您的patch文件和vuln文件是如何编译的

@LHFlhf123
Copy link
Author

期待您的尽快回复,感谢您的解答!

@Qi-Zhan
Copy link
Owner

Qi-Zhan commented May 13, 2024

正如论文中所说,我们使用 gcc O0 -g 编译的 patch/vuln,具体信息以下面的文件为例:

CVE-2018-0734_8abfe7_patch: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=5179efd4a72519bf4f5d14388cc44b1c61a6137c, with debug_info, not stripped

int(tokens[2].split(' ')[0]) 是基于 DWARF 和 address2line 得到的格式 parse 出来的,例如

0xffffffc000a7aa9c: wcdcal_hwdep_ioctl_shared at /home/hang/pm/src-angler-20160801/sound/soc/codecs/wcdcal-hwdep.c:59

我们最后需要拿到 59 这一行号信息

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants