stack3 생김새가 함수 포인터로 점프하나봅니다.Dump of assembler code for function main:0x08048438 :push ebp0x08048439 :mov ebp,esp0x0804843b :and esp,0xfffffff00x0804843e :sub esp,0x60//60byte 할당0x08048441 :mov DWORD PTR [esp+0x5c],0x0//modified = 00x08048449 :lea eax,[esp+0x1c]//eax = *buffer0x0804844d :mov DWORD PTR [esp],eax0x08048450 :call 0x8048330 //유저 인풋0x08048455 :cmp DWORD PTR [esp+0x5c],0x0//cmp(modified == 0).. 더보기 stack2 GREENIE라는 환경변수 설정하라고하네요.값 암거나 주고 설정해도 결과에는 변함없었어요. 어셈을 봅시다. Dump of assembler code for function main:0x08048494 :push ebp0x08048495 :mov ebp,esp0x08048497 :and esp,0xfffffff00x0804849a :sub esp,0x60//0x60byte 할당0x0804849d :mov DWORD PTR [esp],0x80485e0//GREENIE 라는 문자열을 esp에0x080484a4 :call 0x804837c //getenv("GREENIE");0x080484a9 :mov DWORD PTR [esp+0x5c],eax//있으면 eax에 환경변수 값이 들어감 getenv()는 대응하는.. 더보기 stack1 인자로 받아들인 값을 주소값처럼 활용하나보네요 이런식으로 생겼어요 0x08048464 :push ebp0x08048465 :mov ebp,esp0x08048467 :and esp,0xfffffff00x0804846a :sub esp,0x60//0x60byte 할당0x0804846d :cmp DWORD PTR [ebp+0x8],0x1//첫번째 파라미터0x08048471 :jne 0x8048487 //0x1이랑 다르면 점프. 인자 없으면 0x1임0x08048473 :mov DWORD PTR [esp+0x4],0x80485a00x0804847b :mov DWORD PTR [esp],0x10x08048482 :call 0x8048388 0x08048487 :mov DWORD PTR [esp+0x5c],0x0//.. 더보기 이전 1 ··· 22 23 24 25 26 27 다음