Skip to content

Commit

Permalink
fix inline comments in dictionary files. The extrac checks broke the …
Browse files Browse the repository at this point in the history
…earlier logic, we now look for a hash sign in the current line if found we try to add a null terminator before the hash sign until we find a hexdigit. Apply old logic on the new shorter line.
  • Loading branch information
iceman1001 committed Jan 27, 2025
1 parent 4803f51 commit 6624a97
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions client/src/fileutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -2398,8 +2398,18 @@ int loadFileDICTIONARY_safe_ex(const char *preferredName, const char *suffix, vo
continue;
}

char *pos = strstr(line, "#");
if (pos) {
// we found a inline comment, add a null terminator, until we hit hexadecimal char
while (isxdigit(pos[0]) == 0) {
pos[0] = 0x00;
--pos;
}
}

// larger keys than expected is skipped
if (strlen(line) > keylen) {
PrintAndLogEx(INFO, "larger %zu - %s", strlen(line), line);
continue;
}

Expand Down

0 comments on commit 6624a97

Please sign in to comment.