angr – project.loader.find_symbol("main") does not works on Windows

huangapple go评论57阅读模式
英文:

angr - project.loader.find_symbol("main") does not works on Windows

问题

我有一个非常简单的C代码 - 在MSVC上使用clang++编译器编译当我在angr环境下运行它时 - 它简单地找不到main()函数而对于其他像strcmp等函数它可以找到此外在Linuxg++下运行相同的程序没有任何问题

另外我可以在dumpbin.exegdbx64dbg等工具中看到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.

huangapple
  • 本文由 发表于 2023年6月12日 15:44:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/76454517.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定