Here is what the file output looks like from vanitygen:
Pattern: 1ABCD
Address: 1ABCDiVXy67iuRfYYcFouxAWFnjccwgTD1
Privkey: 5JHTbQGS2ZbVQPaWwprMyVCxSrD38tcboKt2QEXj9ABnv3KfzhN
In c,
fprintf() is the function for writing to a file. We only need to look for the lines that use the file-write function to make these particular lines in the output file, and modify them.
Change each code line so that it prints what we want in CSV format? pattern.c appears to have all the code needed to change the file output option (not modify the console output).
In pattern.c, we find the file output code starting at line 584:
if (vcp->vc_result_file) {
FILE *fp = fopen(vcp->vc_result_file, "a");
if (!fp) {
fprintf(stderr,
"ERROR: could not open result file: %s\n",
strerror(errno));
} else {
fprintf(fp,
"Pattern: %s\n"
, pattern);
if (isscript)
fprintf(fp, "P2SHAddress: %s\n", addr2_buf);
fprintf(fp,
"Address: %s\n"
"%s: %s\n",
addr_buf, keytype, privkey_buf);
fclose(fp);
}
}
if (free_ppnt)
EC_POINT_free(ppnt);
}#1: suppress the "pattern" output in pattern.cReplace the red stuff with:
;/ don't print pattern#2: remove the "address" and "privkey" text, and remove the carriage-return between the two lines.Replace the blue stuff with:
fprintf(fp,
"%s, %s\n",
addr_buf, privkey_buf);You need to turn in your geek card if you can't figure out what the code here is doing.