From the course: Learning Assembly Language

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Taking control flow

Taking control flow - Python Tutorial

From the course: Learning Assembly Language

Start my 1-month free trial

Taking control flow

- [Instructor] To show how a program can be exploited remotely, let's make a change to our simulated incoming packet. We'll replace Magnus with dword nine dup 61616161h followed by another dword 0040106Dh. And I'll add some data in code at the end of the program. Dot data db 32 dup zero dot code xs message box zero comma we never get here comma Buffalo comma MB OK invoke exit process comma zero. The message box command is a MASM shorthand way of using the Windows message box API call. The program never calls this xs routine, so the message box should never be displayed. Let's build and execute this. And we never get here. But somehow, we did. We've been Buffalo-ed. Let's debug Buffalo dot exe to see what's happening. The first thing we'll do is run to user code, and then we'll jump to the start of our application code. And we'll go down into the main MCON code. At the bottom right, we can see the stack has our return…

Contents