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

Not quite - what matters (normally) is the address of the symbol, not the bytes located there, since in the case of a real function those bytes would be the instructions. So this will either execute the bytes at &main as instructions (4 zero bytes, and whatever follows), or, more likely, crash due to memory protections, as described in the article.


Yup. You can get a working program with the simple:

  const int main = 0xC3;
...which is just a return. Or you can get fancy and make it exit successfully by clearing eax first:

  const int main = 0xC3C031;




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

Search: