rainbowcrack, a password hash algorithm, has no default charset.txt path in its code. In Gentoo, the charset.txt file gets installed to /usr/share/rainbowcrack/charset.txt, but this file is never (automatically) chosen - it fails if one is not found in the local path (i.e. where the code is executed from). While this is normal for most uses of the program, it is somewhat expected that programs will try and use a set of "Defaults" especially when first running a program and before customizations begin. Some uses might not even require this patch - but it would help usability, in general. I'm sure there is a standard way to patch this, but here's the patch I came up with that makes it work (tm) :). Please respond with patch format questions, mainly because I'd like to fix the patch even if its not accepted into Gentoo, to know how to do it in the future. -Roger Ward -- rainbowcrack-1.2-src-charsetpath.patch -- diff -rU9 rainbowcrack-1.2-src/src/ChainWalkContext.cpp rainbowcrack-1.2-src.orig/src/ChainWalkContext.cpp --- rainbowcrack-1.2-src/src/ChainWalkContext.cpp 2006-10-30 18:39:55.000000000 -0500 +++ rainbowcrack-1.2-src.orig/src/ChainWalkContext.cpp 2003-11-23 00:33:44.000000000 -0500 @@ -52,25 +52,19 @@ for (i = 0x00; i <= 0xff; i++) m_PlainCharset[i] = i; m_nPlainCharsetLen = 256; m_sPlainCharsetName = sName; m_sPlainCharsetContent = "0x00, 0x01, ... 0xff"; return true; } vector<string> vLine; - if (!ReadLinesFromFile("charset.txt", vLine)) - { - ReadLinesFromFile("/usr/share/rainbowcrack/charset.txt", vLine); - if (vLine.size()>0) - printf("Read charset.txt from default /usr/share/rainbowcrack/\n"); - } - if (vLine.size()>0) + if (ReadLinesFromFile("charset.txt", vLine)) { int i; for (i = 0; i < vLine.size(); i++) { // Filter comment if (vLine[i][0] == '#') continue; vector<string> vPart;
Created attachment 100834 [details, diff] Patch to hardcode the default path of charset.txt as an *alternative* into rtgen and rtdump
Thanks! Added rainbowcrack-1.2-r1. Fixed somewhat differently, please check it out.