We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
*Describe the bug
When emulating a binary that does a stat() library call, there is always a -1 result with errno set to EOVERFLOW.
The same binary, ran with qemu-arm, exhibit no problem (stat() returns 0)
Sample Code
from qiling import * binary = r'./rootfs/bin' rootfs = r'./rootfs/' ql = Qiling(["./rootfs/myprog"], "./rootfs") ql.run()
Emulated program:
#include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <errno.h> int main(void) { struct stat buf; if (stat("somefile.txt", &buf) < 0) { perror("stat"); } }
Emulated program compiled with:
arm-linux-gnueabi-gcc -static -o myprog myprog.c
Emulated program binary is put in directory "rootfs", along with "somefile.txt"
Expected behavior
stat() returns 0 in emulated program.
Additional context
The stat() library call, in turn, calls the statx() syscall. It seems that the structure for the statx() ( https://github.com/qilingframework/qiling/blob/master/qiling/os/posix/syscall/stat.py#L1361 ) does not correspond to the documentation ( https://man7.org/linux/man-pages/man2/statx.2.html ), this causes a failure in a check in the fstatat libc function (called by stat).
distro version: ubuntu 22.04 ARM libc version: libc6-armel-cross (package 2.35-0ubuntu1cross3) ARM gcc version: gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04) qiling version: 1.4.6 python version: 3.10.12
The text was updated successfully, but these errors were encountered:
No branches or pull requests
*Describe the bug
When emulating a binary that does a stat() library call, there is always a -1 result with errno set to EOVERFLOW.
The same binary, ran with qemu-arm, exhibit no problem (stat() returns 0)
Sample Code
Emulated program:
Emulated program compiled with:
Emulated program binary is put in directory "rootfs", along with "somefile.txt"
Expected behavior
stat() returns 0 in emulated program.
Additional context
The stat() library call, in turn, calls the statx() syscall. It seems that the structure for the statx() ( https://github.com/qilingframework/qiling/blob/master/qiling/os/posix/syscall/stat.py#L1361 ) does not correspond to the documentation ( https://man7.org/linux/man-pages/man2/statx.2.html ), this causes a failure in a check in the fstatat libc function (called by stat).
distro version: ubuntu 22.04
ARM libc version: libc6-armel-cross (package 2.35-0ubuntu1cross3)
ARM gcc version: gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
qiling version: 1.4.6
python version: 3.10.12
The text was updated successfully, but these errors were encountered: