--- /home/larry/zenbleed.c 2023-07-26 17:06:42.067965409 +0000 +++ zenbleed.c 2023-07-26 17:09:26.882992091 +0000 @@ -36,6 +36,7 @@ static bool asciionly = true; static bool secretonly = false; +static bool redact = false; // Minor variations in alignment seem to make the exploit work better on // different SKUs. These are some variants to try and see what works best. @@ -101,10 +102,10 @@ // Escape any confusing characters if (*s == '"' || *s == '\\') - fputc('\\', stdout); + if (!redact) fputc('\\', stdout); // Print normal ascii. if (isalnum(*s) || ispunct(*s)) { - fputc(*s, stdout); + if (!redact) fputc(*s, stdout); else fputc('X',stdout); } else if (isspace(*s)) { fputc(' ', stdout); } else { @@ -232,6 +233,7 @@ logmsg(" -t N Give up after this many seconds."); logmsg(" -n N Set nice level, can improve results on some systems."); logmsg(" -a Print all data, not just ASCII strings."); + logmsg(" -R Redact output data with X's."); logmsg(" -s Only print the magic hammer value (used for benchmarking)."); logmsg(" -p STR Pattern mode, try to continue string STR based on sampling leaked values."); logmsg(" -q Quiet, reduce verbosity."); @@ -258,7 +260,7 @@ pattern = 0; // String to search for. cores = 0; // Which cpus to run on. - while ((opt = getopt(argc, argv, "r:qp:sat:n:hH:c:v:m:")) != -1) { + while ((opt = getopt(argc, argv, "r:qbp:sat:n:hH:c:v:m:")) != -1) { switch (opt) { case 'v': variant = atoi(optarg); break; @@ -280,6 +282,8 @@ break; case 'q': quiet = true; break; + case 'R': redact = true; + break; case 'r': cores = optarg; break; default: