Short: Use favorite ASCII editor for HEX data V1.14 Author: stoecker@rcs.urz.tu-dresden.de (Dirk Stoecker) Uploader: stoecker@rcs.urz.tu-dresden.de (Dirk Stoecker) Version: 1.14 Type: util/cli Kurz: Programm, um HEX-Daten mit ASCII Editor zu editieren This program converts data (for example program code) into the hexadecimal data system. This data could be edited with your favorite ASCII text editor. After that you can convert the data back to their old style. So you do not need a special hexadecimal editor and you will also be able to delete, insert parts of the file and things like that. Most hexadecimal editors only allow to change given data byte for byte. Be sure you know what you are doing! To insert some data into program code most time crashes the program, because the internal addresses are now illegal. But the ability to delete data is useful for removing start code from modules, pictures or text. BinHex needs OS 37 (2.0) or later OS versions! USAGE: BinHex BIN/A,HEX/A,MAKEBIN/S,ONLYDATA/S,ROWS/N,ASMDATA/S,CDATA/S, REV=REVERSED/S,SIZE/N BIN give filename for original data file HEX give filename for hexadecimal data MAKEBIN set program to convert HEX to BIN (else BIN to HEX) ONLYDATA add no ASCII output and no position info to hex data file ROWS give number of rows in one line (1 row = 4 byte) ASMDATA creates a field of ASM DC.L lines (not convertable back to bin). CDATA creates a ULONG data[] = { ... } fiels (not convertable back). REVERSED converts HEX format, where bytes of 16 bytes groups are in reverse order (at the moment only in HEX->BIN mode) SIZE 1) for ASMDATA and CDATA (1 = Byte, 2 = Word, 4 = Longword) 2) for REVERSED : gives size of REVERSED data (default = 16) The options ASMDATA and CDATA create an output useable in an assembler or C compiler. If you choose SIZE 2 or 4 and the file does not end at WORD or LONG boundaries, at the end zeros are added till the boundary. To make it impossible to overwrite binary data if not wanted use every time one of the BIN or HEX keywords, but they are not needed!. «BinHex A B» is same as «BinHex A HEX B», but the second is saver. hexadecimal data format: In the hexadecimal file the data is interpreted from begin of line to next tab stop (\t, $09). If there is no tab stop in the line it is done from begin of line to next return (\n, $0A). All other parts and spaces are ignored! If there is a \ in the data part all following characters to the next tab stop (or return) are not converted. They are taken like given (good for inserting readable text). example 1: BIN data in RAM:A Hello World! call BinHEX RAM:A HEX RAM:B ONLYDATA HEX data in RAM:B 48656C6C6F20576F726C6421 example 2: HEX data in RAM:B 4865 6C6c 6f20\World! call BinHEX RAM:A HEX RAM:B MAKEBIN BIN data in RAM:A Hello World! Please report me bugs, comments, suggestions and problems. If possible write a little mail if you use the program sometimes. If there are some Enforcer hits or other problems report them as good as possible. Do not forget BinHex including source is Public Domain! I hope some more programmers follow the PD/Freeware idea. Shareware is good, but why pay for example 20$ for a very little utility? Please contact me: **************************************************************************** * snail-mail: * e-mail: * * Dirk Stoecker * stoecker@rcs.urz.tu-dresden.de * * Geschwister-Scholl-Str. 10 * phone: * * 01877 Bischofswerda * GERMANY 03594/706666 * * GERMANY * world wide web: * * * http://rcs.urz.tu-dresden.de/~stoecker/ * **************************************************************************** ============================= Archive contents ============================= Original Packed Ratio Date Time Name -------- ------- ----- --------- -------- ------------- 6340 3425 45.9% 10-Feb-97 21:18:26 BinHex 3951 1786 54.7% 10-Feb-97 21:18:32 BinHex.readme 10330 3690 64.2% 10-Feb-97 21:18:26 +BinHex.c 408 245 39.9% 10-Feb-97 21:18:26 +SDI_ASM_functions.o 1195 549 54.0% 10-Feb-97 21:18:28 +SDI_ASM_protos.h 1928 753 60.9% 10-Feb-97 21:18:28 +SDI_ASM_STD_functions.o 3845 1250 67.4% 10-Feb-97 21:18:28 +SDI_ASM_STD_protos.h 4827 2045 57.6% 10-Feb-97 21:18:28 +SDI_defines.h 3952 1717 56.5% 10-Feb-97 21:18:28 +SDI_functions.o 3424 1423 58.4% 10-Feb-97 21:18:28 +SDI_protos.h 547 310 43.3% 10-Feb-97 21:18:28 +SDI_structures.h -------- ------- ----- --------- -------- 40747 17193 57.8% 11-Feb-97 14:21:24 11 files