diff options
author | Timber | 2024-06-02 12:13:31 +0200 |
---|---|---|
committer | Timber | 2024-06-02 12:13:31 +0200 |
commit | 1f7431be48682d8fbe3b475ad4e599f38b417994 (patch) | |
tree | ad304313881c0f7b24879796644b5cef81d1b4cf | |
parent | d17eda60e04bde07ed403ec32743a3214e8f5655 (diff) |
Explain return values
-rw-r--r-- | future-of-pwning-1.md | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/future-of-pwning-1.md b/future-of-pwning-1.md index a5bb180..f1b56e6 100644 --- a/future-of-pwning-1.md +++ b/future-of-pwning-1.md @@ -150,7 +150,7 @@ int main() } ``` -Except for the `buf` allocation, we already know how to do all of this stuff. +Except for the `buf` allocation and the storing of return values, we already know how to do all of this stuff. For memory allocation we can look into the code examples again -- specifically [`guess_number.as`](https://github.com/ForwardCom/code-examples/blob/master/guess_number.as) sounds promising, since it should expect user input and thus store strings. Here there's two relevant regions: ```asm @@ -162,6 +162,8 @@ int8 buf[buffersize] // input buffer bss end ``` +For storing of return values we can learn (again from the examples) that it's stored in `r0`. + So we can statically allocate memory in the `datap uninitialized` section. Now by modifying the `hello.as` program it's quite straight forward to implement our solution: ```asm |