这是我的代码。
long doSystemCall(const char *path) {
register long x0 asm("x0") = 0;
register long x1 asm("x1") = (long) path;
register long x2 asm("x2") = 0;
register long x3 asm("x3") = 0;
register long x8 asm("x8") = __NR_faccessat;
__asm__ volatile("svc #0"
:"=r"(x0)
:"0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x8)
:"memory"
);
__android_log_print(ANDROID_LOG_INFO, "SYSCALL", "Result: %li", x0);
return x0;
}
Run Code Online (Sandbox Code Playgroud)
它给出的返回值是0, -2or -13,但是faccessat应该只返回0or -1。我怎样才能解决这个问题?
我的代码的反编译伪代码如下所示。
signed __int64 __fastcall sub_E558(const char *a1)
{
signed __int64 v1; …Run Code Online (Sandbox Code Playgroud)