• Uncategorized

About linux : how-to-write-fd-open-return-result-in-ptrace

Question Detail

I am debugging the svc with the ptrace,If the tracee gets the descriptor of the file via the open inside the svc,I want to execute before tracer create file descriptor written to the tracee process。But what I get is an int (open return result),I don t know how to write to an int,And use this int in the tracer process。

 if(isReadMaps(path)){
        LOGE("find svc read maps by  < %s > start io maps ! before ",stringify_sysnum(get_sysnum(tracee, CURRENT)))

        const maps_temp_info &info = getMapsTempFd(path, flags, NULL);

        FILE *pf = fdopen(info.fd,"w+");

        write_data_noReg(tracee,pf,sizeof(FILE));

        PLOGE(">>>>>>>> svc after  write_data_noReg  sucess ")

        set_sysarg_path(tracee, info.path, reg);

        PLOGE(">>>>>>>> svc after poke result reg sucess %d ",info.fd)

        word_t ret = peek_reg(tracee, CURRENT, reg);

        PLOGE(">>>>>>>> svc after peek ret  %lu  ",ret)

    }

I don’t know what to do with it

Question Answer

No answer for now.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.