英文:
angr - project.loader.find_symbol("main") does not works on Windows
问题
我有一个非常简单的C代码 - 在MSVC上使用clang++编译器编译。当我在angr环境下运行它时 - 它简单地找不到main()函数,而对于其他像strcmp等函数,它可以找到。此外,在Linux(g++)下运行相同的程序没有任何问题。
另外,我可以在dumpbin.exe、gdb、x64dbg等工具中看到main()符号。
path_to_binary = "D:\\angr_project\\angr training\\angr_ctf\\00_angr_find\\00_angr_find.exe" # :string
print("Started execution")
project = angr.Project(path_to_binary, load_options={'auto_load_libs': False})
main_fn = project.loader.find_symbol('main')
if main_fn:
print("main found")
else:
print("main not found")
英文:
I have very simple C code - compiled on MSVC using clang++ compiler. When I am running it under angr environment - it simply does not finds main() function, while it can do so for other things like strcmp etc. Also, the same program when run under linux (g++) works with no issues.
Additionally, I could see main() symbol in dumpbin.exe, gdb, x64dbg etc.
path_to_binary = "D:\\angr_project\\angr training\\angr_ctf\path_to_binary = "D:\\angr_project\\angr training\\angr_ctf\\00_angr_find\\00_angr_find.exe" # :string
print("Started execution\n")
project = angr.Project(path_to_binary, load_options={'auto_load_libs': False})
main_fn = project.loader.find_symbol('main')
if main_fn:
print("main found")
else:
print("main not found")
_angr_find\path_to_binary = "D:\\angr_project\\angr training\\angr_ctf\\00_angr_find\\00_angr_find.exe" # :string
print("Started execution\n")
project = angr.Project(path_to_binary, load_options={'auto_load_libs': False})
main_fn = project.loader.find_symbol('main')
if main_fn:
print("main found")
else:
print("main not found")
_angr_find.exe" # :string
print("Started execution\n")
project = angr.Project(path_to_binary, load_options={'auto_load_libs': False})
main_fn = project.loader.find_symbol('main')
if main_fn:
print("main found")
else:
print("main not found")
答案1
得分: 1
查看cle.pe的get_symbol源代码。它从导出表中获取信息。
看来angr不支持PDB。
英文:
See the cle.pe's get_symbol source code.
It gets from the export table.
It seems that angr doesn't support PDB.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论