How does this code work?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
sc[] = bla bla bla a bunch of hex;
int main(void)
{
(*(void(*)()) sc)();
}
This (*(void(*)()) sc)();
specifically is what I'm unsure of.
Sc[] is an array of machine instructions, with each byte described in hexadecimal.
The line in main interprets sc as a pointer to a function that takes no arguments and returns a void, and calls the function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With