NewZAP: Program and Documentation (c) 1986-1991 Proprietary Products WHAT IS NEWZAP? =============== NewZAP is a multi-purpose file sector editing utility. If you've ever had the need to alter just a few bytes within a file, examine its binary and ASCII representations, or search for key sequences of digits or characters, NewZAP will make your hacking life a little bit easier. It does what text editors were not meant to do; precise position-oriented object modifications. NewZAP will run from CLI or Workbench under 1.1 or 1.2 KickStart with or without FAST RAM. ORIGINS & CREDITS ================= NewZAP is a third-generation ZAP utility in the sense that it descended from Apparat's Z-80 based SuperZap to FileZAP (Fred Fish disk # 10) to the current. NewZAP was compiled under 16-bit Aztec "C", with graphics, fontwork and debugging assisted by with Deluxe Paint, FontEdit, and MetaScope, respectively. Thanx to Scott Saunders for the competitive edge, Mike Lehman for the much-needed documentation, and to R.J. Mical for "A Final Note on Style". Beverages provided by the Coca-Cola Company and Molson Breweries of Canada, Ltd. USAGE ===== The calling sequence from CLI is NewZAP [filename], where filename is the optional initial file to edit. From Workbench, just click on the gadget. The rest of the program is... well, self-explanatory! The current file can be changed at any time by editing the filename string gadget, writing out any changes to the previous file before switching. Simply click on the HEX or ASCii windows to reflect the current editing mode. The cursor can be moved by rolling the mouse with the left button down, or by using the arrow keys. Note that each window wraps to the next; i.e., you can click on the HEX window, move the cursor over the the ASCii side, and edit the ASCii position while still in HEX mode. As in FileZAP, you cannot edit past the EOF byte in the last record. Unlike FileZAP, NewZAP displays and edits full 512-byte sectors via a 106 character wide internal font. Most commands are duplicated with matching command sequences; an exception being the HELP key, which brings up the "About..." menuitem. Disk errors and sector writes are flagged with a non-abusive audible "beep". The Search menu is unique to NewZAP. Use it to check for strings or HEX digits, forward or backward, with or without caps matching. Tired of batch files that grind your disk drive? Use NewZAP's Search, Edit and Save functions to modify both instances of ":T" to "T:" in C:EXECUTE. Execute will henceforth store its preprocessed batch files anywhere you want provided you have ASSIGNed T: to someplace! I recommend ASSIGNing T: to RAM: in your Startup-Sequence for ultra-fast EXECUTEs. CAVEATS ======= Some folk have requested the ability to extend files. Well, the original didn't support it so neither does NewZAP. I've rarely had a need for this, but perhaps future versions will support it if the demand is great. NewZAP expects an 80-column environment for its titles and gadgets. If you haven't set Preferences yet, do so! NewZAP is a two-edged sword, and can DESTROY object files with careless editing. My advice : work on backup copies. Lastly, NewZAP is shareware, a concept where authors can release high- quality software at low cost and risk to users. If you like it, contribute something to the kitty. If you don't, pass it on. A $15 donation will put you on the upgrade list, so you can receive the next major revision on disk via U.S. Postal service. ENCOURAGE USER-SUPPORTED SOFTWARE! The author can be reached at : Dallas J. Hodgson 10115 Scenic Boulevard Cupertino, Ca. 95014 U.S.A. NEWZAP Modification History ------ ------------ ------- REV 2.85: Lock problem (hopefully) cleared up. REV 2.9: The search string gadget self-activates (1.2 & later). Busy pointer displayed during searches. Recompiled under Aztec 3.4a. REV 3.0: (as distributed on Fish Disk #58) Filespec gadget now scrolls for long filenames. By public demand, NewZAP is now customizable regarding all text colors and highlighting. There are six pens used by NewZAP : NAME DEFAULT COLOR PURPOSE BgPen 0 Reserved StdPen 3 Border Information HexPen 2 Edit Window text ModPen 1 Edit Window modifications SearchPen 3 Search highlighting Use NewZAP on a backup copy of itself and Search for the following string : "Default=" The entire string should be visible in the ASCII window : "PENCOLORS->03213 [Default=03213]" Modify the numbers after the "-> to your choice of WorkBench preferences; on a standard WorkBench screen, those colors are : Blue (0), White (1), Black (2) and gold (3). The pen numbers are in the order mentioned above. Save your changes to disk, and they will be reflected the next time you run your modified copy of NewZAP. REV 3.1: "GOTO" gadget now has a menu shortcut; now EVERYTHING has a keyboard and menu equivalent! This feature requires 1.2 or later KickStart. REV 3.15: Corrected an obscure error where user could force NewZAP to attempt more than one help requester at the same time. Distributed to recent subscribers. Recompiled using short int's. REV 3.17: By popular demand : "NewZAP ?" now prints a CLI-style help note. All resource allocations now properly checked and cleaned up. REV 3.18: "NewCLI" Project menuitem added. REV 3.19: NewZAP now prints diagnostics when it exits due to resource allocation failures. Checks for 60-character wide Preferences upon powerup and aborts if so. Cleared up an old signed-int comparison problem that for some reason actually WORKED under Aztec 3.4 and earlier. Recompiled under Aztec 3.60a, 16-bit mode. Redrew the NewZAP lightning bolt icon to reflect the colors originally intended. REV 3.20: Redrew (and polished) the Help requester to reflect my current address: 3665 Benton St, #23/Santa Clara, Ca. 95051 REV 3.21 : Fixed an old bug that converted the " char to ' in ASCII mode. REV 3.24 : Finally got around to supporting user requests for "search wrap"; i.e., if a entire body of a Search String spans from the current sector to the beginning of the next, NewZAP will now be able to find it highlighting those bytes displayable in the sector where the string begins. Searches do not wrap around to the beginning of the file, however. Switching case dependency from ON to OFF now forces NewZAP to include the current sector when searching to check for any previously-hidden matches. Increased the maximum Search String length from 30 to a full 64 characters. New Item added to the Project Menu : "Print Current Sector". This dumps a copy of the current sector to PRT:. As not all printers are wide-carriage, the dump format (16 x 32) is suitable for 80-column printers. Non-printable characters (<20H) are printed as periods. The corresponding hot key for this is left-Amiga-P (for Print). NewZAP now automatically selects the Filename gadget if it was invoked without a filename. NewZAP now handles the display of empty files & unopenable files more gracefully. If the first file NewZAP attempts to open fails, the edit windows are blank. If the file was empty, the emptiness of the file is reflected by a full sector of EOF chars. As before, an attempt at loading an unsuccessful file will not disturb the current file - only a 'beep' will occur, and the original filename restored. NewZAP has a new look. The standard colors have been redone for greater clarity, and the pen colors are now more user-modifiable then ever! They are : NAME DEFAULT COLOR PURPOSE StdPen 3 Border Information, Foreground BgPen 0 Border Information, Background HexPen 1 Edit Window, Foreground HexBgPen 2 Edit Window, Background ModPen 3 Edit Window mods, Foreground ModBgPen 2 Edit Window mods, Background SearchPen 1 Edit Window Searches, Fore SearchBgPen 0 Edit Window Searches, Back On a standard WB pallette, 0=blue, 1=white, 2=black, 3=gold. The method of modifying these is the same as that outlined above under "REV 3.0". This should have been done a long time ago, but only recently did necessity force me to do so. The convenience of this feature allowed me to experiment more freely with the screen colors, and I think the default ones supplied now are the clearest and best-looking ever. REV 3.25: Got rid of an extra 1-pixel blue border to the right of the Help requester. Simplified LockRequest(). REV 3.26: Fully-ANSI'ized source, recompiled under Aztec 5.0b after hand-editing a minor compiler signed-shift bug in hexconv(). REV 3.26a: Trimmed unnecessary Intuition gadget flags from gadgets.c. Cleaned up several manifest constants for portability. Minor safety mods to FakeRequest(). REV 3.26b: compute_curpos & GADGIMMEDIATE fixed for 3.26 series. Minor low-memory cleanup problem corrected in ReadILBM.c REV 3.26c: Changed my address in the About menu. REV 3.27: Added stencil and brush support to ReadILBM.c. Standardized all clients on this version. Changed all "setmem" references to the documented Manx library routine "memset". Added ">>" characters to the Case Dependency and Set Direction menus. The filename string requester no longer activates itself when files open OK. New, standardized iff.h with 16-bit int support. REV 3.30: Major revision for AmigaDOS 2. Completely rebuilt under new includes, with new dynamic gadtools menu support when running under AmigaDOS 2.04 and later. Amazingly, still succesful at keeping the executable size under 40K. Quit hotkey added for convenience. Minor nits: 1.3 users won't be seeing the nice 2.0 submenu ">>" characters anymore. 2.0 has OS support for this, but 1.3 doesn't - and I'd just as soon minimize OS-dependent hacks where possible. Also: the NewZAP screen is a few pixels narrower than previous versions to make up for the slightly thicker 2.0 window borders. Graphics tidied up a bit. Compiled using Aztec 5.2a. -DJH