Today a colleague found the most evil code I've seen so far:
This works out-of-the-box on Linux/gcc, in MSVC you need to disable data execution protection by adding these lines:
Original source: https://www.reddit.com/r/shittyprogrammi..._c/czszrdf
extern "C" const long long main = -4323769003089592391;
This works out-of-the-box on Linux/gcc, in MSVC you need to disable data execution protection by adding these lines:
#pragma comment(linker, "/SECTION:.idata,RWE") #pragma comment(linker, "/SECTION:.rdata,RWE")
Original source: https://www.reddit.com/r/shittyprogrammi..._c/czszrdf