3 Command Line
Maiddog edited this page 2014-07-28 18:31:08 -07:00

There are many different command line arguments and there may be more in the future. This is just a very basic overview of commands and where they should go.

To begin, the corrupter always requires the file that will be corrupted come first on the command line. The file is then followed by either settings or flags that tell the program what to do with the file.

Basic Commands

These commands relate to how the corrupter will move through the file or files.

  • --step (number)
    • Required for any corruption. Determines how far to move before corrupting another byte.
  • --start (number)
    • Tells the corrupter where to start corrupting from. If protections forbid a section like a header, the actual start will be the header size + the start value.
  • --stop (number)
    • Tells the corrupter where to stop corrupting.
  • --out (filename)
    • Tells the corrupter where to save the resulting corruption to.
  • --files (list of files)
    • For systems with files this is used to give a list of files to corrupt. Each file must be a full path (./path/to/file.txt). Soon to be deprecated.
  • --filelist (file)
    • Points to a file which contains a space delimited file list for when there are too many files to pass via the command line.

Corruption Settings

These settings will determine what is to be done with the data inside the file. If more than one setting is found on the command line then whichever happens to be checked first will be the one executed.

NOTE: For NES corruptions you must preface the command with --prg or --chr depending on which section of the ROM you are targetting. This means --shift 32 would become --prg-shift 32 and/or --chr-shift 32.

  • --shift (number)
    • Shifts a byte (number) bytes away into the current position
  • --swap (number)
    • Swaps the current byte and a byte (number) bytes away
  • --add (number)
    • Adds (number) to the current byte.
  • --set (number)
    • Sets the current byte to (number)
  • --random
    • Generates a random number for the current byte
  • --rotate-left (number)
    • Bitwise rotates the number left (number) places
  • --rotate-right (number)
    • Bitwise rotates the number right (number) places
  • --logical-and (number)
    • Sets the current byte to the result of (current_byte & (number))
  • --logical-or (number)
    • Sets the current byte to the result of (current_byte | (number))
  • --logical-xor (number)
    • Sets the current byte to the result of (current_byte ^ (number))
  • --logical-complement
    • Sets the current byte to the result of (~current_byte)

Extra Settings

The following are other settings and flags that the corrupter recognizes.

  • --nintendo
    • Passes the file through the corrupter with Nintendo file protection
  • --playstation
    • Passes the file to the PlayStation corrupter without checking the file extension
  • --batch (file)
    • Runs each line of the given file as if they were arguments passed to the program
  • --single-threaded
    • Runs the --batch option without threads
  • --std-threaded
    • Runs the --batch option with std::thread instead of std::future