Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

My first C program

Name: Anonymous 2014-05-17 2:44

#include <stdio.h>

void f() { printf("hello, world\n"); }

char prog[6];
typedef void (*callable)();

int main() {
prog[0] = 0xe8;
*(int *)(prog+1) = ((char *)f)-((char *)(prog+5));
prog[5] = 0xc3;
((callable)prog)();
}


I wrote this last night after finishing K&R. How is it?

Name: Anonymous 2015-07-25 3:45

>>5
How did he die?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List