» WIT: Wiimms ISO Tools » wit: Wiimms ISO Tool » wit verify

# wit verify

Verify ISO images (calculate and compare SHA1 checksums) to find bad dumps.

## 1. Syntax

    wit VERIFY [source]...

## 2. Options

Options
Option | Param | Description
--- | --- | ---
`-t` | `--test` |  | Run in test mode, modify nothing. >>> USE THIS OPTION IF UNSURE! <<<
`-T` | `--titles` | file | Read file for disc titles. -T/ disables automatic search for title files.
| `--utf-8` |  | Enables UTF-8 support for filenames (default).
| `--no-utf-8` |  | Disables UTF-8 support for filenames.
| `--lang` | lang | Define the language for titles.
`-a` | `--auto` |  | Search WBFS partitions using '/proc/partitions' or searching hard disks in '/dev/' and use all readable as source. This works like »wwt --auto --all«.
`-s` | `--source` | path | Use the entered file or directory as source. If parameter PATH contains at least one wildcard (e.g. '*.wbfs'), then PATH is used as search pattern and all found files are added. In order to use this variant, the calling shell must not interpret the wildcards. Therefore, the parameter must usually be enclosed in single or double quotes. Directories are expanded to all containing files but hidden files (file names begins with a point) are ignored. If a command needs only images then non image files of the directory are ignored without notification. The option --no-expand suppress the directory expansion.
| `--no-expand` |  | Do not expand directories to the containing files or images. This option does not change the behavior of --recurse.
`-r` | `--recurse` | path | If path is not a directory, then it is used as a simple source file like --source. If parameter PATH contains at least one wildcard (e.g. '*.wbfs'), then PATH is used as search pattern and all found files are added. In order to use this variant, the calling shell must not interpret the wildcards. Therefore, the parameter must usually be enclosed in single or double quotes. Directories are scanned for source files recursively. The option --rdepth limits the search depth. Hidden files and hidden sub directories (file names begins with a point) and files with non supported file types (non ISO files for most commands) are ignored without notification.
| `--rdepth` | depth | Set the maximum recurse depth for option --recurse. The default search depth is 10.
`-x` | `--exclude` | id | A comma separated list with ID4 and ID6 values is expected. '.' is a wildcard for exact 1 character and '+' is a wildcard for any number characters. If the parameter begins with a '@' the given file is read and each line is scanned for one ID. Images with the given ID are excluded from operation. Each use of this option expands the exclude list. See --include-first for precedence issues.
`-X` | `--exclude-path` | file_or_dir | Scan the ID of the source and add it to the exclude list. If the source is a directory then scan all images of the directory. Images with the given ID are excluded from operation. Each use of this option expands the exclude list. See --include-first for precedence issues.
`-n` | `--include` | id | A comma separated list with ID values is expected. '.' is a wildcard for exact 1 character and '+' is a wildcard for any number characters. If the parameter begins with a '@' the given file is read and each line is scanned for one ID. Only images with the given ID are included into the operation. Each use of this option expands the include list. See --include-first for precedence issues.
`-N` | `--include-path` | file_or_dir | Scan the ID of the source and add it to the include list. If the source is a directory then scan all images of the directory. Only images with the given ID are included into the operation. Each use of this option expands the include list. See --include-first for precedence issues.
| `--include-first` |  | The options --include, --include-path, --exclude and --exclude-path decide which discs are included into the operation. If neither include nor exclude options are used, than all disc are included into the operation. If only include options are used, than only the specified discs are operated. If only exclude options are used, than all all discs but not the excluded are operated. If include and exclude options are used together and --include-first is not set, than all discs are operated that are specified by any include option and not by any exclude option. If --include-first is set, than all discs are ignored that are specified by any exclude option and not by any include option.
`-1` | `--one-job` |  | Execute only the first job and exit. This is a shortcut for »--job-limit 1«.
| `--job-limit` | num | Execute only the first 'num' jobs and exit. If done without errors the exit status is OK (zero).
`-i` | `--ignore` |  | Ignore non existing files/discs without warning. If set twice then all non Wii and GameCube ISO images are ignored too.
| `--ignore-fst` |  | Disable composing and ignore FST directories as input. This legacy option is a shortcut for --allow-fst=off.
| `--ignore-setup` |  | While composing ignore the file 'setup.txt', which defines some partition parameters.
| `--links` |  | Detect soft and hard linked source files while composing or extracting discs and try to create hard links instead of independent copies on the destination file system.
| `--allow-fst` | [=mode] | Enable the usage of extracted images.MODE is either OFF, AUTO (default) or ON. Without value, ON is used. If mode is AUTO, extracted images are usually enabled.
| `--allow-nkit` | [=mode] | Enable the detection of NKIT images.MODE is either OFF, AUTO (default) or ON. Without value, ON is used. If mode is AUTO, the NKIT detection is enabled only for a few analytic commands. Anyway, NKIT images are not supported yet, but detected to print warnings.
| `--psel` | list | This option set the scrubbing mode and defines, which disc partitions are handled. It expects a comma separated list of keywords, numbers and names; all together called parameter. All parameters are case insensitive and non ambiguous abbreviations of keywords are allowed. Each parameter becomes a rule and each rule is appended to a rule list. Rules prefixed by a minus sign are DENY rules. Rules prefixed by a plus sign or without a prefix are ALLOW rules. Each partition is compared with each rule until a rule matches the partition. If a match it found, the partition is enabled for a ALLOW rule or disabled for a DENY rule. The allowed keywords are: DATA, UPDATE, CHANNEL, PTAB0 .. PTAB3, ID, ALL, WHOLE and RAW. The following input formats are accepted too: ptype, #index, #<index, #<=index, #>index, #>=index and #tab_index.part_index.
| `--raw` |  | Abbreviation of »--psel RAW«.
| `--ignore-files` | ruleset | This option defines filter rules to ignore real files of the FST of the DATA partition. Fake signing is not necessary, but the partition becomes invalid, because the content of some files is not copied. If such file is accessed the Wii will halt immediately, because the verification of the checksum calculation fails. The processing order of file options is: »--rm-files --zero-files --ignore-files«.
`-q` | `--quiet` |  | Be quiet and report only errors. If set twice then wit will print nothing and only the exit status is set.
`-v` | `--verbose` |  | Be verbose and print more progress information. Multiple usage is possible: Progress counter is enabled if set at least two times. Extended logging is enabled if set at least four times. The impact of the other verbose levels are command dependent.
`-P` | `--progress` |  | Print progress counter. If --verbose is set at least twice, printing is enabled too. If progress is enabled, the default of --dsync is changed.
| `--scan-progress` |  | Print a message for each found image while scanning the file system.
| `--limit` | num | Maximal printed errors of each partition. A zero means unlimited. The default is 10.
`-L` | `--logging` |  | This debug option enables the logging of internal memory maps. If set twice second level memory maps are printed too.
`-l` | `--long` |  | On error print an additional line to localize the exact position where the error is found. If set twice a hex dump of the hash values is printed too.
| `--technical` |  | Force a technical output instead of user friendly text. --tech is a short cut for --technical.

## 3. Description

### 3.1 Introduction

Every 1024 bytes of user data in every Wii partition has its own SHA1 checksum (called 'H0'). There are also H1 (hash of 31*H0), H2 (hash of 8*H1), H3 (hash of 8*H2) and for the whole partition one H4 (hash of all H3) checksums. To validate a partition it is enought to calculate the checksums and compare them with the stored sums. For a scrubbed image it is enough to compare the checksums of the used sectors. »wit VERIFY« and »wwt VERIFY« do exactly this.

To validate a disc the tool must do 64 AES-128-CBC decryptions and 1029 SHA1 calculations for each MiB of data. This slow down the operation rapidly and verifying is much slower then copying.

### 3.2 Verbosity of output

The options --quiet and --verbose control the verbosity level of the command:

Pption | Level | Action
--- | --- | ---
-qq | -2 | Be abossulte quiet. The status is only reported as exit status.
-q | -1 | Be quiet and report only the first errors of each partition.
| 0 | Print one status line for each partition (success or error).
-v | 1 | Print up to --limit error messages for each partition.
-vv | 2 | Print progress information (not implemented yet).

For levels <=0 the check of a partition is aborted on the first found error.

### 3.3 Output format

The messages are printed in 5 columns (with examples). The first 4 columns never contains spaces or other blanks ('awk' friendly).

      STATUS  COUNTER PARTITION ID6    NAME
      >scan   1.0/2   DATA      RUUP01 pool/corrupt/animal.wdf
      !H0-ERR 1.0/2   DATA      RUUP01 pool/corrupt/animal.wdf
      +OK     2.0/2   DATA      RUUP01 pool/wdf/animal.wdf

Description of the columns:

1. STATUS:
   This is the status column. The first character describes the message class:

         > : informative message
         + : success
         ! : error message

   All status messages in detail
   Status | Meaning
   --- | ---
   >scan | Info message: Scanning started.
   +OK | Success message.
   !NO-HASH | No hash values found (all zero).
   !INVALID | Invalid disc (can't find required files).
   !H#-ERR | Check sum error in table H0..H4.
   !H1-DIFF | For each sequence of 8 sectors the H1 table must be identical. 'H1-DIFF' means, that at least one table differ.
   !H2-DIFF | For each sequence of 64 sectors the H2 table must be identical. 'H2-DIFF' means, that at least one table differ.
   !ABORT | Check aborted because of --limit found errors.

2. COUNTER:
   A counter in the format:

         DISC_INDEX . PARTITION_INDEX / TOTAL_DISCS 'd'

   DISC_INDEX and TOTAL_DISCS are not printed if only 1 disc is verified. The 'd' is only printed for decrypted (not encrypted) discs.
3. PARTITION:
   Type of the partition. For UPDATE, DATA and CHANNEL partitions the name is printed, for all other the number.
4. ID6:
   ID6 of the disc.
5. NAME:
   Name (filename if available) of the disc.

### 3.4 See also

»wwt VERIFY« »wit DIFF«

## 4. Usual error/exit codes:

        0 == OK        : All done without errors.
        DIFFER         : At least one checksum error found.
        SYNTAX ERROR   : At least one syntax error in command line found.
        READ ERROR     : Error while reading a file.
        CANT OPEN      : Can't open file.