_____________________________________________________________________________ ___ _____________________________________________________________________ ___ ___/_____________________________________________________________________\___ ___/___ ___\___ ___/___\_____________________________________________________________/___\___ ___/___\___ ____________ ________________ ___ _______________ ___ ___/___\___ ___/___\___/____________\________________/___\_ ___________ _/___\___/___\___ ___/___\___/___ \________________/_____\_ _______ _/_____\___/___\___ ___/___\___/___\_________________________/___ _\_ ___ _/_ ___\___/___\___ ___/___\___/___\____________ ________ ___/___\_/ _\___/_ \_/___\___/___\___ ___/___\___/___\____________/________\___/___\___/ ___ \___/___\___/___\___ ___/___\___/___\____________/___ \___/___\_____/ \_____/___\___/___\___ ___/___\___/___\____________/___\________/___\_______________/___\___/___\___ ___/___\___/___\____________/___\________/___\_______________/___\___/___\___ ___/___\___/___\________ ___/___\________/___\_______________/___\___/___\___ ___/___\___/____________\___/___\________/___\_______________/___\___/___\___ ___/___\___/ \___/ \________/ \_______________/ \___/___\___ ___/___\_____________________________________________________________/___\___ ___/___\_____________________________________________________________/___\___ ___/_____________________________________________________________________\___ ___/ \___ _____________________________________________________________________________ _____________________________________________________________________________ T H O M A S S C H W A R Z ^^^^^^^^^^^^^^^^^^^^^^^^^ is proud to present: /---------------------------\ < C R U N C H - M A N I A > \---------------------------/ V1.6 Release-Date: 02.01.92 ---------------------------- ----«««<< Contents >>»»»---- ---------------------------- I. Introduction I.1 Copyright I.2 System Requirements II. General Information II.1 Outward Appearance II.2 Numbers Input/Output II.3 Command-Line Options II.4 Menu Options II.5 Other Information III. Packing in the Address-Mode III.1 Loading III.2 Crunching III.3 Saving III.3.1 Data-Files III.3.2 Normal Decruncher III.3.3 Professional Decruncher IV. Packing in the Link-Mode IV.1 Loading IV.2 Crunching IV.3 Saving V. Packing in the Reloc-Mode V.1 Loading V.2 Packing V.3 Saving V.3.1 Simple Decruncher V.3.2 Normal Decruncher VI. Decrunching VII. Special Features VIII. supplied Utilities VIII.1 Run-time Data-Decruncher IX. Trivialities X. History ************************************************* I. Introduction ===================== I.1 Copyright ------------------ (c) 1989,1990,1991,1992 by Thomas Schwarz This Proggy is (still) Public-Domain. It may (should) be spread, as long as the following is observed: - No fee may be charged for this Program. - This Doc-File and the Data-Decrucher Source has always to be spread with the Executable. - In professional Productions (e.g. Games) the Use of this Cruncher has to be mentioned noticeable. Send any Donations, Bugreports or good Ideas to: Thomas Schwarz Dammstr. 12 W-7014 Kornwestheim Germany / Europe Distributors are welcome!!! Send about 30 DM or 25 US plus one Disk to the above Address to receive the latest Version. I.2 System Requirements ----------------------------- For packing small Files 512KB may suffice but the full Power of this Program can only be obtained with at least 1MB Memory resulting from a 300KB Speed-Table in the Lightspeed-Mode. Two Drives are comfortable but not necessary. No Problems have occured under Kickstart 1.2 and 2.0, so it should also work under 1.3 and 2.x. II. General Information ============================ II.1 Outward Appearance --------------------------- The Program opens a Screen or a Window and uses the Intuition-Library for full multitasking Compatiblity. It is self-detaching so you do not need to call it with "run". You can either run it from CLI or from the Workbench whereby you have to draw an Icon first. The Program is controlled by Gadgets and Menus. On the right Side there is an Area for Tables and Error-Messages and at the bottom there is a Statusline which indicates what the Packer is just doing. II.2 Numbers Input/Output ----------------------------- Input: You can enter hex and decimal Numbers where hex Nums are only recognized with a leading "$". To get negative Nums put a "-" at the Beginning of the Line. An empty Gadget has the same Effect as one with a Zero. Some extra Functions can be reached by entering chars instead of Nums. Output: The Output follows the same rules as the Input: a "$" indicates a hex Num, the Rest is decimal. But there is an exception: While loading Executables in the Address- or Link-Mode the Dehunker displays hex Nums without a "$". This has not been forgotten but left out as a result of lack of Space. II.3 Command-Line Options ----------------------------- -w Do not open a Screen to get a little more Mem. -ennnnn nnnnn specifies the Size of the Mem which is allocated in Addition to the FileLen. This is necessary when the Packer does not find something to pack at he beginning and the Result gets longer than the Original. To prevent Errors some Space is left between the Result and the Original. II.4 Menu Options --------------------- Free Mem update In the Titlebar the instantaneous free Mem is shown and updated every 1/10 Second. This can be disabled to speed up packing or other Proggies running at the same Time. Req.library The Requester-Library is used for the File-Requester, the Overwrite-Verify and the Extra Mem Input. With this Option you can open and close the Library. By closing you may get some more Mem but the above Features are no longer available. Sometimes the Program failes to open the Library the first Time. You can try to open the Library yourself or reopen it after having closed it. Segment-Ptrs This has only an Effect in the Address- or Link-Mode. Most Dehunkers fix the Executables to a certain Address and correct the Reloc-Offsets but they forget the enchainment of the Hunks in the Mem. This is the first Dehunker which pays attention to this Feature of DOS. Extra Mem Here you can enter the Amount of extra Mem with a Req-Lib Requester. The Function of this Option is expalined in II.3 (-ennnn). Priority This invokes a Submenu with the most used Priorities as well as with a Custom Option. The Crunch-Mania- Tasks will get the selected Priority. When you type in Custom one of the given Priorities, it will be selected instead of Custom. LED-Flash This is the Switch to suppress the LED-Flickering while crunching. So you can listen to Music while crunching. II.5 Other Information -------------------------- There are no known Bugs. Nevertheless the Programmer is in no way liable for any Errors and Gurus invoked by the Packer. In most Cases the User himself produces the Errors by misusing the Packer. This Document will only deal with the important Things. Understanding minor Details like Filelen is expected. These Things are left out. III. Packing in the Address-Mode ==================================== In the Address-Mode this Packer is quite like Bytekiller. You can crunch all position-dependent and relocatible Files as well as Data-Files. I recomend to use this Mode only with Proggies which do not return to the CLI because important System-Parameters and -Tables may be destroyed. III.1 Loading ---------------- Normally the entire File is loaded. In case of an Executable the "Load/Fix File to"-Gadget specifies the Treatment of the File. "Load" indicates, that it will be considered as a Data-File. "Fix" will fix the File to the Address given in the next Gadget. While loading the Hunkstructure and the Addresses of the Hunks after decrunching are displayed. Range is the Part the entire Hunk occupies and Len is the Len of the actual Data in the Hunk. III.2 Packing ---------------- Turbo-Mode You should use this Mode only in case of a Memory shortage. It needs max. 70KB Memory depending on the Crunchoffset. Lightspeed-Mode This is the faster Mode but it also requires more Memory. 256KB are always allocated plus max. 70KB depending on the Crunchoffset. Higher Crunchoffsets produce better Results but also longer Crunchtimes. Offset "0" is equal with "$4200" (for the lazy ones). When there is not enough Memory available firstly the Mode is changed and then the Offset is reduced if necessary. III.3 Saving --------------- You can choose between a Normal or Professional Decruncher and Data-Files. Normally the Normal Decruncher should suffice, only in extreme cases the Professional Decruncher is necessary. Note: The different Options can be left out by clearing the Gadget responsible for it. This Packer saves only the really necessary Parts and not an ultimate Decuncher where only some values are changed and much senseless Code is dragged along. III.3.1 Data-Files - - - - - - - - - - Only a 14-Bytes Header which is explained in the Decruncher Source and the crunched Data are saved. III.3.2 Normal Decruncher - - - - - - - - - - - - - The "Decrunch To"-Address specifies the Address where the Data is decrunched to. By entering here a "p" no special Address is taken. Instead of this some Mem is allocated (in the Hunk-Header) and there the Data will be decrunched to. "c" has almost the same Effect but here it will be in Chip-Mem (e.g. for Proggies with internal Copperlist). "Jump to" is the Address where the Decruncher will jump to after decrunching. In most cases this is the same Address as the Decrunch-Address. Is there a "p" or "c" as the Decrunch-Address, the Jump-Address is relative to the Beginning of the Data. By entering here a "r" the Decruncher will return to the calling Code after decrunching. III.3.3 Professional Decruncher - - - - - - - - - - - - - - - - This Mode has the same Options as the above one and several additional more powerful ones which all can be left out by clearing the Gadget. The Stackaddress is written into a7 (Stackpointer) as the first Action before decrunching. The Decruncher can copy itself to a safe Position which is fixed by "Decr at". Now there are two Columns starting with the two "Stop Drives"-Gadgets. The Options on the left Side will be executed before decrunching, the right ones after. There are three Ways of stopping the Drives: "Not" is obvious, the Motors of "Lame" stopped Drives are off but the Drive-LED is still glimming, the LEDs are darkened with "Pro". Further down there are five rows with two times two columns each. This is to write certain values to special Addresses outa the data Range. In the first Column there are the values which can be wordened with a following .w (e.g. $0.w) and in the second one there are the Addresses which are automatically shortened if possible (like in Ass: e.g. move.l #$0.w,$dff180). Finally the Status Register (SR) can be changed before entering the Program. IV. Packing in the Link-Mode ================================= The Advantage of this Mode is to load several Files into one Memoryblock and to save a Linker-Run. The Range is set with LoMem and HiMem where both Addresses have to be even and HiMem higher than LoMem. The allocated Mem is cleared, so no undesirable Data will be crunched. IV.1 Loading ---------------- This goes the same way as in the Address-Mode with the difference that with the "Load/Fix File to"-Address an Offset to the Start of the Range is calculated, so you have to fill in this Parameter also with Data-Files. This Address has to be inside the Range and the File must not end outa it. IV.2 Packing ---------------- see III.2 IV.3 Saving --------------- You should take the LoMem-Address as the Decrunch-Address, so that the absolute Addresses are correct. For Options see III.3 V. Packing in the Reloc-Mode ================================== Here you can pack all Executables except Overlayed Files. The Hunkstructure is entirely preserved, so that there is the same sourrounding after decruching as without packing. V.1 Loading ---------------- The selected File is loaded and the Hunkstructure is checked and displayed in the Output-Field. Hunk_Ends and the Rest of superfluous stuff are skipped. Reloc-Tables will be sorted and precompensated. V.2 Packing ---------------- see III.2 V.3 Saving --------------- Currently there are two types of Decrunchers but only the second one is recommended to use. Further ones will be added. V.3.1 Simple Decruncher - - - - - - - - - - - - - This Type uses a lot of Memory (twice as necessary). V.3.2 Normal Decruncher - - - - - - - - - - - - - This Decruncher is basically equal to the Simple Decruncher but it frees the unused Memory after decrunching. If you "Kill the Decruncher" the Decruncher is eliminated outa the Mem and "cli_module" Field in the "pr_CLI" Structure in the Process-Structure is set to the first Hunk of the Program. I know only one (1) Program which needs this Option, it is the magnificent Texteditor CED. VI. Decrunching ==================== Yet decrunching is only possible for Files packed in the Reloc-Mode. To decrunch such a File the "Crunchmode"-Gad has to be in the "Reloc"-Position. Now load the File as it would not be crunched. It will be loaded into Memory and there it will be decrunched. Now you can save the File by pressing the "Save"-Gad or recrunch it by pressing the "Crunch"-Gad. The decrunched File may not be exactly like the original one, because Symbol- and Debug-Hunks were removed, the Reloc-Tables were sorted and a Hunk_End is added to each Hunk. VII. Special Features ========================= The Program offers are some special Possibilities by saving a File before crunching: - In the "Reloc"-Mode you can use this Program to strip off useless Symbol- and Debug-Hunks and to sort the Reloc-Tables. - In the "Address"-Mode you can use it to fix an Executable to a special Address (e.g. Demos, Games) - In the "Link"-Mode you can put some Files into a single one. VIII. supplied Utilities =========================== This Section describes the Utilities which have to do with this Packer. VIII.1 Run-time Data-Decruncher --------------------------------- This Utility is very powerful and unique in the world. It patches some (6) Vectors of the DOS-Library, so any loaded Datafile will be automatically decrunched. When the File is loaded entirely no extra Mem is needed, otherwise the Program will allocate a Memoryblock as large as the original File and will decrunch it there. In all further Read-Calls the wanted Data is only copied from this Buffer, so this will also speed up Disk-Access. In this Version the Min-Security-Distance has to be Zero. Otherwise some Proggies may guru because some Data in Memory has been changed. IX. Trivialities ===================== Many Thanx may reach: Commodore for this fantastic Computer with Multitasking my HD for having no head-crashs Datel Electronics for their Action Replay helping me with debugging E.o.L. for Beta-Testing Greetinx and Handsheix fly over to: The Fly Earl of Lennox and the Rest of the Brain-Cell-Killers Ferris (Eiterschnorchel mit Senfadapter) X. History ================ ***** V1.3 ******** First Release Version, with almost all Options as V1.4 not bugfree (Crunch-Routine could produce Shit without a clear Stack) ***** V1.4 ******** Intuition Interface added, now callable from Workbench, self-detaching, Req-Lib FileRequester some Bugs fixed (all code was totally overworked) ***** V1.5 ******** V1.5a: Demo Version, no Saving possible V1.5b: Release Version Both Versions released for the Amiga '91 in Cologne! Crunch-Routine optimized, now 0,5-2%. better Results! Menu-Options "Priority" and "LED-Flash" added! Program sometimes crashed when you quitted it, now fixed V1.5c: Auto-SetComment for run-time Data-Decruncher added ***** V1.6 ******* Decruncher added User-Communication improved Quit-Bug finally removed · · - - -- --- --=- -=-=- -===- -==-==- -===- -=-=- -=-- --- -- - - · · Finito!!!