mirror of
https://github.com/exoticorn/upkr.git
synced 2026-01-20 11:36:42 +01:00
implement heatmap calculation
This commit is contained in:
12
README.md
12
README.md
@@ -27,11 +27,13 @@ The 16 bit dos unpacker also uses some variations. (`upkr --x86`)
|
||||
```
|
||||
upkr [-l level(0-9)] [config options] <infile> [<outfile>]
|
||||
upkr -u [config options] <infile> [<outfile>]
|
||||
upkr --heatmap [config options] <infile> [<outfile>]
|
||||
upkr --margin [config options] <infile>
|
||||
|
||||
-l, --level N compression level 0-9
|
||||
-0, ..., -9 short form for setting compression level
|
||||
-u, --unpack unpack infile
|
||||
--heatmap calculate heatmap from compressed file
|
||||
--margin calculate margin for overlapped unpacking of a packed file
|
||||
|
||||
Config presets for specific unpackers:
|
||||
@@ -56,3 +58,13 @@ Config options to tailor output to specific optimized unpackers:
|
||||
--max-offset N
|
||||
--max-length N
|
||||
```
|
||||
|
||||
## Heatmap
|
||||
|
||||
By default, the `--heatmap` flag writes out the heatmap data as a binary file. The heatmap file is
|
||||
the same size as the unpacked data. Each byte can be interpreted like this:
|
||||
|
||||
```
|
||||
is_literal = byte & 1; // whether the byte was encoded as a literal (as opposed to a match)
|
||||
size_in_bits = 2.0 ** (((byte >> 1) - 64) / 8.0); // the size this byte takes up in the compressed data
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user