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

增加支持在LinuxModule注册新的符号 #694

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JunGe-Y
Copy link

@JunGe-Y JunGe-Y commented Oct 24, 2024

背景: 在模拟一个elf的文件执行时,该elf需要用到libdl.so的dlvsym函数,但我看了下unidbg带的so中仅支持dlsym函数,于是我手动实现该函数,并通过registerSvc注册进SvcMemory,再通过registerSymbol函数注册到libdl的Module里。

问题:当我注册进去后发现, elf中依旧找不到dlvsym函数,而我尝试通过module.findSymbolByName()和memory.dlsym()去寻找,依旧找不到dlvsym函数。

发现:我看了一下代码,对于系统库的LinuxMoudle而言,发现findSymbolByName仅从缓存和elf文件结构中寻找符号,而registerSymbol函数仅将符号添加到hook表,也就是说registerSymbol实际上只支持对elf文件中的符号进行hook(替换),而无法添加符号函数。

解决:我认为如果仅是对现有符号进行hook,这非真正意义上的注册符号,所以我认为registerSymbol除了hook,应该还支持进行增加符号。

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

Successfully merging this pull request may close these issues.

1 participant