how to set result in translate_syscall_exit method ?

27 views
Skip to first unread message

珍惜

unread,
Dec 26, 2021, 12:42:29 AM12/26/21
to PRoot
I want to modify the return result of the svc , I am consult to your writing code style 。
I ve tried to modify the return result in translate_syscall_exit   

my code in translate_syscall_exit
-----------------------------------------

case SC_openat:
status = get_sysarg_path_explicit(tracee, path, SYSARG_2,ORIGINAL);
if (status < 0){
PLOGE(">>>>>>>> svc after get path in openat fail ")
break;
}
if(isReadMaps(path)){
PLOGE(">>>>>>>> svc after find read maps in openat ")
//dirfd = peek_reg(tracee, CURRENT, SYSARG_1);

flags = peek_reg(tracee, CURRENT, SYSARG_3); const maps_temp_info &info = getMapsTempFd(path, flags, NULL); poke_reg(tracee,SYSARG_RESULT,info.fd); PLOGE(">>>>>>>> svc after poke result reg sucess %d ",info.fd) word_t ret = peek_reg(tracee, CURRENT, SYSARG_RESULT); PLOGE(">>>>>>>> svc after peek ret %lu ",ret) } break;

case SC_readlinkat:
case SC_unlinkat:
case SC_mkdirat:
case SC_link:

-----------------------------------------

2021-12-26 13:03:57.485 20682-20682/? E/Camel: >>>>>>>> svc after poke result reg sucess 54
2021-12-26 13:03:57.485 20682-20682/? E/Camel: >>>>>>>> svc after peek ret 54
2021-12-26 13:03:57.579 20682-20682/? E/Camel: [20689] process exit with signal: syscall_number = 5 messgae = Trap

I don't know why this problem occurs,This problem has bothered me for a long time
I really hope to get your help Thanks, the great developers

Reply all
Reply to author
Forward
0 new messages