LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-14-2011, 08:26 PM   #1
vbser
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Rep: Reputation: 1
Cool change directory linux system call


Hi,

I am trying to ptrace a process and when the system call is 'cd' change directory,
the ptrace process is able to trap it by comparing it against "__NR__open" system call. When I try to read the name of the directory from ebx register using peek_data I am getting ".message" and not the directory name.
The same thing works fine when I am tracing a file open system call.

Can someone help me on this. Thank you!
 
Old 04-18-2011, 11:14 AM   #2
4dummies
LQ Newbie
 
Registered: May 2009
Location: Central coast of California.
Distribution: Xubuntu
Posts: 21

Rep: Reputation: 2
This is the LinuxQuestions unanswered questions cleanup event. We try to get to even the hardest questions eventually.

I presume you mean the chdir(2) system call. Let me know if something else is going on.

Anyway, you may have the wrong register in mind. The "trampoline" code for system calls is somewhat complicated and variable.
I suggest you just try to see what *each* of the registers points to and see if one of them *does* point to the directory name.

It is even conceivable (though unlikely) that the system call picks something up from the stack, though I would expect the trampoline to do this. I'm not familiar enough with ptrace to know for sure where in the process ptrace is actually peeking.

Good luck.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Change home directory on a system using LDAP svan16 Linux - Newbie 3 05-26-2010 11:57 AM
SCP a file to diff directory/change filename using PHP or call sh script fm PHP nuebelhor Red Hat 1 11-05-2009 08:03 AM
OSE system call functions to Linux Sytem Call functions required roshantraj30 Linux - General 0 06-08-2009 02:06 AM
how to change timezone through system call shivakumar.a Linux - Newbie 1 02-15-2008 06:15 AM
linux system call to detect changes in a directory lucianomx Programming 4 06-05-2002 06:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration