Re: Clarification: LD_PRELOAD issue

From: John Daniele (JDanieleat_private)
Date: Sat May 15 1999 - 15:52:53 PDT

  • Next message: Aleph One: "Secure Storage of Secrets in Windows"

    /*
      * rollover.c
      *
      * using ptrace() to intercept and modify the return value of a system call
      *
      * John Daniele
      * jdanieleat_private
      * VOX: (416) 777-3759
      *
      */
    
    #include <unistd.h>
    #include <sys/ptrace.h>
    
    int main(void)
    {	
    	int ret, x, y;
    	pid_t procid;
    
    	if(procid = fork()) {		
    		for(;;) {
    			x = ptrace(PTRACE_PEEKUSR, procid, 44, 0);
    			if(x == 13) {	
    				y = ptrace(PTRACE_PEEKUSR, procid, EBX,
    0);		
    				ptrace(PTRACE_POKEDATA, procid, y,
    2175984000);	
    			}
    			ptrace(PTRACE_SYSCALL, procid, 1, 0);	
    		}	
    	}	
    	ptrace(PTRACE_TRACEME, 0, 1, 0);	
    	execl("/bin/date", "/bin/date", NULL, (char *)0);
    }
    



    This archive was generated by hypermail 2b30 : Fri Apr 13 2001 - 14:46:03 PDT