💾 Archived View for gemini.spam.works › mirrors › textfiles › computers › DOCUMENTATION › 4decomp.tx… captured on 2022-06-12 at 06:29:19.
-=-=-=-=-=-=-
4DECOMP V1.0 (c) 1993 by Akisoft, Vienna 4DOSs New Version 5.0 came up right now! It has a lot of new features, including BATCOMP.EXE, also from JP Software, which is assumed to compress .BTM-Files. Its purpose is to make .BTM-files shorter (to use less space on the hard- disk) and to make .BTM-files something like "encrypted". That makes it possible for batch-file-programmers to distribute their files without distributing the batch-file-source-code, which is imanent to distributing flat batch-files. The encryption algorithm is as simple as the decryption algorithm. A very short program, with pascal-source-code, can decrypt such batch-files. The maximum file-length is, like in .BTM-files, limited to 64k. File-format of the compressed file: =================================== (like everything in this package distributed without any warranty) The first 2 Bytes are equal to EBh BEh, the indicator for compressed 4DOS- .BTM-files. the next 2 Bytes contain the size of the original BATCH-file. The encryption (compression) uses the following cheme: from position 5 there are 30 characters stored, which are the most frequently used characters. The rest of the file contains nibbles (2 nibbles per byte).The first 14 of the most frequently used characters have nibble-codes from 2 to 15 (2h to Fh), the others have 2-nibble-codes (use the same size as one byte, but may be lo- cated separated inside 2 bytes), the first nibble is always 1 and the second goes from 0 to 15 (0h to Fh). The nibble code 0 (at a first-level-nibble- position) is used to indicate that the following 2 nibbles represent one char in ASCII, but the lower 4 bits swapped with the upper 4 (the 2 nibbles are swapped). Summary: If there are only a few different chars inside the text, for example by using a lot of ECHO-directives, the text can be compressed to one half of its original size (1 char uses only 1 nibble of storage place). If there are a lot of different characters in the text, and most of them appear often, it is possible that the "compressed" file is larger than the original batch-file. A short example: Original .BTM-File: ECHO OFF echo abcdefghijklmnopqrstuvwxyz Compressed .BTM-File (HEX-output of DEBUG): 0000 EB BE 28 00 20 46 4F 63-65 68 6F 0D 43 45 48 61 ..(. FOceho.CEHa 0010 62 64 66 67 69 6A 6B 6C-6D 6E 70 71 72 73 74 75 bdfgijklmnpqrstu 0020 76 77 BA C4 24 33 96 57-82 DE 5F 61 01 17 12 13 vw..$3.W.._a.... 0030 14 15 16 17 81 81 91 A1-B1 C1 D1 E1 F0 87 09 70 ...............p 0040 A7 .