Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Highjacking the return address can only be done if you know you actually have a return address, and a reliable way to get to that return address. Function inlining can change that, adding local variables could change that, omitting frame pointer, etc.

It would also need to be a function that will truly be implemented as one following the ABI, which usually happens when the function is exported. Often times, internal functions won't follow the platform ABI exactly.

Just changing the compiler version is probably enough to break anything like this.

Save the return address highjacking stuff for assembly code.

---

Meanwhile, I personally have written C code that does mess with the stack pointer. It's GBA homebrew, so the program won't quit or finish execution, and resetting the stack pointer has the effect of giving you a little more stack memory.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: