Is it possible to load a binary file into memory and execute it in windows
I am trying to write a program to read a binary file from memory execute it and exit but the OS doesn't seem to let me execute it from memory, the entire point of this exercise is to load a binary file with no header into memory. This is my code for the binary file: push eax mov eax,3 mov edi,eax sub eax,edi pop eax leave ret And my loader is as follows: int main(int argc, char **argv){ void (*ptr)(void); FILE *fo = fopen(argv[1],"r"); int l = fseek(fo,0,SEEK_END); fread((void*)ptr,l*sizeof(char),1,fo); ptr(); return 0; } I know I am probably going about this the wrong way. While the code you