Techniques-> Stack
Last updated
Last updated
We are considering the same hello world program.
In this technique we will treat "hello world" string as data, and push it on the stack in reverse order (as the stack goes from high to low in memory). Then we get this string as a reference from RSP.
Let's convert "hello world" string in hex using python
The hex equivalent in reverse for hello world is: 0a646c726f57206f6c6c6548
I tried pushing the entire thing at once and got this error:
Since message is 12 bytes, we need to break it down to 8 bytes and 4 bytes. Move first 4 bytes first onto the stack and then use a register to move the last 8 bytes.
Good. This works. But there are a lot of 0s still
So, I corrected it like so:
Good, as usual adding the opcodes in skeleton to test it's functionality.