/***************************************************************
 *
 * Author:    Josh Harris
 * Created:   2010-12-01
 * Copyright: Josh Harris (www.tateu.net)
 * License:
 Redistribution and use in source and binary forms, with or without modification,
 are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice,
     this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice,
     this list of conditions and the following disclaimer in the documentation and/or
     other materials provided with the distribution.
  3. The name of the author may not be used to endorse or promote products derived
     from this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 Portions Based on TrueCrypt, freely available at http://www.truecrypt.org/
 **************************************************************/





Input file
	"C:\TrueCrypt_File.tc"                       -- A TrueCrypt file hosted volume
	"\\?\GLOBALROOT\Device\Harddisk0\Partition1" -- A TrueCrypt partition hosted volume
	"C:\RescueDisc.iso"                          -- A TrueCrypt system resuce disc
	"C:\Backupheader.h"                          -- A TrueCrypt backup header

Password pattern
	use [] to specify a character pattern type
		[1234]{2} will build a 2 character pattern using all of the available characters inside the brackets
			11  12  13  14  21  22  23  34  31  32  33  34  41  42  43  44
	You can also limit the number of duplicated values in a character or string pattern type by using {count:dup_limit)
		[1234]{2:1} will build a 2 character pattern using all of the available characters inside the brackets but will not repeat any characters more than 1 time.
			12 13 14 21 23 24 31 32 34 41 42 43
		[123]{3:2} a 3 character pattern type with a max of 2 duplicated characters
			112 113 121 122 123 131 132 133 211 212 213 221 223 231 232 233 311 312 313 321 322 323 331 332
		[12]{1-3} will generate a variable length character pattern from 1 to 3 with no duplicates
			  1   2  11  12  21  22 111 112 121 122 211 212 221 222
		[12]{1-3:2} will generate a variable length character pattern from 1 to 3 with no duplicates and no character repeated more than twice
			  1   2  11  12  21  22     112 121 122 211 212 221
	use () to specify a string pattern type, with each string separated by |
		(red|blue|black){2} will build a 2 string pattern using all of the available strings inside the parentheses
			redred  redblue  redblack  bluered  blueblue  blueblack  blackred  blackblue  blackblack
	You can also limit duplicate values in a string pattern type
		(red|blue|black){2:1}
			redblue redblack bluered blueblack blackred blackblue
	If you know the first 16 characters (vUEgSRL745dPr2YM) of your password but forgot the last 4, your pattern might look like this:
		vUEgSRL745dPr2YM[a-zA-Z0-9]{4}
	Variable length strings are generated by using the range notation
		{2-5} generates a variable length pattern from 2 to 5
		{3-5:2} generates a variable length pattern from 3 to 5 with no pattern repeated more than twice
		{1,3-5} generates variable length patterns of lengths 1, 3, 4 and 5
		{1,3,5:1} generates variable length patterns of lengths 1, 3 and 5 with no pattern repeated more than once
		[12]{0-2}[ab]{1} a length of 0 can be used to skip over a pattern completely
			a b 1a 1b 2a 2b 11a 11b 12a 12b 21a 21b 22a 22b
		(s1|s2){0-1}(s3|s4){0-1}
			s3 s4 s1 s1s3 s1s4 s2 s2s3 s2s4
		(s1|s2){1,3}
			s1 s2 s1s1s1 s1s1s2 s1s2s1 s1s2s2 s2s1s1 s2s1s2 s2s2s1 s2s2s2
	Character range classes [a-zA-Z]
		Values are based on the ASCII Character Set Table
		Search google for "ASCII table" http://www.asciitable.com/
		Valid values are the same as TrueCrypt [ -~] the space character through tilde, ASCII values DEC 32 through DEC 126
			[abcd]{2}
				is the same as
				[a-d]{2}
					aa ab ac ad ba bb bc bd ca cb cc cd da db dc dd
			[A-Za-z]
				is the same as
				[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]
			[z-A0-9]
				is the same as
				[zyxwvutsrqponmlkjihgfedcba`_^\]\\\[ZYXWVUTSRQPONMLKJIHGFEDCBA0123456789]
	Special characters: [](){}-:\|
		If you want any of the special characters above to be part of your password patterns, you should escape them with a preceeding backslash \
			This is incorrect
				[abcd[]{2}
			This is correct
				[abcd\[]{2}
			This is incorrect
				(ab|cd|-)
			This is correct
				(ab|cd|\-)

Precomputed word list (This is a plaintext file with one password per line)
	"C:\word_list.txt"

Password Start Index
Password End Index
	If your word_list containes 1,000,000 passwords, you can use the "Password Start Index" and :Password End Index: to only check a smaller subset of passwords
		10000 to 50000 will check 40000 passwords starting at 10000 and ending at 50000
