Skip to content
Greg Toombs edited this page Oct 31, 2015 · 7 revisions
Usage: mim [options]

Options:
  -h, --help            show this help message and exit
  -m CHANCE, --me-harder=CHANCE
                        replacement percent
  -e CHAR, --explain=CHAR
                        show a char's homoglyphs
  -l, --list            show all homoglyphs
  -c, --check           check input for suspicious chars
  -r, --reverse         reverse operation, clean a mimicked file

Mimic is much like an old-school *nix command - it operates on pipe I/O, thus does not pay attention to files directly. To input a file, use cat; otherwise it will wait for keyboard input. Likewise, to output a file, use > or tee; otherwise it will simply print the output to the console.

Examples

These examples assume that mimic has been installed as per the instructions below. Before installation, invoke via python -m mimic.

mimic --list           # Show all of the homoglyphs
mimic --explain=o      # What crazy things can we do with this letter?
mimic --me-harder 100  # Type some lines in and mess with every single char
mimic --reverse        # Undo the mayhem. Boooring.
cat somefile | mimic   # Pipe some source through at 1%

# Turn up the knob and save the results
cat somefile | mimic --me-harder 25 > mimicked

# Find out exactly where we broke the source
cat mimicked | mimic --check | less

# Now we know the source is broken, so fix it
cat mimicked | mimic --reverse > fixedfile

# This should output nothing (i.e. the files are the same)
diff fixedfile somefile
Clone this wiki locally