본문 바로가기

ptrace

Playing with ptrace, Part I 원문 : http://www.linuxjournal.com/article/6100 ptrace 는 리눅스에 입문한 나에게 마법과 같은 기능이다. 물론 제약이 있겠지만, 언듯 보면 이것은 Linux의 process 보호의 컨샙을 넘나들며, 동작을 한다. 이 놀라운 기능을 조금씩 알아가는것은 나에게 커다란 즐거움이다. Using ptrace allows you to set up system call interception and modification at the user level. Have you ever wondered how system calls can be intercepted? Have you ever tried fooling the kernel by changing system call arg.. 더보기
Playing with ptrace, Part II 원문 : http://www.linuxjournal.com/node/6210/print In Part II of his series on ptrace, Pradeep tackles the more advanced topics of setting breakpoints and injecting code into running processes. In Part I of this article [LJ, November 2002], we saw how ptrace can be used to trace system calls and change system call arguments. In this article, we investigate advanced techniques like setting breakpoi.. 더보기
ptrace 번역 윈도우에 hooking 이 있다면 Linux 에는 ptrace 가 있다. (이게 무슨말인지 아는사람? 둘다 무척 잼있는(?) 기술이다.) 이것을 번역해 놓으신 분이 있으셔서 고맙게도 자료를 떠 왔다. 원문 : http://blog.naver.com/int_com?Redirect=Log&logNo=80055576334 정말 날림으로 번역했다 ㅠㅠ ;;; 그냥 원문 읽자니 잘 집중도 안되서 번역하면서 읽으면 잘 될거 같아서 ㅎㅎ 원문 주소 -> http://linuxgazette.net/issue81/sandeep.html ------------------------------------------------------------ 1. introduction ptrace()는 한 프로세스가 다른 프로세스의 .. 더보기
ptrace() 함수의 PTRACE_ATTACH 옵션 사용시 stop 문제 해결 원문 : http://letsme.com/tag/ptrace -------------------------------------------------------------------------------------------- 리눅스에서 ptrace() 함수의 PTRACE_ATTACH 옵션을 사용하여 특정 프로세스에 attach 할 경우에 return value는 정상이지만 해당 프로세스에 attach 가 되지 않고 detach 후에도 프로세스가 STOP 인 상태로 남게되는 경우가 있습니다. 이런 경우에 ptrace() 함수를 사용하여 attach한 직후에 sleep() 이나 usleep() 함수를 사용하여 스케쥴링을 시키면 원하는대로 동작을 하게 됩니다. ptrace(PTRACE_ATTACH, pid,.. 더보기
Process Tracing Using Ptrace - By Sandeep S 원문 : http://linuxgazette.net/issue81/sandeep.html ------------------------------------------------------------------------------------------- The ptrace system call is crucial to the working of debugger programs like gdb - yet its behaviour is not very well documented - unless you believe that the best documentation is kernel source itself! I shall attempt to demonstrate how ptrace can be used t.. 더보기
How to code debuggers 원문 : http://t-a-w.blogspot.com/2007/03/how-to-code-debuggers.html ------------------------------------------------------------------------------------------ Coding low-level infrastructure like kernels, compilers, and linkers can be very scary, and most programmers stay as far away from them as they can. And the scariest of all are debuggers, which rip apart warm flesh of innocent programs, and .. 더보기