GDB로 쉘코드 생성하기를 공부하던 중에 .....
글쓴이: minsu9101 / 작성시간: 월, 2009/09/14 - 9:41오후
c언어 코드 [shell.c] #include<stdio.h> #include<unistd.h> int main() { char *name[2]; name[0] = "/bin/sh" name[1] = 0; execve(name[0], name, NULL); } 어셈블리 코드(GDB를 사용하여) .main 0x8048198 <main>: push %ebp 0x8048199 <main+1>: mov %esp,%ebp 0x804819b <main+3>: sub $0x8,%esp 0x804819e <main+6>: movl $0x8071548,0xfffffff8(%ebp) 0x80481a5 <main+13>: movl $0x0,0xfffffffc(%ebp) 0x80481ac <main+20>: push 0x0 0x80481ae <main+22>: lea 0xfffffff8(%ebp),%eax 0x80481b1 <main+25>: push %eax 0x80481b2 <main+26>: mov 0xfffffff8(%ebp),%eax 0x80481b5 <main+29>: push %eax 0x80481b6 <main+30>: call 0x804d02c<execve> 0x80481bb <main+35>: add $0xc,%esp 0x80481be <main+38>: leave .execve 0x08048258 <execve+0>: jmp *0x8049508 0x0804825e <execve+6>: push $0x0 0x08048263 <execve+11>: jmp 0x8048248 <_init+24> End of assembler dump.
이런 소스에서 execve()함수를 호출 했을때 나오는 저 어셈블리 구문들이 무슨 뜻인지 모르겠습니다
가르침을 주세요 고수님들 ㅜㅜ
Forums:
댓글 달기