I'm wondering why does the following code causes an execution error?
#include <stdlib.h>
int main(void) {
asm("pushf\norl $ 0x40000, (%esp)\npopf\n");
*((int*) (((char*) malloc(5)) + 1)) = 23;
return 0;
}
Thanks !
I'm wondering why does the following code causes an execution error?
#include <stdlib.h>
int main(void) {
asm("pushf\norl $ 0x40000, (%esp)\npopf\n");
*((int*) (((char*) malloc(5)) + 1)) = 23;
return 0;
}
Thanks !
Probably because you are modifying alignment check flag, which is AFAIK protected. Or because malloc() returns an aligned region, and your access is unaligned? Not sure, but why do you need to touch this flag at all?