I get machine code for the function:
and I want to call them in another program,Code:void ptr() { printf("Hello"); }
Look:
but it always display Segmentation fault,Code:typedef void (*PF)(); unsigned char buff[]="\x55\x89\xe5\x83\xec\x08\xc7\x04\x24\x50\x85\x04\x08\xe8\x02\xff\xff\xff\xc9\xc3"; int main(void) { PF pf=(PF)buff pf(); return 0; }
how to call the code?