I found this piece of code:
goto*&L"\xfeeb";
It causes the program to hang forever, apparently through calling the x64 instructions 0xEB
and 0xFE
(in that order, due to x64's little-endianness). 0xEB
is JMP according to the x86 Opcode and Instruction Reference.
I understand what the code does, and that it is equivalent to a function running the instructions 0xEB 0xFE
, so it can also be written as int (*foo)() = L"\xfeeb"; foo();
, or if we wanted to get really obfuscated, ((int(*)())L"\xfeeb")();
. This is due to the fact that strings are marked executable by default on Linux.
However, goto
is really strict. I don't understand why goto*&L"\xfeeb";
works at all, or what the crazy pointer magic *&
is doing, or why the wide mark L
is necessary. Can someone explain?