わりとありがちなネタで。まったく関係ない講義受けてるときにふと思いついた。 #include <stdio.h> #include <string.h> char COUNTER_CODE[] = { 0x55,0x89,0xe5,0xff, 0x05,0x00,0x00,0x00, 0x00,0xa1,0x00,0x00, 0x00,0x00,0xc9,0xc3 }; /* int falsecounter(){ return ++*((int *)0x00); } */ int (*makecounter())(){ char *counter = (char *)malloc(16); unsigned int count = (unsigned int)calloc(1, 4); memcpy(counter, COUNTER_CODE, 16); memcpy(counter+5