qilingframework / qilingframework/qiling
Linker fails to link dynamic link libraries correctly
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.1k
- Forks
- 798
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 9
Description
*Describe the bug
When using Qiling to simulate executable file, I encountered a problem where the linker was unable to link dynamic link libraries correctly, i.e. ld-linux.so was unable to link dynamic link libraries such as libc.so. This resulted in the target program in the simulation environment not being able to find the required DLLs, and thus the simulation could not be executed successfully.
Sample Code
ql = Qiling([r'./update/os'], r'./rootfs', verbose=QL_VERBOSE.DISASM)
ql.run(end=0x15fd0) #15fd0 is the address of the main function
Expected behavior
Dynamic link libraries are all loaded successfully, qiling can be called by symbols can jump to the appropriate location.
Screenshots
Additional context
The environment should be fine and there are many other executables that can be emulated successfully. There is one executable that can also be simulated successfully after removing some of the dynamic link libraries using the patchelf tool. Is there a solution for this situation?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Qiling invocation in the sample, using ./update/os and ./rootfs, and reproduce the run through address 0x15fd0. Trace how ld-linux.so handles the listed libraries, including libc.so, and compare with the executable modified by patchelf. Done means the dynamic libraries load successfully and symbol calls jump to the appropriate locations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- reverse-engineering
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100