Skip to content
Browse files

Cleaning up usage message

  • Loading branch information...
1 parent 1a26ac8 commit 3e883a0435425bbbb21a7335f4df3c88a4285fec jessekornblum committed Feb 26, 2012
Showing with 123 additions and 93 deletions.
  1. +12 −3 ChangeLog
  2. +1 −1 Makefile.am
  3. +9 −0 NEWS
  4. +1 −1 configure.ac
  5. +2 −2 doc/start-hashdeep.html
  6. +5 −4 doc/start-md5deep.html
  7. +3 −2 man/hashdeep.1
  8. +3 −2 man/md5deep.1
  9. +4 −2 src/dig.cpp
  10. +83 −76 src/main.cpp
View
15 ChangeLog
@@ -1,13 +1,22 @@
+2012-02-27 Jesse Kornblum <research@jessekornblum.com>:
+
+ * man/md5deep.1: Added Simson to the AUTHORS section
+ * src/main.cpp: Formatted usage messages
+ * configure.ac: Version bump to 4.1.1
+ * Makefile.am: Added doc to directories cleaned with make nice
+
2012-02-26 Simson Garfinkel <simsong@FC15>
* src/main.h (d): fixed THREAD typo.
-
* src/display.cpp: changed #if so that it checks for MINGW and not __MINGW_H
-
* configure.ac (MINGW): now explicitly sets MINGW if we are compiling under mingw.
2012-02-10 Jesse Kornblum <research@jessekornblum.com>:
+ * doc/start-hashdeep.html: Clarified how to run the programs.
+
+2012-02-10 Jesse Kornblum <research@jessekornblum.com>:
+
* sample-hashes/sample.{c,jpg}: Added Windows executable with non-executable extension
* src/winpe.cpp, main.cpp, dig.cpp: Added comments
* configure.ac: Version bump to 4.1
@@ -17,7 +26,7 @@
* src/dig.cpp, winpe.h, winpe.cpp, main.cpp: Added check for Windows PE files to expert mode.
-2012-01-30 Jesse Kornblum <research@jessekornblum.com:>
+2012-01-30 Jesse Kornblum <research@jessekornblum.com>:
* src/display.cpp: Reverted previous change, but updated test for presence of vasprintf.
View
2 Makefile.am
@@ -10,7 +10,7 @@ CROSS64_PREFIX = x86_64-w64-mingw32
EXTRA_DIST = FILEFORMAT config.guess config.sub m4/ax_pthread.m4 CONFIGURE_FC.sh
nice:
- rm -f *~ man/*~ src/*~
+ rm -f *~ man/*~ src/*~ doc/*~
preflight:
grep RBF */*.{c,cpp,h,1} doc/* AUTHORS README NEWS TODO ChangeLog
View
9 NEWS
@@ -1,3 +1,12 @@
+** Changes in version 4.1.1 (RBF DATE)
+
+* New Features
+
+* Bug Fixes
+
+ Cleaned up usage message
+
+
** Changes in version 4.1.0 (14 Feb 2012)
* New Features
View
2 configure.ac
@@ -3,7 +3,7 @@
#
AC_PREREQ(2.57)
-AC_INIT([MD5DEEP],[4.1],[research@jessekornblum.com])
+AC_INIT([MD5DEEP],[4.1.1],[research@jessekornblum.com])
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile tests/Makefile tests/testfiles/Makefile ])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
View
4 doc/start-hashdeep.html
@@ -116,9 +116,9 @@ <h3 id="commandprompt"> Opening a command prompt </h3>
double clicking on it! On Microsoft Windows, click on the Start button
and choose "Run..." from the menu. In this dialog box, type <tt>cmd.exe</tt>
and hit enter. A command prompt should appear. In this window, type
-the full path to hashdeep.exe. For example:
+the full path to hashdeep.exe and the files you want to hash. For example:
-<pre> c:\Documents and Settings\jessek\Desktop\hashdeep.exe</pre>
+<pre> c:\Documents and Settings\jessek\Desktop\hashdeep.exe c:\Windows\*</pre>
Note that you <em>can</em> drag the hashdeep icon into this window and
the operating system will fill in the path information for you.
View
9 doc/start-md5deep.html
@@ -134,14 +134,14 @@ <h3 id="manualinstall"> Manual installation </h3>
should be named something like <tt>md5deep-3.7.tar.gz</tt>. Uncompress the file with the
following command:
-<pre> $ tar zxvf md5deep-3.7.tar.gz </pre>
+<pre> $ tar zxvf md5deep-4.1.tar.gz </pre>
</p>
<p>
Change into the decompressed directory
-<pre> $ cd md5deep-3.7 </pre>
+<pre> $ cd md5deep-4.1 </pre>
and configure the program.
@@ -183,9 +183,10 @@ <h3 id="commandprompt"> Opening a command prompt </h3>
double clicking on it! On Microsoft Windows, click on the Start button
and choose "Run..." from the menu. In this dialog box, type <tt>cmd.exe</tt>
and hit enter. A command prompt should appear. In this window, type
-the full path to md5deep.exe. For example:
+the full path to md5deep.exe and then the files you want to hash.
+For example:
-<pre> c:\Documents and Settings\jessek\Desktop\md5deep.exe</pre>
+<pre> c:\Documents and Settings\jessek\Desktop\md5deep.exe c:\Windows\*</pre>
Note that you <em>can</em> drag the md5deep icon into this window and
the operating system will fill in the path information for you.
View
5 man/hashdeep.1
@@ -1,4 +1,4 @@
-.TH HASHDEEP "1" "v4.1.0 \- 14 Feb 2012" "AFOSI" "United States Air Force"
+.TH HASHDEEP "1" "v4.1.1 \- RBF DATE 2012" "AFOSI" "United States Air Force"
.SH NAME
hashdeep \- Compute, compare, or audit multiple message digests
@@ -261,7 +261,8 @@ only one file with a .txt extension).
Returns zero on success, one on error.
.SH AUTHOR
-hashdeep was written by Jesse Kornblum, research@jessekornblum.com.
+hashdeep was written by Jesse Kornblum, research@jessekornblum.com,
+and Simson Garfinkel.
.SH KNOWN ISSUES
Using the \-r flag cannot be used to recursively process all files
View
5 man/md5deep.1
@@ -1,4 +1,4 @@
-.TH MD5DEEP "1" "v4.1.0 \- 14 Feb 2012" "AFOSI" "United States Air Force"
+.TH MD5DEEP "1" "v4.1.1 \- RBF DATE 2012" "AFOSI" "United States Air Force"
.SH NAME
md5deep \- Compute and compare MD5 message digests
@@ -315,7 +315,8 @@ be reported to the developer! See the section "Reporting Bugs" below.
.SH AUTHOR
-md5deep was written by Jesse Kornblum, research@jessekornblum.com.
+md5deep was written by Jesse Kornblum, research@jessekornblum.com
+and Simson Garfinkel.
.SH KNOWN ISSUES
Using the \-r flag cannot be used to recursively process all files
View
6 src/dig.cpp
@@ -659,8 +659,10 @@ void state::dig_normal(const tstring &fn_)
clean_name_posix(fn);
#endif
if (opt_debug) ocb.status("*** cleaned:%s",global::make_utf8(fn).c_str());
- if (should_hash(fn)){
- std::cerr << "ocb=" << (int *)&ocb << "\n";
+ if (should_hash(fn))
+ {
+ // RBF - Debuging code
+ // std::cerr << "ocb=" << (int *)&ocb << "\n";
ocb.hash_file(fn);
}
}
View
159 src/main.cpp
@@ -130,65 +130,72 @@ tstring state::generate_filename(const tstring &input)
// function should produce no more than 22 lines of text.
void state::usage()
{
- if(usage_count==1){
- ocb.status("%s version %s by %s.",progname.c_str(),VERSION,AUTHOR);
- ocb.status("%s %s [-c <alg>] [-k <file>] [-amxwMXrespblvv] [-jnn] [-V|-h] [-o <mode>] [FILES]",
- CMD_PROMPT,progname.c_str());
-
- /* Make a list of the hashes */
- ocb.status("-c <alg1,[alg2]> - Compute hashes only. Defaults are MD5 and SHA-256");
- fprintf(stdout," legal values: ");
- for (int i = 0 ; i < NUM_ALGORITHMS ; i++){
- fprintf(stdout,"%s%s",hashes[i].name.c_str(),(i+1<NUM_ALGORITHMS) ? "," : NEWLINE);
- }
+ if (1 == usage_count)
+ {
+ ocb.status("%s version %s by %s.",progname.c_str(),VERSION,AUTHOR);
+ ocb.status("%s %s [OPTION]... [FILES]...",CMD_PROMPT,progname.c_str());
+
+ // Make a list of the hashes
+ ocb.status("-c <alg1,[alg2]> - Compute hashes only. Defaults are MD5 and SHA-256");
+ fprintf(stdout," legal values: ");
+ for (int i = 0 ; i < NUM_ALGORITHMS ; i++)
+ {
+ fprintf(stdout,"%s%s",hashes[i].name.c_str(),(i+1<NUM_ALGORITHMS) ? "," : NEWLINE);
+ }
- ocb.status("-p <size> - piecewise mode. Files are broken into blocks for hashing");
- ocb.status("-r - recursive mode. All subdirectories are traversed");
- ocb.status("-d - output in DFXML (Digital Forensics XML)");
- ocb.status("-k <FN> - add a file of known hashes");
- ocb.status("-a - audit mode. Validates FILES against known hashes. Requires -k");
- ocb.status("-m - matching mode. Requires -k");
- ocb.status("-x - negative matching mode. Requires -k");
- ocb.status("-w - in -m mode, displays which known file was matched");
- ocb.status("-M and -X act like -m and -x, but display hashes of matching files");
- ocb.status("-e - compute estimated time remaining for each file");
- ocb.status("-s - silent mode. Suppress all error messages");
- ocb.status("-b - prints only the bare name of files; all path information is omitted");
- ocb.status("-l - print relative paths for filenames");
- ocb.status("-i - only process files smaller than the given threshold");
- ocb.status("-o - only process certain types of files. See README/manpage");
- ocb.status("-v - verbose mode. Use again to be more verbose; -V display version & exit.");
- ocb.status("-d - output in DFXML; -W FILE - write to FILE.");
+ ocb.status("-p <size> - piecewise mode. Files are broken into blocks for hashing");
+ ocb.status("-r - recursive mode. All subdirectories are traversed");
+ ocb.status("-d - output in DFXML (Digital Forensics XML)");
+ ocb.status("-k <file> - add a file of known hashes");
+ ocb.status("-a - audit mode. Validates FILES against known hashes. Requires -k");
+ ocb.status("-m - matching mode. Requires -k");
+ ocb.status("-x - negative matching mode. Requires -k");
+ ocb.status("-w - in -m mode, displays which known file was matched");
+ ocb.status("-M and -X act like -m and -x, but display hashes of matching files");
+ ocb.status("-e - compute estimated time remaining for each file");
+ ocb.status("-s - silent mode. Suppress all error messages");
+ ocb.status("-b - prints only the bare name of files; all path information is omitted");
+ ocb.status("-l - print relative paths for filenames");
+ ocb.status("-i - only process files smaller than the given threshold");
+ ocb.status("-o - only process certain types of files. See README/manpage");
+ ocb.status("-v - verbose mode. Use again to be more verbose");
+ ocb.status("-d - output in DFXML; -W FILE - write to FILE.");
#ifdef HAVE_PTHREAD
- ocb.status("-jnn run nn threads (default %d)",threadpool::numCPU());
+ ocb.status("-j <num> - use num threads (default %d)",threadpool::numCPU());
#else
- ocb.status("-jnn ignored (compiled without pthreads)");
+ ocb.status("-j <num> - ignored (compiled without pthreads)");
#endif
+ }
- }
- if(usage_count==2){ // -hh
- ocb.status("-0 - use a NULL for newline.");
- ocb.status("-u - escape Unicode");
- ocb.status("-B - verbose mode; repeat for more verbosity");
- ocb.status("-C - Macintosh only --- use Common Crypto hash functions");
- ocb.status("-Fb - I/O mode buffered; -Fu unbuffered; -Fm memory-mapped");
- ocb.status("-o[bcpflsde] - only process certain types of files:");
- ocb.status(" b=block dev; c=character dev; p=named pipe");
- ocb.status(" f=regular file; l=symlink; s=socket; d=door e=Windows PE");
- ocb.status("-Dnn - set debug level to nn");
- }
- if(usage_count==3){ // -hhh - adds debugging information
- ocb.status("sizeof(off_t)= %d",sizeof(off_t));
+ // -hh makes us more verbose
+ if (2 == usage_count)
+ {
+ ocb.status("-V - display version number and exit");
+ ocb.status("-0 - use a NUL (\\0) for newline.");
+ ocb.status("-u - escape Unicode");
+ ocb.status("-B - verbose mode; repeat for more verbosity");
+ ocb.status("-C - OS X only --- use Common Crypto hash functions");
+ ocb.status("-Fb - I/O mode buffered; -Fu unbuffered; -Fm memory-mapped");
+ ocb.status("-o[bcpflsde] - Expert mode. only process certain types of files:");
+ ocb.status(" b=block dev; c=character dev; p=named pipe");
+ ocb.status(" f=regular file; l=symlink; s=socket; d=door e=Windows PE");
+ ocb.status("-D <num> - set debug level");
+ }
+
+ /// -hhh mode includes debugging information.
+ if (3 == usage_count)
+ {
+ ocb.status("sizeof(off_t)= %d",sizeof(off_t));
#ifdef HAVE_PTHREAD
- ocb.status("HAVE_PTHREAD");
+ ocb.status("HAVE_PTHREAD");
#endif
#ifdef HAVE_PTHREAD_H
- ocb.status("HAVE_PTHREAD_H");
+ ocb.status("HAVE_PTHREAD_H");
#endif
#ifdef HAVE_PTHREAD_WIN32_PROCESS_ATTACH_NP
- ocb.status("HAVE_PTHREAD_WIN32_PROCESS_ATTACH_NP");
+ ocb.status("HAVE_PTHREAD_WIN32_PROCESS_ATTACH_NP");
#endif
- }
+ }
}
@@ -198,45 +205,45 @@ void state::md5deep_usage(void)
{
if(usage_count==1){
ocb.status("%s version %s by %s.",progname.c_str(),VERSION,AUTHOR);
- ocb.status("%s %s [OPTION]... [FILE]...",CMD_PROMPT,progname.c_str());
+ ocb.status("%s %s [OPTION]... [FILES]...",CMD_PROMPT,progname.c_str());
ocb.status("See the man page or README.txt file or use -hh for the full list of options");
ocb.status("-p <size> - piecewise mode. Files are broken into blocks for hashing");
- ocb.status("-r - recursive mode. All subdirectories are traversed");
- ocb.status("-e - show estimated time remaining for each file");
- ocb.status("-s - silent mode. Suppress all error messages");
- ocb.status("-z - display file size before hash");
+ ocb.status("-r - recursive mode. All subdirectories are traversed");
+ ocb.status("-e - show estimated time remaining for each file");
+ ocb.status("-s - silent mode. Suppress all error messages");
+ ocb.status("-z - display file size before hash");
ocb.status("-m <file> - enables matching mode. See README/man page");
ocb.status("-x <file> - enables negative matching mode. See README/man page");
ocb.status("-M and -X are the same as -m and -x but also print hashes of each file");
- ocb.status("-w - displays which known file generated a match");
- ocb.status("-n - displays known hashes that did not match any input files");
+ ocb.status("-w - displays which known file generated a match");
+ ocb.status("-n - displays known hashes that did not match any input files");
ocb.status("-a and -A add a single hash to the positive or negative matching set");
- ocb.status("-b - prints only the bare name of files; all path information is omitted");
- ocb.status("-l - print relative paths for filenames");
- ocb.status("-t - print GMT timestamp (ctime)");
- ocb.status("-iSIZE/-ISIZE - only process files smaller/larger than SIZE");
- ocb.status("-v - display version number and exit");
- ocb.status("-d - output in DFXML; -u - Escape Unicode; -W FILE - write to FILE.");
+ ocb.status("-b - prints only the bare name of files; all path information is omitted");
+ ocb.status("-l - print relative paths for filenames");
+ ocb.status("-t - print GMT timestamp (ctime)");
+ ocb.status("-i/I <size> - only process files smaller/larger than SIZE");
+ ocb.status("-v - display version number and exit");
+ ocb.status("-d - output in DFXML; -u - Escape Unicode; -W FILE - write to FILE.");
#ifdef HAVE_PTHREAD
- ocb.status("-jnn run nn threads (default %d)",threadpool::numCPU());
+ ocb.status("-j <num> - use num threads (default %d)",threadpool::numCPU());
#else
- ocb.status("-jnn ignored (compiled without pthreads)");
+ ocb.status("-j <num> - ignored (compiled without pthreads)");
#endif
- ocb.status("-Z - traige mode; -h - help; -hh - full help");
+ ocb.status("-Z - triage mode; -h - help; -hh - full help");
}
if(usage_count==2){ // -hh
- ocb.status("-S - Silent mode, but warn on bad hashes");
- ocb.status("-0 - use a NULL for newline.");
- ocb.status("-k - print asterisk before filename");
- ocb.status("-u - escape Unicode");
- ocb.status("-B - verbose mode; repeat for more verbosity");
- ocb.status("-C - Macintosh only --- use Common Crypto hash functions");
- ocb.status("-Fb - I/O mode buffered; -Fu unbuffered; -Fm memory-mapped");
- ocb.status("-ffilename - take list of files to hash from filename");
- ocb.status("-o[bcpflsde] - only process certain types of files:");
- ocb.status(" b=block dev; c=character dev; p=named pipe");
- ocb.status(" f=regular file; l=symlink; s=socket; d=door e=Windows PE");
- ocb.status("-Dnn - set debug level to nn");
+ ocb.status("-S - Silent mode, but warn on bad hashes");
+ ocb.status("-0 - use a NUL (\\0) for newline.");
+ ocb.status("-k - print asterisk before filename");
+ ocb.status("-u - escape Unicode characters in filenames");
+ ocb.status("-B - verbose mode; repeat for more verbosity");
+ ocb.status("-C - OS X only --- use Common Crypto hash functions");
+ ocb.status("-Fb - I/O mode buffered; -Fu unbuffered; -Fm memory-mapped");
+ ocb.status("-f <file> - take list of files to hash from filename");
+ ocb.status("-o[bcpflsde] - expert mode. Only process certain types of files:");
+ ocb.status(" b=block dev; c=character dev; p=named pipe");
+ ocb.status(" f=regular file; l=symlink; s=socket; d=door e=Windows PE");
+ ocb.status("-D <num> - set debug level to nn");
}
if(usage_count==3){ // -hhh
ocb.status("sizeof(off_t)= %d",sizeof(off_t));

0 comments on commit 3e883a0

Please sign in to comment.
Something went wrong with that request. Please try again.