home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / FILE / EDBIN04.ZIP / EDBIN.DOC next >
Encoding:
Text File  |  1990-10-08  |  30.3 KB  |  658 lines

  1.  
  2.  
  3.  
  4.                11111111   111111      1111111     11   11     11
  5.               01100000   011000 11   0110000 11  011  0111   011
  6.               011        011   0011  011     11  011  01111  011
  7.               01111111   011    011  011111110   011  011011 011
  8.               0110000    011    011  0110000 11  011  011 011011
  9.               011        011    11   011     11  011  011  01111
  10.               011111111  01111110    011111110   011  011   0011
  11.               00000000   000000      0000000     00   00     00
  12.  
  13.                          Binary File Editor Version 0.4
  14.                             (c) 1990, Stefan Strack
  15.  
  16.  
  17. ------------------------------
  18. DISCLAIMER
  19.  
  20. This program is shareware and may be distributed freely, provided neither this
  21. documentation nor the program are modified. No charges exceeding the cost of
  22. distribution may be asked. The author disclaims all liability of any sort and
  23. all warranties on this program. Especially, the author is not responsible for
  24. any violations of the copyright law that may result from illegal usage of this
  25. program. If you find this program useful, consider sending a contribution of
  26. $15 (or any amount) to:
  27.  
  28.             Stefan Strack
  29.             Dept. Biology
  30.             SUNY Albany
  31.             1400 Washington Ave.
  32.             Albany, NY 12222
  33.  
  34. Your suggestions, comments and bug reports are also very much appreciated.
  35. Please write to me at the above address or send email to:
  36.  
  37.             Bitnet:     ss9557@albny1vx
  38.             Internet:   ss9557@leah.albany.edu
  39.  
  40. DOS is a registered trademark of Microsoft; UNIX is a registered
  41. trademark of AT&T.
  42.  
  43. ------------------------------
  44. WHAT IS EDBIN?
  45.  
  46. Edbin is a string editor for binary files, a utility for file encryption, and
  47. a translator into email-compatible ASCII files. The binary file editor is
  48. reminiscent of the DOS line-editor EDLIN, but has string-, as well as
  49. byte-level editing capabilities. Edbin can be run interactively or from the
  50. DOS command line; commands are single-letter mnemonics. There are no windows
  51. or pull-down menus. In short, Edbin features:
  52.  
  53.   o   Binary file editing: Edbin allows you to easily edit strings in program
  54.   files, while making sure the programs will still run afterwards. This might
  55.   be useful for changing offending program messages, or even producing a
  56.   foreign-language version of a program. In addition, the editor lets you
  57.   quickly scan an "undocumented" program to find out what it is doing without
  58.   actually running it. Like DEBUG, Edbin can also be used for binary-file
  59.   patching.
  60.  
  61.   o   File encryption: Edbin offers fast and easy, yet very secure file
  62.   encryption to protect your personal files from prying eyes.
  63.  
  64.   o   ASCII file translation: Edbin converts program files into pure text
  65.   (ASCII) files. These files can then be sent via ASCII-only email links or
  66.   with ASCII transfer protocols and converted back into binary files at the
  67.   receiving end. A built-in circular-redundancy-check (CRC) checks file
  68.   integrity after transfer. You can chose between a generic hexadecimal format
  69.   or a more compact, base-64 format that requires Edbin on both the sending
  70.   and receiving end.
  71.  
  72. ------------------------------
  73. REQUIREMENTS
  74.  
  75. Edbin will run under DOS 2.0 and up on any IBM-compatible machine. It requires 
  76. less than 95K RAM (plus space for the command interpreter if you shell out to
  77. DOS). Since Edbin runs entirely in text-mode, it will work with any video
  78. card. If you are editing large files, a fast hard disk is preferable over a
  79. slow floppy drive.  Even better in terms of access speed is editing files from
  80. a RAM drive.
  81.  
  82. ------------------------------
  83. COMMAND OVERVIEW
  84.  
  85. The syntax for starting up Edbin is:
  86.  
  87.             edbin [/d] [/<command> ..] filespec
  88.  
  89. Edbin will also accept the UNIX-style hyphen ('-') in place of the DOS switch 
  90. ('/'). The obligatory parameter 'filespec' tells Edbin which file to work on.  
  91. The optional switch /d will force editing on-disk (see IN-MEMORY vs. ON-DISK 
  92. EDITING). The /<command> switch will execute said single-letter command (see 
  93. COMMAND LINE OPTIONS), optionally pass a command argument, and exit back to
  94. DOS.  After invoking edbin (without /<command> argument), the editor displays
  95. a '*' prompt and waits for a command. The following is a brief summary of
  96. available single-letter (or address-) commands; a more detailed description
  97. can be found later in the manual. Some of these commands prompt the user for
  98. arguments (such as the filename to write to disk). Prompts or any work in
  99. progress can be cancelled by hitting ^C (Control-C or Control-Break); the user
  100. is then returned to the editor command prompt ('*').
  101.  
  102. N       (Next) The editor displays the next string after the current file
  103.         offset and goes into editing mode. <Enter> is a synonym for N.
  104.  
  105. n       (where n is an integer >= 0) The string immediately after file offset
  106.         n (or if n falls within a string, beginning with n), is edited.
  107.  
  108. U       Undo last string edit.
  109.  
  110. L       List all strings.
  111.  
  112. S       Search and replace.
  113.  
  114. n:xy    Write the string xy to file offset n.
  115.  
  116. n#m     Write the decimal byte m to file offset n.
  117.  
  118. n$m     Write the hexadecimal byte m to file offset n.
  119.  
  120. C       Encrypt/Decrypt file.
  121.  
  122. V       Validate file (CRC).
  123.  
  124. H       Translate to hexadecimal ASCII file.
  125.  
  126. B       Translate to base-64 ASCII file.
  127.  
  128. I       Translate to binary file.
  129.  
  130. W       Write edited file to disk.
  131.  
  132. Q       Quit Edbin.
  133.  
  134. X       Save the current file and exit Edbin.
  135.  
  136. E       Edit another file.
  137.  
  138. ?       Display a help screen.
  139.  
  140. =       Show current editor settings.
  141.  
  142. "xy     Set search string to xy. / is a synonym for " (Default="").
  143.  
  144. _n      Set minimum string length to n (Default=8).
  145.  
  146. [n      Set working range start to file offset n (DEFAULT=0).
  147.  
  148. ]n      Set working range stop to file offset n (DEFAULT=filesize-1).
  149.  
  150. !       Toggle overwrite mode (Default=OFF).
  151.  
  152. @       Toggle include extended characters (127-255, Default=OFF).
  153.  
  154. :       Toggle prompting (Default=OFF).
  155.  
  156. .       Reset editor settings to default.
  157.  
  158. >       Start DOS shell (>prog executes prog and returns to Edbin).
  159.  
  160. '       (single quote) Void command, the following characters are ignored. The
  161.         quote serves as a comment leader in input-redirection files.
  162.  
  163. ------------------------------
  164. IN-MEMORY VS. ON-DISK EDITING
  165.  
  166. Edbin can edit files up to 58 Kbytes in size in memory. Files larger than that 
  167. (as large as your disk space permits) are edited "on-disk", i.e. modifications 
  168. are directly written to disk rather than to memory. When a file is being 
  169. edited on-disk, the program's status line will inform you that it is 
  170. "modifying on disk". In this case, you should better have a back-up copy of 
  171. your edited file at hand, since all edits will be final. You can force on-disk 
  172. editing of files smaller than 58K with the '/D' command switch (see COMMAND 
  173. LINE OPTIONS). Forced on-disk editing is useful when editing commands are
  174. given on the DOS command line. On-disk editing is obviously slower than
  175. editing in memory, but speed can be improved when large files are edited from
  176. a RAM drive.
  177.  
  178. ------------------------------
  179. COMMAND LINE OPTIONS
  180.  
  181. Edbin can be run interactively or by specifying commands on the DOS command
  182. line. All command line arguments except for the '/d' switch and the filename
  183. argument are passed on to the command interpreter as though they were input
  184. from an editor prompt. If the specified file has not been modified in memory
  185. after all command line commands have been processed, Edbin will exit. For
  186. example:
  187.  
  188.       edbin /_12 /l /v foo.exe
  189.  
  190. will list all strings of length >= 12, compute a CRC in foo.exe and exit.
  191.  
  192.       edbin foo.exe /s /abc /xyz
  193.  
  194. will substitute all occurences of the string "abc" with "xyz" in foo.exe. If
  195. any strings were substituted and foo.exe was edited in memory, Edbin will wait
  196. for the user to issue an exit-command interactively. Otherwise, it will exit
  197. to DOS after processing the command line arguments. If you specify
  198.  
  199.       edbin foo.exe /s /abc /xyz /d
  200.  
  201. editing will be done directly on-disk, therefore Edbin will not wait for you
  202. to save your changes manually. Another example:
  203.  
  204.       edbin /h / /A$20File$20Comment foo.exe
  205.  
  206. This command will translate foo.exe into an hexadecimal ASCII file (/h),
  207. accept the default file name foo.hex (/), and use the file ASCII file comment
  208. "A File Comment" (the $20 stands for the space character (hexadecimal 20), see
  209. USING SPECIAL CHARACTERS). Since foo.exe will not have been modified after
  210. this command, Edbin will exit to DOS.
  211.  
  212. ------------------------------
  213. THE EDITOR
  214.  
  215. The binary file editor will preserve the length of the edited file, thus
  216. trying to maintain the integrity of an executable file. The following sections
  217. will describe the editing functions of Edbin in more detail.
  218.  
  219. ------------------------------
  220. WHAT IS A STRING?
  221.  
  222. The binary file editor operates on strings. A string, as defined by Edbin, is 
  223. a sequence of printable ASCII characters. By default, a string consists of 8 
  224. or more characters of ASCII value 9 (vertical tab) or 32-126 (Space to ~). The 
  225. default minimum string length (8) can be changed with the _ (underscore) 
  226. command (see EDITOR SETTINGS). If the "include extended characters" switch is 
  227. toggled on (@ command), the string definition includes the IBM extended 
  228. character set (127-255). Editable strings can also be delimited with the work
  229. range ('[' and ']') or search string ('"') commands.
  230.  
  231. ------------------------------
  232. EDITING A LINE
  233.  
  234. If the 'N' (Next, or simply <Enter>) command is given, Edbin will enter
  235. editing mode for the next string after the current file offset. If you enter a
  236. file offset n (0 <= n < filesize), the next string after n will be opened for
  237. editing. If no string is found after the current file offset, Edbin returns to
  238. the beginning of the file (or to the beginning of the work range if
  239. specified). Let us suppose you hit <Enter> after starting Edbin. The display
  240. might look like this:
  241.  
  242. *
  243.     517:This is the first string in this file
  244.     517:_
  245.  
  246. This means that the editor found the string "This is .." starting at file 
  247. offset 517. You can now hit <Enter> to leave the string as is and return to 
  248. the command prompt, or type a new string (including editing characters, see
  249. EDITING KEYS) and hit <Enter> to replace the old string. The consequences of 
  250. modifying a string depend on the setting of the !  (overwrite) toggle (see 
  251. EDITOR SETTINGS): if overwrite is toggled off (default), the replacement 
  252. string will be truncated to the length of the original string, or padded with 
  253. spaces if it is shorter than the original string. If overwrite is toggled on, 
  254. the replacement string will be written without truncating or padding, even 
  255. past the boundary of the original string.  "Overwrite ON" is to be used with 
  256. caution, since it lets you corrupt a file's executability. You can undo your 
  257. last change with the 'U' command; however, this will only work if you have not 
  258. written past the original string's end.
  259.  
  260. ------------------------------
  261. EDITING KEYS
  262.  
  263. When in string-editing mode, the following characters (in addition to the
  264. code-characters $ and #, see USING SPECIAL CHARACTERS) have a special meaning:
  265.  
  266.   . (period)       = copy character
  267.   * (asterics)     = copy template
  268.   @ (at)           = skip template
  269.   ^ (caret)        = toggle typeover/insert
  270.   ~ (tilde)        = delete character
  271.   ' (single quote) = quote character
  272.  
  273. If you want to use these characters as such, precede them with a single quote.
  274. These keys work similar to DOS editing keys (F1-F4, INS, DEL), but have to be
  275. embedded in the string and take effect only after hitting <Enter>. This may be
  276. unfamiliar to users of full-screen editors, etc., but has the advantage that
  277. input can be redirected from a file.
  278.  
  279. .    (period) This is Edbin's "F1" (or right-arrow) key. It copies the next
  280. character in the original string (template) to the edited string. Example:
  281.  
  282.    2089:Cannot locate file
  283.    2089:.......find file<Enter>
  284.  
  285. -> 2089:Cannot find file
  286.  
  287. *    (asteriks) Corresponds to F2 or F3 (if last character). This key copies
  288. all characters up to the character following '*' from the template to the
  289. edited string. If the character following '*' does not occur in the template
  290. or if '*' is the last character entered, the entire remainder of the template
  291. is copied. Example:
  292.  
  293.    9002:FOOBAR - The Electronic Piggybank V1.0 (C) 1988-89 by Oddball Software
  294.    9002:*V2*<Enter>
  295.  
  296. -> 9002:FOOBAR - The Electronic Piggybank V2.0 (C) 1988-89 by Oddball Software
  297.  
  298. @    (at) This key works similar to DOS's F4. All characters of the template 
  299. up to the character following '@' are skipped. If the character after '@' is 
  300. not found in the template or if '@' is the last character entered, the entire 
  301. remaining template is skipped. Example:
  302.  
  303.   17950:Hit any key and say your prayers
  304.   17950:@say*, then press ESC<Enter>
  305.  
  306. ->17950:say your prayers, then press ESC
  307.  
  308. ^    (caret) This key toggles between "Insert" and "Typeover" mode. When you
  309. start editing a string, you are in typeover mode, i.e. the template is
  310. overwritten with your key strokes. What you type after the first '^' is
  311. inserted before the current position in the template. Typeover is turned back
  312. on after the next '^', a.s.o. Example:
  313.  
  314.    315:Fatal error: allocation table thrashed --- Sorry
  315.    315:*:^ file*<Enter>
  316.  
  317. -> 315:Fatal error: file allocation table thrashed ---
  318.  
  319. ~    (tilde) '~' "deletes" the current character in the template by advancing
  320. a pointer to the next template character. Example:
  321.  
  322.   9010:Unregistered Copy
  323.   9010:~~R*<Enter>
  324.  
  325. ->9010:Registered Copy
  326.  
  327. Remember:
  328.  - quote if you want an editing character to appear in the string
  329.    (e.g."FILE'.EXT")
  330.  - use two quotes for one quote to appear (e.g."don''t")
  331.  - use the "undo" command in case a string gets fouled up
  332.  
  333. ------------------------------
  334. DIRECT WRITE
  335.  
  336. You can write to a file even outside a string by issuing a direct-write
  337. command. This can be used for patching programs. For example, by issuing
  338.  
  339.       1203:Writes directly into binary file
  340.  
  341. at the command prompt, the string "Writes directly .." will be written
  342. starting at file offset 1203. Another example:
  343.  
  344.       2344#065
  345.  
  346. will write the decimal character 65 ('A') to file offset 2344. Or:
  347.  
  348.       701$1B
  349.  
  350. will write the hexadecimal character 1B (ESC) to file offset 701. You can mix
  351. character, decimal and hexadecimal designations as in:
  352.  
  353.       10:Hello,$20world#033
  354.  
  355. which will write the string "Hello, world!" to file offset 10 (see USING
  356. SPECIAL CHARACTERS for usage of decimal and hexadecimal character codes).
  357.  
  358. ------------------------------
  359. LIST STRINGS
  360.  
  361. The 'L' (List) command will list all strings conforming to the current editor
  362. settings. The format for each string is:
  363.  
  364.       n:string
  365.  
  366. where n is the file offset at which "string" starts.
  367.  
  368. ------------------------------
  369. SEARCH AND REPLACE
  370.  
  371. The 'S' (search and replace) command will replace every occurence of a 
  372. prompted search string with a prompted replacement string. You can substitute 
  373. non-printing characters by using their decimal or hexadecimal values (see 
  374. USING SPECIAL CHARACTERS). The actions of this command as for the 'N' command 
  375. depend on the setting of the "overwrite toggle" (!). If "overwrite OFF" the 
  376. replacement string is padded or truncated to fit the length of the search 
  377. string; if "overwrite ON" the replacement string can write past the end of the 
  378. search string. You can restrict search-and-replace by setting the working 
  379. range delimiters ('[' and ']') or by enabling prompting (':', see EDITOR 
  380. SETTINGS). To simply search for a string, use the '"' command to set a search
  381. string (see EDITOR SETTINGS), and then enter 'L' for a listing or hit
  382. <Enter> to edit the next matching string.
  383.  
  384. ------------------------------
  385. USING SPECIAL CHARACTERS
  386.  
  387. You can incorporate any non-printable character (except ASCII 0) into a
  388. prompted string by using the decimal code #nnn or the hexadecimal code $nn.
  389. nnn in the decimal code is a number between 001 and 255 representing the ASCII
  390. character with that value. nn in the hexadecimal code is a number between 01
  391. and FF representing ASCII values 1 through 255. You cannot represent ASCII 0
  392. this way, because the null character is used as the string terminator in C,
  393. the computer language used for implementing Edbin (the only exception is
  394. single-byte "direct write": 911$00 or 911#000 does indeed write the null
  395. character to offset 911). For example, you could input the string "ABC" as
  396. "#065#066#067", or "$41$42$43" (or any combination of ASCII, decimal, or
  397. hexadecimal codes). Edbin will interpret "#32" or "#0FF" as literal strings,
  398. since they do not conform to the special codes format (# must be followed by
  399. three decimal digits). You can use the single quote (') to force
  400. interpretation as a literal string (E.g. "'$20" translates into the string
  401. "$20"); two consecutive single quotes translate into one single quote.
  402. Special characters are accepted in prompts for the encryption/decryption
  403. password, search and replace string, and during string editing. In addition,
  404. you can use special character codes to use, e.g. embedded blanks on the DOS
  405. command line, as in:
  406.  
  407.       edbin /d /c /cryptic$20password foo.exe
  408.  
  409. ------------------------------
  410. EDITOR SETTINGS
  411.  
  412. Edbin allows customizing the editor by changing a number of default settings.
  413.  
  414. _n      (set minimum string length to n): By default, Edbin considers a
  415. sequence of eight or more ASCII characters (32-126), including the horizontal
  416. tab character (9) as a string for listing or editing. You can change the
  417. default minimum string length to any value between 1 and 255 with the _
  418. (underscore) command.
  419.  
  420. "xyz    (set search string to "xyz"): By specifying a global search string,
  421. you can delimit the strings that Edbin will list or display for editing. For
  422. example, specifying "Error will cause the editor to skip all strings that do
  423. not contain the substring "Error". A specified search string will remain in
  424. effect until you clear it again (" followed by <Enter>). The forward slash (/)
  425. is a synonym for ", and must be used if the search string is specified on the
  426. command line, since DOS will garble command line arguments if an unmatched
  427. quote is found.
  428.  
  429. [n      (set working range start to n). By default, Edbin will work on the
  430. entire edited file (from file offset 0 to EOF). You can tell Edbin to ignore
  431. all strings before a given file offset by issuing the left square-bracket
  432. command. The current file offset is reset to the beginning of the work range
  433. after this command.
  434.  
  435. ]n      (set working range stop to n): Similarly, the right square-bracket
  436. will cause the editor to ignore strings after the specified file offset.
  437.  
  438. :       (toggle prompting): With the default "prompting OFF", the editor will
  439. use the global settings for working range and search string for all
  440. operations. With prompting enabled, however, you will be prompted for range
  441. delimiters and, if applicable, a search string for every command you give.
  442.  
  443. !       (toggle overwrite mode): Edbin will preserve the length of an edited
  444. file, i.e. you cannot insert or delete characters, since this would most
  445. likely corrupt an executable file. As an additional safeguard, edited strings
  446. are normally truncated to the length of the original string before they are
  447. written back (i.e. overwrite is OFF by default). Likewise, edited strings
  448. shorter than the original are padded with blanks. The ! (exclamation mark)
  449. toggle allows you to override truncating or padding; i.e. strings are written
  450. exactly as entered, even past the boundaries of the original string. Overwrite
  451. mode toggled ON should obviously be used with caution, since you might
  452. inadvertently overwrite binary instructions. The behavior of the search and
  453. replace function is similarly dependend on the setting of the overwrite
  454. toggle.
  455.  
  456. =       (show settings): The equal-sign displays all current editor settings;
  457. defaults are shown in brackets.
  458.  
  459. @       (toggle include extended characters): By default, Edbin will consider 
  460. characters in the IBM extended character set (127-255) as not part of an 
  461. editable string. If @ (at) is toggled ON, Edbin will display and edit strings 
  462. containing extended characters.
  463.  
  464. .       (reset to default): The period resets all editor settings to their
  465. defaults.
  466.  
  467. ------------------------------
  468. OFF-LINE EDITING
  469.  
  470. The output of the "List strings" command can be processed as a list of "Direct
  471. write" commands. This together with DOS input/output redirection allows you to
  472. dump all strings in a program to a text file for editing with your favorite
  473. pure-ASCII editor. Command prompts and messages are written directly to the
  474. console, so they will not be redirected to a file. After editing, these string
  475. can be written back into the original program file. An example:
  476.  
  477.       edbin /l foo.exe > strings.txt
  478.  
  479. will write all strings with their starting file offset to the file
  480. strings.txt. After editing the file strings.txt, you call up Edbin with input
  481. redirection:
  482.  
  483.       edbin /d foo.exe < strings.txt
  484.  
  485. The /d switch forces on-disk editing, so the editor will write all changes
  486. directly to foo.exe on disk before exiting when EOF is encountered in
  487. strings.txt. Otherwise you would have to add commands for saving and exiting
  488. at the end of strings.txt. The off-line edited file may contain comments,
  489. since Edbin will ignore lines that start with a ' (single quote). Direct
  490. writes will write a string irrespective of the previous contents of the file
  491. address pointed to. So you have to take care not to change file addresses or
  492. exceed the length of the original string while off-line editing.
  493. Alternatively, you could change direct write commands into addressed string
  494. editing commands as in:
  495.  
  496. 1021:This is a string
  497.   becomes
  498. 1021
  499. This is a string
  500.  
  501. This way, provided overwrite is OFF, the edited string will be clipped or
  502. padded as needed.
  503.  
  504. ------------------------------
  505. ENCRYPTING AND DECRYPTING
  506.  
  507. Edbin offers a simple, yet secure way of password-protecting your files. When
  508. you enter 'C' (Crypt) at the prompt or from the DOS command line, you will be
  509. prompted for a password (up to 127 characters). The password may contain codes
  510. for special characters (see USING SPECIAL CHARACTERS). Your file is then
  511. scrambled using your password as a key. The process is symmetrical, so
  512. decryption simply entails entering 'C' again and retyping the password. The
  513. encryption/decryption process is sensitive to case and leading or trailing
  514. blanks. Consequently, the password must be retyped exactly as entered for
  515. encryption. Also, the working range delimiters must be set identically for
  516. encryption and decryption (usually to the beginning and the end of the file).
  517. For those interested in implementation details: encryption/decryption works by
  518. XORing each byte with the output of a "pseudo" random-number generator. The
  519. password is used to produce a unique initial seed. The implementation of this
  520. random-number generator was verified to have a period of 2^32 and no
  521. "singularities". Edbin encryption should thus be very hard to break.
  522.  
  523. ------------------------------
  524. ASCII-FILE TRANSLATION
  525.  
  526. Transfer of binary files via telephone lines across the country or, worse,
  527. across the ocean can dramatically increase your monthly phone bill. The
  528. alternative are free networks, such as Internet or Bitnet, that connect mostly
  529. university computer centers. Some even connect to overseas, such as Bitnet
  530. which allows exchange with EARN sites in Europe. The disadvantage: most links
  531. are ASCII-only or have rather unreliable binary transfer capabilities. How can
  532. you still send binary files via email? The solution is to convert binary files
  533. into a text file, email the text file, and convert it back to the original
  534. binary file at the receiving end. Most straightforward: send a hexadecimal
  535. dump of the binary file (each byte is represented as a 2-digit hexadecimal
  536. number). While this method is rather easily implemented, it has a size
  537. problem: the text file is more than twice as large as the original. The UNIX
  538. atob/btoa utilities use a space-saving base-85 encoding scheme, which
  539. translates groups of four bytes into 5 ASCII characters, increasing the size
  540. of the emailed file by slightly more than 25%. uuencode/uudecode employ a
  541. base-64 code that is similar but not identical to the Edbin base-64 format.
  542. The Edbin two-way file translator implements two ASCII-file translation
  543. formats, both with built-in check for file integrity. The generic hexadecimal
  544. format is easy to generate and decode with a few lines of program code, hence
  545. does not require the presence of Edbin on both sides of transmission. The
  546. base-64 format is more compact than hexadecimal, but requires Edbin on both
  547. ends for encoding and decoding.
  548.  
  549. ------------------------------
  550. HEXADECIMAL TRANSLATION FORMAT
  551.  
  552. The 'H' command invokes the binary-to-hexadecimal translator. The currently
  553. edited file is taken as input and a hexadecimal ASCII translation is written
  554. to a file with the default extension ".HEX". You may optionally include a one-
  555. line comment which will be displayed when the file is decoded back to binary
  556. again. You can encode "in pieces" (necessary if your email link has a
  557. transmission size limit or the file would not fit on a floppy) by setting the
  558. work range delimiters or enabling prompting (see EDITOR SETTINGS). The ASCII-
  559. to-binary translator can incrementally build the original program file from a
  560. number of split-up ASCII files. The first line in a hexadecimal format file is
  561. a header that contains the translation format, the name of the encoded binary
  562. file, its size and a 16-bit CRC for file integrity check. The next line
  563. contains the optional file comment, and is followed by the hexadecimal text.
  564. Each byte is encoded by 2 hexadecimal digits; there is a line-break after 80
  565. characters, but no spaces between pairs of digits. The resulting text file is
  566. a little more than twice the size of the binary file it encodes.
  567.  
  568. ------------------------------
  569. BASE-64 TRANSLATION FORMAT
  570.  
  571. Entering 'B' from the command prompt or from the command line starts
  572. translation of the current work file into base-64 ASCII format. In this format
  573. groups of 3 bytes are translated into 4 text characters (of a set of 64),
  574. resulting in a file that is only about 35% larger than the binary file it
  575. encodes. The set of 64 characters used for encoding is included with the
  576. base-64 format file as a "translation table" after the file header. This
  577. translation table is used when decoding the base-64 file. For encoding, Edbin
  578. uses a default translation table consisting of digits, upper- and lower-case
  579. letters plus the comma and the semicolon. If your mailer happens to garble or
  580. substitute one of the characters used, you can change the default translation
  581. table by editing EDBIN.EXE: search for a string containing 012345 and retype
  582. the modified string or use search-and-replace ('S'). All printing characters
  583. (ASCII 32 - 126) are valid, but no character may appear more than once in the
  584. translation table. The modification will be in effect after saving EDBIN.EXE
  585. and restarting the editor. The base-64 translator's operation is otherwise
  586. identical to the binary-to-hexadecimal translator (see above).
  587.  
  588. ------------------------------
  589. TRANSLATING TO BINARY FORMAT
  590.  
  591. The 'I' command will translate both hexadecimal and base-64 encoded ASCII 
  592. files back into the original binary files. It takes as input the current work 
  593. file, which must be in one of the ASCII formats that Edbin supports, and 
  594. writes the binary file to disk (the default file name is taken from the file 
  595. header). Initially, the text-to-binary translator tries to establish the 
  596. encoding format by searching for the file header. It will ignore everything 
  597. before the file header (e.g. the email message header), and ignore all lines 
  598. after the number of bytes specified in the file header have been decoded. When 
  599. done, the translator compares the CRC of the newly created binary file with 
  600. the CRC in the file header and reports a warning in case the file integrity 
  601. check failed. Edbin is also able to decode hexadecimal ASCII files that lack a 
  602. file header, i.e. files created with a hexadecimal dump program other than 
  603. Edbin (e.g. the UNIX "od -h" utility). Hexadecimal decoding is relatively 
  604. free-format, i.e. any number of spaces or line-breaks are allowed between 
  605. pairs of digits.  It is possible to incrementally build one large binary file 
  606. by decoding several ASCII files and "appending" to the growing binary file.
  607.  
  608. ------------------------------
  609. FILE VALIDATION
  610.  
  611. Upon entering 'V', Edbin will compute and display a 16-bit circular-
  612. redundancy-check (CRC) for the edited file. This can be used to authenticate
  613. programs. The same CRC is written to the file header when translating files to
  614. ASCII-format.
  615.  
  616. ------------------------------
  617. WRITING A FILE AND EXITING
  618.  
  619. The 'W' command writes the currently edited file to disk, the 'X' command
  620. saves the file if it was modified and then exits Edbin, and entering 'Q' quits
  621. Edbin without saving changes. It is not necessary to save the file if it was
  622. "modified on disk", since all changes will have been written to the disk
  623. immediately. It is possible to save part of a file by adjusting the range
  624. delimiters ('[',']', see EDITOR SETTINGS). This comes in handy if you want to
  625. split up a file that is too large for your text editor or floppy disk. Edbin
  626. also allows you to append the edited file to an existing file.
  627.  
  628. ------------------------------
  629. BUSY DISPLAYS
  630.  
  631. Edbin has two displays indicating it is busy doing something. When searching
  632. for strings, validating a file, etc., it will display a running counter of the
  633. current file offset. When a file is written to disk during translation to
  634. binary, hexadecimal or base-64 format, a pulsating square is displayed.
  635.  
  636. ------------------------------
  637. RELEASE HISTORY
  638.  
  639. Version 0.1, 5/19/90
  640.  
  641. Edbin has its roots in Bincode, a simple binary-hexadecimal translation
  642. utility I wrote for emailing programs. The string editor was inspired by the
  643. shareware program "Strings" (author unknown), which dumps strings in programs
  644. to the screen.
  645.  
  646. Version 0.2, 7/8/90
  647.  
  648. Minor and major bugs are fixed. Inspired by uuencode/uudecode, version 0.2
  649. supports a modifiable translation table for the base-64 translator.
  650.  
  651. Version 0.3, 8/24/90
  652.  
  653. An "undo" command, special editing keys, and partial write were added.
  654.  
  655. Version 0.4, 9/9/90
  656.  
  657. Bug-fix in partial write
  658.