3 ms·
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 ins
by comex 12y ago
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.
- zwegner 12y agoYup. 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;