Qt::MatchFlags SearchOptions::getMatchFlags() const { // *** match flags *** // MatchExactly = 0, Performs QVariant-based matching. // MatchContains = 1, // MatchStartsWith = 2, // MatchEndsWith = 3, // MatchRegExp = 4, // MatchWildcard = 5, // MatchFixedString = 8, Performs string-based matching. // MatchCaseSensitive = 16, // MatchWrap = 32, // MatchRecursive = 64 Searches the entire hierarchy, but I do not have heirarchical data. Qt::MatchFlags flags = Qt::MatchExactly; if (isMatchEntireString()) flags |= Qt::MatchFixedString; if (isContains()) flags |= Qt::MatchContains; if (isStartsWith()) flags |= Qt::MatchStartsWith; if (isEndsWith()) flags |= Qt::MatchEndsWith; //if (isMatchAsString()) flags |= Qt::MatchFixedString; if (isRegularExpression()) flags |= Qt::MatchRegExp; if (isWildCard()) flags |= Qt::MatchWildcard; if (isCaseSensitive()) flags |= Qt::MatchCaseSensitive; if (isWrap()) flags |= Qt::MatchWrap; return flags; }
int apr1_parse_hash(char *hashline, char *filename, struct crack_hash* hash) { if (!hashline || !hash) return ERR_INVALID_PARAM; if (strlen(hashline)<2) return ERR_INVALID_PARAM; char line[HASHFILE_MAX_LINE_LENGTH]; snprintf(line, HASHFILE_MAX_LINE_LENGTH-1, "%s", hashline); if(strlen(hashline)==37 && isStartsWith(hashline,"$apr1")) { std::vector<char*> v = split(line,"$"); if((v.size() == 3) && (strlen(v[0]) == 4) && (strlen(v[2]) == 22) && isAlphaDotSlash(v[1]) && isAlphaDotSlash(v[2])) { strcpy(hash->hash, hashline); strcpy(hash->salt, ""); strcpy(hash->salt2, ""); return 0; } else return 1; } else return 1; }
int nsldaps_check_valid(struct crack_hash* hash) { if(!hash) return ERR_INVALID_PARAM; if((strlen(hash->hash)==46) && isStartsWith(hash->hash,"{SSHA}") && isbase64(hash->hash+6)) return 1; else return 0; }
int apr1_check_valid(struct crack_hash* hash) { if (!hash) return ERR_INVALID_PARAM; if((strlen(hash->hash) == 37) && isStartsWith(hash->hash,"$apr1")) return 1; else return 0; }
int nsldaps_parse_hash(char *hashline, char *filename, struct crack_hash* hash) { if (!hashline || !hash) return ERR_INVALID_PARAM; if (strlen(hashline)<2) return ERR_INVALID_PARAM; char line[HASHFILE_MAX_LINE_LENGTH]; snprintf(line, HASHFILE_MAX_LINE_LENGTH-1, "%s", hashline); if((strlen(hashline)==46) && isStartsWith(hashline,"{SSHA}") && isbase64(hashline+6)) { strcpy(hash->hash, hashline); strcpy(hash->salt, ""); strcpy(hash->salt2, ""); return 0; } else return 1; }
QString SearchOptions::serializeSettings() const { QStringList list; if (isMatchEntireString()) list << "MatchEntireString"; if (isContains()) list << "Contains"; if (isStartsWith()) list << "StartsWith"; if (isEndsWith()) list << "EndsWith"; if (isMatchAsString()) list << "AsString"; if (isRegularExpression()) list << "RegExp"; if (isWildCard()) list << "Wildcard"; list << (isCaseSensitive() ? "CaseSensitive" : "CaseInSensitive"); list << (isWrap() ? "Wrap" : "NoWrap"); list << (isBackwards() ? "Backward" : "Forward"); list << (isAllColumns() ? "AllColumns" : "OneColumn"); if (isReplace()) list << "Replace"; if (isReplaceAll()) list << "ReplaceAll"; return list.join(","); }