Bug: file not found reports as hash length exception
#1
Log:
=================
./oclHashcat-plus64.bin -m0 -a3 -1 ?u?l?d?s example.dict.nothere ?1?1?1?1?1?1?1?1
** Valid keyfile for beta usage: Bitweasil (expires 05.03.2013)

WARNING: Hash 'example.dict.nothere': Line-length exception
ERROR: No hashes loaded
=================

To reproduce: Provide oclHashcat with a hash filename that is not present.

Expected behavior: oclHashcat tells me that the file I have listed is not present on the filesystem - file not found, unable to open file, etc.

Observed behavior: The ever-generic line length exception error.

Importance: Minor. Just annoying if one has typoed their filename and is trying to debug why it cannot load hashes.
Reply
#2
Wait, thats a feature! Smile

I dont want to have two parameters where one defines a single-hash and onle defines a hash-file.

I prefer to have that automatically checked. That means oclHashcat checks if example.dict.nothere exists as a file. If yes, it load its as hash-file. Otherwise it loads it as single-hash.
Reply
#3
Could you do a tiny bit of sanity checking re the hash type?

-m0 (raw MD5) should never have anything other than [0-9a-fA-F] in it. If other characters are found, it's clearly not a MD5 hash on the command line.

"Unable to open example.dict.nothere as a file, and does not appear to be a valid MD5 hash. Exiting."
Reply
#4
that might be correct for md5 but there are so many other hashes that allow all chars like the base64 ones. so that would require a special parser for each hash type. a lot of work...
Reply
#5
They're still a valid format.

Up to you. It seems you already have all the code to test it for reading the hashfile - if the file doesn't exist, and you cannot read it is a valid hash, throw some sort of sane error.

"Unable to open hash file %s, and cannot read as a valid type %s hash."
Reply
#6
OK, I can do that. Thank you.
Reply