> So, having never heard of shellcode before, I assumed it was just another way of saying shell script. But I scroll to the bottom and see
(*(void(*)()) shellcode)();
> and suddenly this looks way more interesting. Is it really possible to literally just execute random bytes stored in a string like that?
Well it's just a sequence of bytes somewhere in-memory, no? If the C compiler allows the cast, then it'd compile fine, and the CPU wouldn't know the difference; it'd just execute whatever instructions the sequence of bytes listed.
Well it's just a sequence of bytes somewhere in-memory, no? If the C compiler allows the cast, then it'd compile fine, and the CPU wouldn't know the difference; it'd just execute whatever instructions the sequence of bytes listed.