Lecture05 - Smashing the Stack for Fun and and Profit(aka...

This preview shows page 1 out of 6 pages.

Unformatted text preview: “Smashing the Stack for Fun and and Profit” (aka Project 1) A Crash Course in x86 Crash • General-purpose registers: – EAX, EBX, ECX, EDX, ESI, EDI, … • Stack registers: – ESP – Current stack pointer. Grows down. – EBP – Stack frame pointer. Used to address locals, arguments, etc. • EIP – Instruction Pointer/Program Counter A Crash Course in x86 Crash • Stack manipulation instructions: – PUSH arg: ESP - 4 -> ESP, arg -> @ESP – POP arg: @ESP -> arg, ESP + 4 -> ESP • Function call instructions: – CALL addr: PUSH EIP, JMP addr – RET: POP EIP – LEAVE: EBP -> ESP, POP EBP A Crash Course in GDB Crash • • • • • info reg: Dump registers disassemble (Only for the current function) run: (re)start program continue break: set a breakpoint: – b foo – b foo+10 – b *0x080fcde8 • step, stepi A Crash Course in GDB Crash • x: Examine – x buf – x $esp – x 0x0804face – x/20i main – x/40x buf –… Let’s Let’s h4x0r!!!11 ...
View Full Document

{[ snackBarMessage ]}

Get FREE access by uploading your study materials

Upload your study materials now and get free access to over 25 million documents.

Upload now for FREE access Or pay now for instant access
Christopher Reinemann
"Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

Ask a question for free

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern