=== Repairing Atari 8-bit DOS binary executables with the BINTRIM package === [version 1.0.1] The BIN/TRIM suite consists of two programs which can help you to repair broken Atari binary executables. o BIN lists the segments of an executable, as follows: Column 1: hex offset of sement start from file start Column 2: contains an asterisk if the segment is preceded by $FFFF Column 3: FROM(hex)-TO(hex): BYTES(dec) lists segment boundaries Column 4: Number of bytes in file up to and including current segment Column 5: Exec (RUNADR) and Init (INIADR) if loaded by last segment o TRIM cuts off the file after byte $count. Example of a repair: --> BIN SPYHUNTR yields the following: ---------------------------------------------------------------- spyhuntr 0000 | * | 0601-062C: 44 | 50 | 0032 | | 4000-4057: 88 | 142 | 008E | | 4800-8D51: 17746 | 17892 | 45E4 | | 02E0-02E1: 2 | 17898 | [Exec: 0601] 45EA | | 1A1A-1A1A: 1 | 17903 | 45EF | | 1A1A-1A1A: 1 | 17908 | 45F4 | | 1A1A-1A1A: 1 | 17913 | 45F9 | | 1A1A-1A1A: 1 | 17918 | 45FE | | 1A1A-1A1A: 1 | 17923 | 4603 | | 1A1A-1A1A: 1 | 17928 | 4608 | | 1A1A-1A1A: 1 | 17933 | 460D | | 1A1A-1A1A: 1 | 17938 | 4612 | | 1A1A-1A1A: 1 | 17943 | 4617 | | 1A1A-1A1A: 1 | 17948 | 461C | | 1A1A-1A1A: 1 | 17953 | 4621 | | 1A1A-1A1A: 1 | 17958 | 4626 | | 1A1A-1A1A: 1 | 17963 | 462B | | 1A1A-1A1A: 1 | 17968 | 4630 | | 1A1A-1A1A: 1 | 17973 | 4635 | | 1A1A-1A1A: 1 | 17978 | 463A | | 1A1A-1A1A: 1 | 17983 | 463F | | 1A1A-1A1A: 1 | 17988 | 4644 | | 1A1A-1A1A: 1 | 17993 | 4649 | | 1A1A-1A1A: 1 | 17998 | 464E | | 1A1A-1A1A: 1 | 18003 | 4653 | | 1A1A-1A1A: 1 | 18008 | 4658 | | 1A1A-1A1A: 1 | 18013 | 465D | | 1A1A-1A1A: 1 | 18018 | 4662 | | 1A1A-1A1A: 1 | 18023 | 4667 | | 1A1A-1A1A: 1 | 18028 | 466C | | 1A1A-1A1A: 1 | 18033 | 4671 | | 1A1A-1A1A: 1 | 18038 | 4676 | | 1A1A-1A1A: 1 | 18043 | 467B | | 1A1A-1A1A: 1 | 18048 | ---------------------------------------------------------------- { 34} spyhuntr It is obvious from this listing, that after the 17,898th byte, things go wrong. Somehow, $1A bytes have been added, probably during some modem transfer ($1A is Control-Z, often used as the End-Of-File marker). To delete the last bytes, we look in the 5th column next to the last 'good' segment; it says 17,898 which means that this last good segment ends at byte #17,898. We now type --> TRIM 17898 SPYHUNTER ...and if we do another BIN SPYHUNTER now, we get the following, corrected SpyHunter binary: ---------------------------------------------------------------- spyhuntr 0000 | * | 0601-062C: 44 | 50 | 0032 | | 4000-4057: 88 | 142 | 008E | | 4800-8D51: 17746 | 17892 | 45E4 | | 02E0-02E1: 2 | 17898 | [Exec: 0601] ---------------------------------------------------------------- { 4} spyhuntr The file has been repaired! The programs are distrubuted both as source code and as executables; the reason the executables are relatively big is that the programs were written using DJGPP v2.01 and have some protected mode stuff prepended to them, to make sure they work on a lot of configurations (as long as you have a 386 or better, you should be safe). Anyway, I hope this program is useful in some way. N.B. This program is free software as described in the GNU Public License. Read the GPL for info. Regards, Sidney Cadot sidney@ch.twi.tudelft.nl