Skip to content
Siorki edited this page Mar 6, 2017 · 1 revision

Pattern view

Purpose

This tool is integrated in RegPack GUI when run in a browser. It highlights the patterns found by the crusher to give a visual feedback to the user.

The viewer was inspired by Keith Clark's original work.

Behavior

The rendering is done in the "Preprocessed" window as the compression is performed on the preprocessor's output.

Pattern viewer output

Individual patterns are surrounded with a colored background.

In the example below, the patterns are for( , t= , 512 , x= , =0; , 256 and +=.

1-level patterns

Long patterns may contain shorter subpatterns. In this case the deeper levels of compression are shown in a darker tone of color. In this example, t=Math.max(0,Math.min(1, is a pattern, and so are Math. and 0,. The latter two end up being compressed twice.

2-level patterns

Implementation

The tool is implemented in the class PatternViewer. It creates its display from the output of the crusher :

  • the unpacked (but preprocessed) code
  • the dictionary built by the crusher

Clone this wiki locally