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

Make symbolic link for Android #1459

Open
ytournier opened this issue Mar 9, 2024 · 1 comment
Open

Make symbolic link for Android #1459

ytournier opened this issue Mar 9, 2024 · 1 comment

Comments

@ytournier
Copy link

Using Android binaries found in the rootfs, the readlink syscall does not find the binaries associated with file descriptors 3 and 4 which are libdl.so and libc.so respectively.

Here's the warning message raise during the execution:

linker: readlink("/proc/self/fd/3") failed: Operation not permitted [fd=3]
linker: warning: unable to get realpath for the library "/system/lib64/libdl.so". Will use given path.
linker: readlink("/proc/self/fd/4") failed: Operation not permitted [fd=4]
linker: warning: unable to get realpath for the library "/system/lib64/libc.so". Will use given path.
propClient: PropClient failed to load

Creating symbolic links as shown below is enough to satisfy the linker:

mkdir -p rootfs/arm64_android/proc/self/fd
ln -sf rootfs/arm64_android/system/lib64/libdl.so rootfs/arm64_android/proc/self/fd/3
ln -sf rootfs/arm64_android/system/lib64/libc.so rootfs/arm64_android/proc/self/fd/4
@DiamondHunters
Copy link
Contributor

When u open a file , /proc/pid/fd/[N] will be a symbol link to the file which is opened with fd [N].
It's done by linux kernel.
But qiling's procfs is not consistent with the real environment.
You can mock procfs by Hijacking VFS objects

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