AminetAminet
Search:
81913 packages online
About
Recent
Browse
Search
Upload
Setup
Services

util/pack/cranker.lha

Mirror:Random
Showing:m68k-amigaosgeneric
No screenshot available
Short:Amiga executable and data cruncher
Author:bifat/tek
Uploader:bifat neoscientists org
Type:util/pack
Version:0.53
Replaces:cranker-0.53.lha
Architecture:m68k-amigaos
Date:2017-05-10
Download:http://aminet.net/util/pack/cranker.lha - View contents
Readme:http://aminet.net/util/pack/cranker.readme
Downloads:703
Cranker by The Electronic Knights
---------------------------------------------------------------------


Cranker is an Amiga executable (and data) cruncher.

Executables decrunch while loading and decrunching requires no
additional memory. Cranker is by far the fastest way to run large
executables from disk on old, unexpanded Amigas.

You can choose from three different decrunchers: plain/standard,
with text progress display, and with graphical progress display.

All source codes are included, including cruncher, executable and
data decrunchers. You can specify a modified decruncher in the
commandline and produce custom executables, for example showing
a logo of your group, or run an OS-legal effect while loading.


Rationale:

Large OCS demos (onefilers) often reserve most available memory in
their executable sections. This is best practice and recommended.

Crunching them with most crunchers like Imploder or Powerpacker is
not an option, because all crunched data plus all sections must fit
into memory at the same time, so the demo will fail to run in the 
minimal configuration (typically 512k+512k).

Titanics cruncher was 30 years ahead of its time in that it includes
a decruncher that loads from an overlay hunk, which requires little
or no additional memory. Unfortunately the Titanics decruncher is
very slow (it probably does not really load and decrunch at the same
time, but alternates between loading and decrunching), and its crunch
ratio is bad. Another issue found with Titanics is that if a program 
disables multitasking, the disk motor can keep spinning for the whole
time it is running.

Cranker addresses all this, and more. It certainly does load and
decrunch at the same time, it uses no additional memory, it has a
solid crunch ratio, and it is blazingly fast. Since version 0.40
Cranker also addresses the disk motor issue.

As of version 0.51, only an Amiga cruncher is included. See
src/INSTALL on how to build Cranker yourself and using it on
different platforms.


Some benchmarks:

Rebels Retrodentro, crunched size:
----------------------------------
Original : 499768 Bytes
Titanics : 236388 Bytes
Cranker  : 217548 Bytes
Imploder : 213332 Bytes - does not work with 1mb
Shrinkler: 179472 Bytes

Starting time, Kick 1.3:
----------------------------------
Cranker  : 20s
Imploder : 28s - does not work with 1mb
Titanics : 35s
Original : 41s
Shrinkler: 87s

Starting time, Kick 2.04:
----------------------------------
Cranker  : 14s
Imploder : 24s - does not work with 1mb
Original : 33s
Titanics : 46s
Shrinkler: 86s


Usage:

$ cranker -h
argument template:
    -f FROM      input file
    -o TO        output file
   -mo MAXOVH/N  max. overhead (else store hunk, or error)
    -q QUIET/S   quiet operation
Data options:
   -cd CDATA/S   crunch raw data
   -dd DDATA/S   decrunch raw data
   -eo ENCOVH/S  encode overhead into first header byte
Executable options:
    -t TEXT/K    text to display while loading
   -nf NOFLASH/S do not poke to background color
    -s STORE/S   do not crunch, store all hunks
    -m MERGE/S   merge hunks (dangerous)
    -d DECRANKER name of an internal decranker to use
   -ld LISTDEC/S list available internal decrankers
   -ed EXTDEC/K  use external decranker from this file

A 'decranker' is a combined executable header and decruncher.
You can specify an internal decranker using the -d option:

default         can show text and poke to background color
progress        shows progress as text
cinema          shows progressbar on a black screen

All decrankers are fully conformant to the operating system (aside
from poking to the background color register). The executables
should run on all Amigas and from all filesystems and devices.

About the cinema decranker: This decranker obscures the shell or
Workbench with a black screen until the executable exits. It makes
little sense if you do not run a fullscreen application, game or
demo with it. Don't worry: This is a regular Intuition screen, and it
will be opened after all memory for the program has been allocated,
so if the system runs out of memory, the screen will not open, but
the executable is started anyway.

Expect bugs and problems. In any case, keep your original binaries.
Feedback is welcome.


Technical info:

Cranker does not allocate memory. All allocations are made by the OS
loader. Hence it is decided right at the beginning if the executable
fits into memory and will be loaded at all. It uses a combination of
techniques, hunk overlay, asynchronous and buffered I/O, and in-place
decrunching with one of the fastest decrunchers in existence. Relocs
are packed into 1, 2, and 4 bytes entities.

Due to its complexity, the decrunch header is quite large, but the
decrunch header and a few extra bytes to allow in-place decrunching
are the only memory that adds to the required memory of the
executable. It will be freed by the OS at exit, like all other
sections.

So why is it tricky? Cranker operates on three data pointers at the
same time, one for loading, one for reading crunched data, one for
writing out the decrunched data. All three pointers wander forwards
in a hunk's memory area and must not overrun each other:
 _______________________________________________________  hunk
|                 |                  :                : |
|  decrunched     |   crunched data  :  yet unloaded  : |
|_________________|__________________:________________:_|
 ^---->           ^---->             ^---->            ^- overhead
 destptr          srcptr             loadptr

The crunched data is aligned towards the end of the hunk. 
The overhead (usually only a few bytes) gets calculated for the
particular data and ensures that the destination pointer does not
overrun the source pointer. Loading takes place in DOS packets, which
are requested from the executable's file handler task. When a packet
arrives, the load pointer is updated and the next packet requested.
The decruncher starts immediately with the first packet, but it
suspends waiting for the next packet if and when the source pointer
catches up with the load pointer. Another complexity is imposed by
the reloc tables, because after loading a hunk, for loading them
efficiently, the loader has to switch from asynchronous to buffered
I/O (with a small load buffer on the stack), and back to asynchronous
for the next hunk.

Cranker's decruncher is so fast that the construct is probably I/O
bound under all practical circumstances, even if asynchronoucy kicks
in just a little.


Download:

http://neoscientists.org/~bifat/binarydistillery/cranker.lha
Precompiled Linux, Windows, Mac OS X binaries:
http://neoscientists.org/~bifat/binarydistillery/cranker/


Authors:

Coding by Bifat/TEK <bifat at neoscientists.org>
LZO by Markus Franz Xaver Johannes Oberhumer


Changes:

0.53
Now supports dreloc32 hunks, can now crunch vbcc executables.
Reduced memory consumption for crunching.
Major source code cleanup.
Improved error messages, safe decrunching of defective data.
Added cinema decruncher. Added multiple inbuilt decrunchers.

0.51
Partially uninitialized hunks are now supported.
Debug and symbol hunks are now handled and stripped away.
The merge option appears to be more stable now.
Added -eo option to encode the overhead into the crunched data
header. Suggested by Origo.
The build procedure and sources have been cleaned up. The Linux,
Windows, and Mac OS X binaries have been dropped from this package.
See src/INSTALL on building them yourself.

0.42
The Amiga version now works on Kickstart 1.x and on 68000 CPUs, 
a FPU is no longer required. Requested by Sachy. Crunching fastmem
hunks is now supported. Added an external example decrunch header.

0.40
When an executable was started that disabled multitasking, the disk
motor could keep spinning while the executable was running. Corrected
by synchronizing on an ACTION_FLUSH packet. Found the same issue with
Titanics later, so this is another reason for using Cranker now.

0.31
Mac OS X version and Makefile included, supplied by Bonefish. Thanks!

0.3
Added options CDATA, DDATA, MAXOVH, MERGE, renamed EXTDECR to
EXTHEAD. Removed former hardcoded limit of 64 bytes maximum overhead.

0.21
Fixed a bug in the decrunch header when a load error occurred

0.2
Added options for displaying text and to avoid poking to the bgcolor
register. Incompressible hunks are being stored now. The source of
the decrunch header is now included and a custom header can be
specified in the command line. This way you can use Cranker as a
loader system, show a progress bar, or disable crunching in the
commandline and just exploit async I/O to show an effect while
loading.

0.1
initial release


Contents of util/pack/cranker.lha
PERMISSION  UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP     NAME
---------- ----------- ------- ------- ------ ---------- ------------ ----------
drwxr-xr-x  2002/2001        0       0 ****** -lhd- 0000 May  9 09:27 cranker-0.53/
-rw-r--r--  2002/2001     3816    8873  43.0% -lh5- f40d May  9 09:27 cranker-0.53/README
-rwxr-xr-x  2002/2001    71399  128340  55.6% -lh5- dbc0 May  9 09:27 cranker-0.53/cranker
-rw-r--r--  2002/2001      959    3359  28.6% -lh5- 5be5 May  9 09:27 cranker-0.53/decruncher.asm
drwxr-xr-x  2002/2001        0       0 ****** -lhd- 0000 May  9 09:27 cranker-0.53/src/
-rw-r--r--  2002/2001      986    2419  40.8% -lh5- 1a8c May  9 09:27 cranker-0.53/src/INSTALL
-rw-r--r--  2002/2001       81     178  45.5% -lh5- 32b2 May  9 09:27 cranker-0.53/src/MODLIST
-rw-r--r--  2002/2001      757    1802  42.0% -lh5- 7cd3 May  9 09:27 cranker-0.53/src/Makefile
drwxr-xr-x  2002/2001        0       0 ****** -lhd- 0000 May  9 09:27 cranker-0.53/src/bin/
-rwxr-xr-x  2002/2001      309     484  63.8% -lh5- e843 May  9 09:27 cranker-0.53/src/bin/bin2lua.lua
-rwxr-xr-x  2002/2001     2111    6347  33.3% -lh5- 41ad May  9 09:27 cranker-0.53/src/bin/compiler.lua
-rw-r--r--  2002/2001     2382    5383  44.3% -lh5- 08d3 May  9 09:27 cranker-0.53/src/bit.c
-rw-r--r--  2002/2001    18400   81716  22.5% -lh5- c062 May  9 09:27 cranker-0.53/src/classlib.c
-rw-r--r--  2002/2001     5974   22086  27.0% -lh5- c737 May  9 09:27 cranker-0.53/src/cranker.lua
-rw-r--r--  2002/2001     4752   15886  29.9% -lh5- 33d5 May  9 09:27 cranker-0.53/src/decranker-cinema.asm
-rw-r--r--  2002/2001     3982   13013  30.6% -lh5- 870c May  9 09:27 cranker-0.53/src/decranker-progress.asm
-rw-r--r--  2002/2001     3897   12230  31.9% -lh5- bb3e May  9 09:27 cranker-0.53/src/decranker.asm
-rw-r--r--  2002/2001      582    1616  36.0% -lh5- 925b May  9 09:27 cranker-0.53/src/llibs.c
drwxr-xr-x  2002/2001        0       0 ****** -lhd- 0000 May  9 09:27 cranker-0.53/src/lua/
-rw-r--r--  2002/2001     5342   22767  23.5% -lh5- e4e3 May  9 09:27 cranker-0.53/src/lua/lapi.c
-rw-r--r--  2002/2001      209     262  79.8% -lh5- d78b May  9 09:27 cranker-0.53/src/lua/lapi.h
-rw-r--r--  2002/2001     4953   17417  28.4% -lh5- 6374 May  9 09:27 cranker-0.53/src/lua/lauxlib.c
-rw-r--r--  2002/2001     1584    5777  27.4% -lh5- 4e41 May  9 09:27 cranker-0.53/src/lua/lauxlib.h
-rw-r--r--  2002/2001     4842   17045  28.4% -lh5- 7072 May  9 09:27 cranker-0.53/src/lua/lbaselib.c
-rw-r--r--  2002/2001     5704   21539  26.5% -lh5- 6976 May  9 09:27 cranker-0.53/src/lua/lcode.c
-rw-r--r--  2002/2001      910    2750  33.1% -lh5- ff1f May  9 09:27 cranker-0.53/src/lua/lcode.h
-rw-r--r--  2002/2001     2833   10092  28.1% -lh5- 9a3e May  9 09:27 cranker-0.53/src/lua/ldblib.c
-rw-r--r--  2002/2001     5141   16920  30.4% -lh5- ad89 May  9 09:27 cranker-0.53/src/lua/ldebug.c
-rw-r--r--  2002/2001      446    1061  42.0% -lh5- 30dd May  9 09:27 cranker-0.53/src/lua/ldebug.h
-rw-r--r--  2002/2001     4776   15012  31.8% -lh5- 03a6 May  9 09:27 cranker-0.53/src/lua/ldo.c
-rw-r--r--  2002/2001      741    1897  39.1% -lh5- 0508 May  9 09:27 cranker-0.53/src/lua/ldo.h
-rw-r--r--  2002/2001     1406    3882  36.2% -lh5- a768 May  9 09:27 cranker-0.53/src/lua/ldump.c
-rw-r--r--  2002/2001     1571    4718  33.3% -lh5- 82a1 May  9 09:27 cranker-0.53/src/lua/lfunc.c
-rw-r--r--  2002/2001      431    1125  38.3% -lh5- c699 May  9 09:27 cranker-0.53/src/lua/lfunc.h
-rw-r--r--  2002/2001     6018   20177  29.8% -lh5- 8041 May  9 09:27 cranker-0.53/src/lua/lgc.c
-rw-r--r--  2002/2001     1133    3159  35.9% -lh5- 2263 May  9 09:27 cranker-0.53/src/lua/lgc.h
-rw-r--r--  2002/2001      495     999  49.5% -lh5- d003 May  9 09:27 cranker-0.53/src/lua/linit.c
-rw-r--r--  2002/2001     3951   13590  29.1% -lh5- bf07 May  9 09:27 cranker-0.53/src/lua/liolib.c
-rw-r--r--  2002/2001     3632   12581  28.9% -lh5- 95a8 May  9 09:27 cranker-0.53/src/lua/llex.c
-rw-r--r--  2002/2001      980    2177  45.0% -lh5- d9d6 May  9 09:27 cranker-0.53/src/lua/llex.h
-rw-r--r--  2002/2001     1090    2349  46.4% -lh5- 2202 May  9 09:27 cranker-0.53/src/lua/llimits.h
-rw-r--r--  2002/2001     1412    5832  24.2% -lh5- 72dd May  9 09:27 cranker-0.53/src/lua/lmathlib.c
-rw-r--r--  2002/2001      987    2202  44.8% -lh5- 5ca8 May  9 09:27 cranker-0.53/src/lua/lmem.c
-rw-r--r--  2002/2001      598    1494  40.0% -lh5- 2bea May  9 09:27 cranker-0.53/src/lua/lmem.h
-rw-r--r--  2002/2001     5279   19216  27.5% -lh5- 2a1d May  9 09:27 cranker-0.53/src/lua/loadlib.c
-rw-r--r--  2002/2001     1946    5584  34.8% -lh5- fd73 May  9 09:27 cranker-0.53/src/lua/lobject.c
-rw-r--r--  2002/2001     2642    8507  31.1% -lh5- 0cb9 May  9 09:27 cranker-0.53/src/lua/lobject.h
-rw-r--r--  2002/2001      713    2884  24.7% -lh5- 957c May  9 09:27 cranker-0.53/src/lua/lopcodes.c
-rw-r--r--  2002/2001     2768    8086  34.2% -lh5- faa5 May  9 09:27 cranker-0.53/src/lua/lopcodes.h
-rw-r--r--  2002/2001     2075    6065  34.2% -lh5- 5f9d May  9 09:27 cranker-0.53/src/lua/loslib.c
-rw-r--r--  2002/2001    10416   36706  28.4% -lh5- a016 May  9 09:27 cranker-0.53/src/lua/lparser.c
-rw-r--r--  2002/2001      972    2261  43.0% -lh5- b42d May  9 09:27 cranker-0.53/src/lua/lparser.h
-rw-r--r--  2002/2001     2017    5694  35.4% -lh5- cc38 May  9 09:27 cranker-0.53/src/lua/lstate.c
-rw-r--r--  2002/2001     1939    5011  38.7% -lh5- b593 May  9 09:27 cranker-0.53/src/lua/lstate.h
-rw-r--r--  2002/2001     1316    3140  41.9% -lh5- c2dc May  9 09:27 cranker-0.53/src/lua/lstring.c
-rw-r--r--  2002/2001      411     814  50.5% -lh5- 9858 May  9 09:27 cranker-0.53/src/lua/lstring.h
-rw-r--r--  2002/2001     6629   23634  28.0% -lh5- 5629 May  9 09:27 cranker-0.53/src/lua/lstrlib.c
-rw-r--r--  2002/2001     5280   16452  32.1% -lh5- b745 May  9 09:27 cranker-0.53/src/lua/ltable.c
-rw-r--r--  2002/2001      454    1186  38.3% -lh5- f638 May  9 09:27 cranker-0.53/src/lua/ltable.h
-rw-r--r--  2002/2001     2369    7343  32.3% -lh5- 8128 May  9 09:27 cranker-0.53/src/lua/ltablib.c
-rw-r--r--  2002/2001      822    1680  48.9% -lh5- 4557 May  9 09:27 cranker-0.53/src/lua/ltm.c
-rw-r--r--  2002/2001      552    1018  54.2% -lh5- bd80 May  9 09:27 cranker-0.53/src/lua/ltm.h
-rw-r--r--  2002/2001     3353   10163  33.0% -lh5- 2839 May  9 09:27 cranker-0.53/src/lua/lua.c
-rw-r--r--  2002/2001     3475   11699  29.7% -lh5- 1cf7 May  9 09:27 cranker-0.53/src/lua/lua.h
-rw-r--r--  2002/2001     1835    4661  39.4% -lh5- 8250 May  9 09:27 cranker-0.53/src/lua/luac.c
-rw-r--r--  2002/2001     7715   22781  33.9% -lh5- cc43 May  9 09:27 cranker-0.53/src/lua/luaconf.h
-rw-r--r--  2002/2001      401    1026  39.1% -lh5- 68e3 May  9 09:27 cranker-0.53/src/lua/lualib.h
-rw-r--r--  2002/2001     1894    5322  35.6% -lh5- 0556 May  9 09:27 cranker-0.53/src/lua/lundump.c
-rw-r--r--  2002/2001      445     890  50.0% -lh5- 6c9a May  9 09:27 cranker-0.53/src/lua/lundump.h
-rw-r--r--  2002/2001     6394   23384  27.3% -lh5- d7f1 May  9 09:27 cranker-0.53/src/lua/lvm.c
-rw-r--r--  2002/2001      446    1159  38.5% -lh5- 97c4 May  9 09:27 cranker-0.53/src/lua/lvm.h
-rw-r--r--  2002/2001      720    1678  42.9% -lh5- 3ef2 May  9 09:27 cranker-0.53/src/lua/lzio.c
-rw-r--r--  2002/2001      664    1556  42.7% -lh5- 5fa9 May  9 09:27 cranker-0.53/src/lua/lzio.h
-rw-r--r--  2002/2001     2023    5255  38.5% -lh5- 3712 May  9 09:27 cranker-0.53/src/luamain.c
drwxr-xr-x  2002/2001        0       0 ****** -lhd- 0000 May  9 09:27 cranker-0.53/src/lzo/
-rw-r--r--  2002/2001     1086    2675  40.6% -lh5- 6f58 May  9 09:27 cranker-0.53/src/lzo/config1x.h
-rw-r--r--  2002/2001     1412    4482  31.5% -lh5- efd2 May  9 09:27 cranker-0.53/src/lzo/lzo1_d.ch
-rw-r--r--  2002/2001     1370    5869  23.3% -lh5- 84d8 May  9 09:27 cranker-0.53/src/lzo/lzo1x.h
-rw-r--r--  2002/2001     5388   24242  22.2% -lh5- aae9 May  9 09:27 cranker-0.53/src/lzo/lzo1x_9x.c
-rw-r--r--  2002/2001     2751   12748  21.6% -lh5- 4bf3 May  9 09:27 cranker-0.53/src/lzo/lzo1x_d.ch
-rw-r--r--  2002/2001      846    2392  35.4% -lh5- 7ae3 May  9 09:27 cranker-0.53/src/lzo/lzo1x_d2.c
-rw-r--r--  2002/2001     3096   10314  30.0% -lh5- 2ea2 May  9 09:27 cranker-0.53/src/lzo/lzo_conf.h
-rw-r--r--  2002/2001      884    1675  52.8% -lh5- 5519 May  9 09:27 cranker-0.53/src/lzo/lzo_dll.ch
-rw-r--r--  2002/2001     3560   19666  18.1% -lh5- 3ffd May  9 09:27 cranker-0.53/src/lzo/lzo_func.h
-rw-r--r--  2002/2001     2184    6800  32.1% -lh5- f5b0 May  9 09:27 cranker-0.53/src/lzo/lzo_init.c
-rw-r--r--  2002/2001     1758    5132  34.3% -lh5- 8ecc May  9 09:27 cranker-0.53/src/lzo/lzo_mchw.ch
-rw-r--r--  2002/2001     1435    3578  40.1% -lh5- 9ad1 May  9 09:27 cranker-0.53/src/lzo/lzo_ptr.h
-rw-r--r--  2002/2001    21655  118060  18.3% -lh5- 10f1 May  9 09:27 cranker-0.53/src/lzo/lzo_supp.h
-rw-r--r--  2002/2001     4473   17035  26.3% -lh5- bec7 May  9 09:27 cranker-0.53/src/lzo/lzo_swd.ch
-rw-r--r--  2002/2001     4263   15597  27.3% -lh5- 1bfe May  9 09:27 cranker-0.53/src/lzo/lzoconf.h
-rw-r--r--  2002/2001    17336  116578  14.9% -lh5- ac5e May  9 09:27 cranker-0.53/src/lzo/lzodefs.h
-rwxr-xr-x  2002/2001      658    1361  48.3% -lh5- ace4 May  9 09:27 cranker-0.53/src/main.lua
-rw-r--r--  2002/2001      373     594  62.8% -lh5- 4889 May  9 09:27 cranker-0.53/src/smakefile
drwxr-xr-x  2002/2001        0       0 ****** -lhd- 0000 May  9 09:27 cranker-0.53/src/tek/
-rw-r--r--  2002/2001     1587    5830  27.2% -lh5- ee32 May  9 09:27 cranker-0.53/src/tek/class.lua
drwxr-xr-x  2002/2001        0       0 ****** -lhd- 0000 May  9 09:27 cranker-0.53/src/tek/lib/
-rw-r--r--  2002/2001     3720   13623  27.3% -lh5- 9e5f May  9 09:27 cranker-0.53/src/tek/lib/args.lua
-rw-r--r--  2002/2001     1683    4938  34.1% -lh5- 1c34 May  9 09:27 cranker-0.53/src/tek/lib/compress.c
-rw-r--r--  2002/2001      436    1105  39.5% -lh5- 3dca May  9 09:27 cranker-0.53/src/tek/lib/tek_lua.h
---------- ----------- ------- ------- ------ ---------- ------------ ----------
 Total        99 files  341491 1149705  29.7%            May 10 22:20

Aminet © 1992-2017 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>