Skip to content

Commit

Permalink
Add missing syscall for 64bit
Browse files Browse the repository at this point in the history
Signed-off-by: tiann <[email protected]>
  • Loading branch information
tiann committed Jul 9, 2020
1 parent 7c15001 commit 19ff7cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,4 @@ Credits

1. [VirtualApp](https://github.com/asLody/VirtualApp)
2. [Xposed](https://github.com/rovo89/Xposed)
3. [And64InlineHook](https://github.com/Rprop/And64InlineHook)
11 changes: 10 additions & 1 deletion VirtualApp/lib/src/main/jni/Foundation/IOUniformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,15 @@ HOOK_DEF(int, __statfs, __const char *__file, struct statfs *__buf) {
return ret;
}

// int statfs64 (__const char *__file, struct statfs *__buf);
HOOK_DEF(int, statfs64, __const char *__file, struct statfs *__buf) {
int res;
const char *redirect_path = relocate_path(__file, &res);
int ret = syscall(__NR_statfs, redirect_path, __buf);
FREE(redirect_path, __file);
return ret;
}

int inline getArrayItemCount(char *const array[]) {
int i;
for (i = 0; array[i]; ++i);
Expand Down Expand Up @@ -520,9 +529,9 @@ void IOUniformer::startUniformer(const char *so_path, int api_level, int preview
HOOK_SYMBOL(handle, unlinkat);
HOOK_SYMBOL(handle, symlinkat);
HOOK_SYMBOL(handle, utimensat);
// HOOK_SYMBOL(handle, __getdents64);
HOOK_SYMBOL(handle, chdir);
HOOK_SYMBOL(handle, execve);
HOOK_SYMBOL(handle, statfs64);
dlclose(handle);
}
// hook_dlopen(api_level);
Expand Down

0 comments on commit 19ff7cf

Please sign in to comment.