home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / b / bedit22.zip / BEDIT.DOC next >
Text File  |  1993-01-26  |  23KB  |  505 lines

  1.                                     BEDIT
  2.                               Binary File Editor
  3.                                  USER'S GUIDE
  4.  
  5.                   Copyright 1990, 1993 by Gary C. Crider and
  6.                                Parity Solutions
  7.                                
  8.  
  9.  
  10. TABLE OF CONTENTS:
  11.  
  12.         What is BEDIT? ................................... 1.0
  13.         The BEDIT command line ........................... 2.0
  14.         Operational notes ................................ 3.0
  15.         The Keyboard and Display ......................... 4.0
  16.         Modifying Data ................................... 5.0
  17.         Deleting Data .................................... 6.0  
  18.         Inserting Data ................................... 7.0  
  19.         Locating Data .................................... 8.0
  20.           Go to a Position in the File ................... 8.1
  21.           Search for Data ................................ 8.2
  22.         Print the File ................................... 9.0
  23.         Save the File .................................... 10.0
  24.         Help ............................................. 11.0
  25.         A Useful Example - 
  26.           Modification of DOS 5's EDIT ................... 12.0
  27.         Installation ..................................... Appendix A
  28.         Disclaimer ....................................... Appendix B
  29.         Support .......................................... Appendix C
  30.         Registration ..................................... Appendix D
  31.  
  32.  
  33. 1.0 What Is EXC?
  34.  
  35.    One thing most of us learned early on after working on our first PC
  36. was that EDLIN, while useful, stank (stunk?) as a editor of text files.
  37. Soon there were hundreds of full screen text editors available everywhere.
  38. Even Microsoft finally came around and include EDIT is DOS 5 to get us
  39. away from EDLIN.
  40.  
  41.    An early lesson that most who aspire to be power users learn is that not
  42. all changes we desire to make are in text files.  Sooner or later we end
  43. up patching an executable program, database for strange format file that
  44. text editors will not handle.  Enter DEBUG.  Just as EDLIN was a pain for
  45. editing text files DEBUG is a pain for editing binary files.  Strangely
  46. few people have jumped out with binary editors and the few I have seen are 
  47. not much better than DEBUG.  Even Microsoft is making us stick with DEBUG,
  48. and as a bonus, have taken the documentation for DEBUG out of the DOS
  49. documentation.  I guess they feel it is too dangerous for ordinary mortals.
  50. My feeling is, it's my file and I'll corrupt it if I want to.
  51.  
  52.    BEDIT is a very easy-to-use full screen editor for binary (or text) 
  53. files.  You simply type over the hex or ASCII data much as you would with
  54. any text editor.  BEDIT ensures that you enter hex characters (0-9 and A-F)
  55. while you are in hex entry mode.  You be able to see the hex and ASCII
  56. representations at all times whether you are editing in hex or ASCII.  
  57.  
  58.    Using BEDIT is so intuitive, I don't know why I'm writing this documen-
  59. tation or why you are reading it.  Perhaps we both like to move cautiously.
  60.  
  61.    You see a full screen of data at all times, not just a few bytes.  Paging
  62. through the file is as easy as hitting PgUp and PgDn, you don't have to
  63. enter hex displacements.
  64.  
  65.    I think you'll find, as we have at a Fortune 100 comapny (my day job),
  66. that BEDIT becomes one of the handiest tools you have.  You will use it
  67. much more than you now expect that you will.
  68.  
  69.    BEDIT automatically detects and uses any available LIM 4.0 EMS expanded
  70. memory.
  71.  
  72.  
  73. 2.0 The BEDIT Command Line
  74.  
  75.    Format: BEDIT [path]filename [/N]
  76.  
  77.    The filename is the file name of the file that you want to edit.  BEDIT 
  78. does not make an automatic backup, so back it up if you think there could    
  79. be problems.  The path is required if the file is not in the current 
  80. directory.  Specify /N if you do not want BEDIT to use EMS memory.
  81.  
  82.    
  83.  
  84. 3.0 Operational Notes   
  85.  
  86.    It bears repeating at this point that BEDIT DEOS NOT MAKE AN AUTOMATIC
  87. BACKUP of the edited file.  Since much of the usefulness of BEDIT is to just
  88. view or print the contents of a binary file, I did not want BEDIT cluttering
  89. up my directories with backup files. 
  90.  
  91.    If you intend to modify a file with BEDIT, I highly recommend making
  92. a backup file first for obvious reasons.  Since BEDIT will allow you to 
  93. change any file in any way, it is obviously a very dangerous weapon in the
  94. hands of the unskilled as well as a very powerful tool in the hands of the
  95. skilled.  Please be careful!
  96.  
  97.    BEDIT reads the entire file into memory before any edits are performed.
  98. All changes are made only to the copy in memory until a SAVE is done.  If
  99. you have LIM 4.0 compatible EMS memory, you are limited in editable file size
  100. to the amount of free expanded memory.  If you have no expanded memory, or
  101. use the /N parameter, the file is loaded into conventional memory.  Depending
  102. on your memory configuration, you should be able to load a file of 400-500 
  103. Kbytes without the use of expanded memory.  If your available expanded
  104. memory is less than your available conventional memory, use the /N option
  105. to load larger files.  Usually there is more expanded memory than conven-
  106. tional, so excluding the /N option allows larger files to load.
  107.  
  108.  
  109.  
  110. 4.0 The Keyboard and Display
  111.  
  112.    There are two modes of editing in BEDIT.  When you first load a file,
  113. screen cursor appears with both hex data and its ASCII representation dis-
  114. played in seperate sections of the screen.  The cursor is initially placed
  115. in the hex portion of the screen for editing in hex.  The character (repre-
  116. sented by two hex digits) at the cursor location appears red on color mon-
  117. itors.  The same character on the ASCII (right) side will be light cyan.  All
  118. other data charcters are yellow.  As the cursor moves, you will see the
  119. light cyan highlighting on the ASCII display move with the cursor and red
  120. letters of the hex display.  Pressing F10 places the cursor in the ASCII
  121. portion and the display at the cursor becomes red.  The corresponding 
  122. position in the hex data becomes light cyan.  F10 toggles the cursor back
  123. and forth between the two editing areas.
  124.  
  125.    The ASCII display does not display every displayable character, but only
  126. letters and numbers and the more common punctuation symbols that are common
  127. to most printers.  You can only enter these characters on the ASCII side.  To
  128. enter exotic characters you must use the hex representation on the hex side.
  129. Periods are place in the ASCII display for all non-displayable characters. 
  130. If a blank appears, it is because there is a true blank (hex 20) at that
  131. position.
  132.  
  133.    The following keys function as shown during editing:
  134.  
  135.    Page Down    - Display the next page of data.
  136.    Page Up      - Display the previous page of data.
  137.    Home         - Position the cursor at the start of the file.
  138.    End          - Position the cursor at the end of the file.
  139.    Down Arrow   - Move the cursor down one line.
  140.    Up Arrow     - Move the cursor up one line.
  141.    Right Arrow  - Move the cursor right one byte.  If at the end of a line, 
  142.                   move to the first byte of next line.
  143.    Left Arrow   - Move the cursor left one byte.  If at the start of a line,
  144.                   move to the last byte of the previous line.
  145.    Enter, Tab   - Same as right arrow.
  146.    Back Tab     - Clears the byte.  You must then type something in the byte
  147.                   before the cursor can be moved.
  148.    Insert       - Insert one byte.  Everything beyond this byte is shifted one 
  149.                   position and a hex 00 byte is inserted at the cursor.
  150.    Delete       - Delete one byte at the cursor.
  151.  
  152.    Function keys:
  153.  
  154.    F1     - Display the help screen.
  155.    F2     - Save any changes to the file on disk.
  156.    F3     - Insert a specified number of bytes at cursor.
  157.    F4     - Delete a specified number of bytes at cursor.
  158.    F5     - Move the cursor to a specified address within the file.
  159.    F6     - Print the file to LPT1:.  It appears in basically the same format
  160.             as displayed.
  161.    F7     - Not used.
  162.    F8     - Specify a search argument and locate the first occurance of it in
  163.             the file.
  164.    F9     - Locate the next occurance of the search argument.
  165.    F10    - Toggle the cursor between the hex entry area and the ASCII entry
  166.             area.
  167.    ESCAPE - Exit BEDIT.
  168.  
  169.  
  170.  
  171. 5.0 Modifying Data
  172.  
  173.    Modifying data is very simple, just type over it.  Use the F10 key to 
  174. select the hex or ASCII area.  When typing in the hex area, only valid hex
  175. characters, 0-9 and A-F are allowed and upper case is forced.  When entering
  176. data in the ASCII portion, only common printable characters are allowed and 
  177. upper or lower case may be used.
  178.  
  179.  
  180.  
  181. 6.0 Deleting Data
  182.  
  183.    First place the cursor on the first byte of the data that you want to 
  184. delete.  Pressing the DELETE key deletes one byte of data at this position.
  185. Press DELETE repeatedly to delete several bytes.  If a large block needs to
  186. be deleted, press the F4 key and reply to the prompt with the number of bytes 
  187. you want to delete starting with the byte at the cursor.
  188.  
  189.  
  190.  
  191. 7.0 Inserting Data
  192.  
  193.    BEDIT, rather using an insert mode, lets you insert bytes of binary zeros,
  194. hex 00, into the file.  You can then type over the inserted bytes with the
  195. data that you require.
  196.  
  197.    Place the cursor at the byte where you want the data inserted.  The data
  198. is inserted BEFORE the byte at the cursor.  Pressing the INSERT key inserts 
  199. one byte at a time.  If a large block needs to be inserted, press F3 and 
  200. specify the number of bytes you want inserted.  Once the null bytes appear,
  201. type over them if required.
  202.  
  203.    In order to add bytes to the end of the file, press END to go to the last
  204. byte of the file then press the right arrow.  Each press of the right arrow
  205. adds a byte to the file.  To enter a large block at the end of the file,
  206. press the right arrow once, then press F3 and specify the number of bytes
  207. needed less one (since you already added one when you pressed the right
  208. arrow).
  209.  
  210.  
  211.  
  212. 8.0 Locating Data
  213.  
  214.    There are basically three ways to move the cursor to an area you want
  215. to edit.
  216.  
  217.    First you can use Page Down and Page Up to visually look for that area you
  218. want.  Primitive but effective.
  219.  
  220.    Second, if you know the offset into the program of the area you want to 
  221. modify, press F5 and type the offset in hex.  
  222.  
  223.    The third method is to let the computer search for a known byte config-
  224. uration.
  225.  
  226.  
  227.  
  228. 8.1 Go to a Position in the File
  229.  
  230.    An offset or displacement is measured from the start of the file.  The
  231. first byte is offset 0, the second is 1, etc.  When you press F5, you are
  232. prompted for an offset which you provide in hex.  The cursor is the placed 
  233. at that address and display is updated to show the data at the cursor.
  234.  
  235.    This method is often used in applying documented patches supplied by a 
  236. software vendor.
  237.  
  238.  
  239.  
  240. 8.2 Search for Data
  241.  
  242.    Pressing F8 pops up a dialog box that request entry of a search argument.
  243. After supplying this argument, the cursor is positioned to the first 
  244. occurance of that value in the file.  If it is not found, the cursor will 
  245. appear on the last byte of the file.  If a first occurance is found, pressing
  246. F9 searches for the next occurance.  If a second is found, pressing F9 again
  247. searches for the third occurance, and so on.
  248.  
  249.    If the cursor is in the hex editing area, you will be prompted for up to
  250. four hex bytes of search argument (eight hex digits).  When the cursor is in
  251. the ASCII editing area, you may enter upt to 8 ASCII characters for a search
  252. argument.  Admittedly the search arguments are small, but I have found that
  253. when editing binary files, you are generally not looking for long strings.
  254.  
  255.    Hex data is normally entered in sets of two hex digits (nibbles) since it
  256. takes two hex digits to represent one byte.  If you enter an odd number of hex 
  257. digits, a zero nibble is prepended to the argument.  For example, if you
  258. enter 18A, the resulting two bytes that are located are 01 8A.  
  259.  
  260.   No byte swapping is ever done to accomodate the PC's low-high storage 
  261. scheme of interger data.  So if you are looking for an interger value of 
  262. 1000 (decimal), you would search for hex 3E8, which in turn is stored as hex 
  263. E8 03.  Thus, the search argument you would provide is E803.  If you don't
  264. have a clue what this means, you probably don't need to be concered about
  265. using BEDIT in this manner.
  266.  
  267.  
  268.  
  269. 9.0 Print the File
  270.  
  271.    Printing the file is easy.  You just press F6 and the output is sent to
  272. stadard print (PRN).  The format is side-by-side hex/ASCII like that dis-
  273. played on the screen with offsets at the start of each line.  896 (hex
  274. 380) bytes are printed on each page.  The pages are numbered and the file
  275. name appears at the beginning of each page.
  276.  
  277.    
  278.  
  279. 10.0 Saving the FIle
  280.  
  281.    Prior to pressing F2 to save the file all modifications are only done in 
  282. memory.  F2 writes the image in memory over the file that was originally 
  283. loaded, and the changes become permanent.
  284.  
  285.  
  286.  
  287. 11.0 Help
  288.  
  289.    Pressing F1 pops up a help screen decribing the editing and function keys.
  290. Pressing ESCAPE (or any key when last page is displayed) removes the help
  291. window and returns you to the editor.  Page Down and Page Up can be used to 
  292. move between help pages.
  293.  
  294.  
  295.  
  296. 12.0 A Useful Example - Modification of DOS 5's EDIT
  297.  
  298.    I prefer DOS 5's EDIT command by leaps and bounds over the EDLIN of
  299. previous DOSes, but there is one thing I especially don't like about it.
  300. When you select File/Open, it comes up with a default file list specification
  301. of *.TXT, like that is the only extension ever used for ASCII text files.  I
  302. would prefer *.* and let me choose from all of my files.  After reviewing
  303. all of the options, it appeared to me that there was no way to set this
  304. value to *.*.
  305.  
  306.    My next thought is that since there doesn't appear to be any type of
  307. configuration file for EDIT, the *.TXT string must be in the program, so
  308. I'll just pull out my trusty BEDIT and zap it to *.*.  Let's do it.
  309.  
  310.    Go to your directory where you keep DOS (usually C:\DOS).  Type BEDIT
  311. EDIT.COM.  Since we know we are looking for an ASCII string of *.TXT, press
  312. F10 to swap the cursor to the ASCII area and press F8 to search.  Enter
  313. *.TXT and press ENTER.  You now find that your cursor is positioned on the 
  314. last byte of the file.  This means it didn't find the string we were
  315. looking for.  Strange.
  316.  
  317.    But look! Right above our cursor is some messages that EDIT.COM displays.
  318. One of the reads "Can not find file QBASIC.EXE."  Oh yeah, I read somewhere
  319. that the EDIT editor with DOS 5 was a version of the QBASIC editor.  Let's
  320. press ESCAPE, answer 'Y' and get back to the DOS prompt.  Now let's enter
  321. BEDIT QBASIC.EXE.  Aha!
  322.  
  323.    Again let's go the ASCII area with F10 and serach for *.TXT with F8.  
  324. Bingo! We found it.  If you are faint-of-heart (wise) you can exit at this
  325. point and make a backup of QBASIC.EXE by copying it to QBASIC.BKP or some 
  326. such file name.  The go back in BEDIT of QBASIC.EXE, and repeat the
  327. search to get back to where we were before.
  328.  
  329.    In my copy of DOS 5.0's QBASIC.EXE, I am now at a displacement of hex 
  330. 3BCCA into the program and the cursor is positioned on the * of string *.TXT.  
  331. Hit the right arrow twice to position the cursor on the first T.  Type an 
  332. asterisk (*).  The string now shows *.*XT and the cursor is on the X.
  333. Lets change the X and T to hex 00s, which in most languages is used to 
  334. terminate a string.  Since we can't enter a binary zero field in the ASCII
  335. area, press F10 to switch the cursor back to the hex area.  Now type
  336. four 0s.  As you can see you have now changed the XT characters from
  337. hex 54 58 (the hex representation of X and T) to hex 00 00.
  338.  
  339.    This is what we wanted to do, so now let's save the file by pressing
  340. F2.  Exit to DOS by pressing ESCAPE and Y.  Now type EDIT and go to
  341. fie File/Open screen.  Lo and behold!  It now reads *.* and all of the
  342. files in the current directory are displayed in the pick list.
  343.  
  344.    If you made a backup, you can go delete it now.
  345.  
  346.  
  347.  
  348. APPENDIX A
  349.  
  350. Installation
  351.  
  352.     BEDIT is distributed in a ZIP file called BEDIT.ZIP.  It contains the
  353. following files:
  354.  
  355.         BEDIT.EXE         The executable file for BEDIT.
  356.         BEDIT.DOC         The documentation file.
  357.  
  358.     For best results, unzip the file into a directory on your PATH.  If you
  359. don't use a directory in your path, you will have to designate the directory
  360. containing BEDIT.EXE when executing the program.
  361.  
  362.     If you have a utility directory that is on your PATH, this is an excellent
  363. location for BEDIT.  An example installation would be:
  364.  
  365.     C:
  366.     CD \UTIL
  367.     COPY [path]BEDIT.ZIP
  368.     PKUNZIP BEDIT
  369.     DEL BEDIT.ZIP
  370.  
  371.     The PKUNZIP program is by PKWARE, Inc. and is available in many CompuServe
  372. forums under the file name of PKZ110.EXE.  Since you are reading this doc
  373. files, you have obviously already managed to unZIP the distribution file.  If 
  374. it is not currently in your path, simply copy all of the files to a directory 
  375. in your path.  Keep the BEDIT.ZIP file anywhere you like, but give plenty of
  376. copies, as is, to your friends.  If you register BEDIT, you are not licensed
  377. to give your serial number to anybody without first removing the serialization
  378. from your copy.
  379.  
  380.  
  381.  
  382.  
  383. APPENDIX B
  384.  
  385.  
  386. Disclaimer
  387.  
  388. BECAUSE OF THE DIVERSE NATURE OF COMPUTER EQUIPMENT AND EXPERTISE OF USERS,
  389. PARITY SOLUTIONS AND GARY C. CRIDER MAKE NO WARRANTY ON THE BEDIT PROGRAM
  390. WHATSOEVER, EXPRESS OR IMPLIED.  THE USER ASSUMES ALL RISK OF DAMAGE TO
  391. DATA OR EQUIPMENT RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OR MISUSE OF
  392. THIS PROGRAM PRODUCT.  THE USER MUST BE AWARE THAT USING BEDIT TO MAKE
  393. ALTERATIONS TO PROGRAMS OR DATA CAN RENDER THAT PROGRAM OR DATA USELESS.
  394.  
  395. USERS ARE ADVISED TO TEST MODIFICATIONS MADE WITH BEDIT THOROUGHLY ON FILES 
  396. FOR WHICH A BACKUP EXITS.  ANY LIABILITY OF THE AUTHOR OR PARITY SOLUTIONS IS 
  397. LIMITED TO REPLACEMENT OR REFUND OF THE REGISTRATION FEE.
  398.  
  399.  
  400.  
  401.  
  402. APPENDIX C
  403.  
  404.  
  405. Support
  406.  
  407.     I have tried to test the program to the fullest, but I am limited as to
  408. systems and configurations with which to test.  I have been programming for 18
  409. years and the one thing I know for sure is that bug free programs are very few
  410. and far between.  I can only promise to support the program to the best of my
  411. ability and provide fixes as expeditiously as possible.  BEDIT has been used
  412. at my home and worksite extensively for several years and has proven to be a
  413. reliable tool.
  414.  
  415.     Anyone can report problems and suggest changes.  Registered users get top
  416. priority in resolving their problems.  There are three ways you can report
  417. problems.  The preferred method is to contact me through CIS mail (not forum
  418. messages).  My CIS ID is 71760,3413.  You can also write me at:
  419.  
  420.    Gary C. Crider
  421.    Parity Solutions
  422.    1105 Burgess Court
  423.    Arlington, TX 76015
  424.  
  425.     The last method is to phone (817) 467-7818.  Since I am the sole technical
  426. support and the line is also used for my network consulting business, it is
  427. often hard to get through to me.  Please call and leave a message between 7:30
  428. am and 5:30 pm Central time.
  429.  
  430.     No matter which method you use, please give a brief description of your
  431. problem, your registration serial number if you are registered, and your phone
  432. number.  If I need more information, I will contact you as soon as I can.
  433. When I have a solution, I will contact you however you prefer.
  434.  
  435.     I work full time, have a consulting business to run in my spare time and
  436. write programs instead of sleeping.  So please be a little patient with me.
  437.  
  438.  
  439.  
  440.  
  441. APPENDIX D
  442.  
  443.  
  444. Registration
  445.  
  446.  
  447.     I begin with an apology.  I hate programs that in any way inhibit func-
  448. tionality or performance for the shareware version.  But when it came down to
  449. feeding the family and paying the bills, I had a change of heart and inserted
  450. a pesky notice that pops up at the beginning and gets on your nerves.  I
  451. chose this approach above that of limited functionality.  The program's full
  452. capabilities are available for you to evaluate before you invest your hard-
  453. earned money.
  454.  
  455.     Registered users will receive a unique serial number and instructions on
  456. how to serialize the program.  Serialization can be re-applied to updated
  457. versions and in no way hinders your use of the program.  You can compress or
  458. decompress the program with no effect (LZEXE or PKLITE).  I use Fabrice
  459. Bellard's LZEXE program on EXC.EXE before distribution.
  460.  
  461.     As a registered user, you will be able to update without re-registration
  462. or additional fees.  You will also be kept on my PRIVATE mailing list to
  463. receive additional information on other Parity Solutions products.  Registered 
  464. users will be entitled to a discount on any present or future Parity Solutions
  465. software.
  466.  
  467.     To register your copy, please send $10 ($45 per file server on LANS) check
  468. or money order (sorry, no credit cards yet) to:
  469.  
  470.    Gary C. Crider
  471.    Parity Solutions
  472.    1105 Burgess Court
  473.    Arlington, TX 76015
  474.  
  475.     Each license gives you or your company a single use permit for BEDIT. It is 
  476. not restricted to a single machine as long as no two users can be simul-
  477. taneously using the program.  As Borland says, "treat it like a book."  As an 
  478. example, if you register BEDIT for your home computer, but during the day you 
  479. use a portable or a computer at work,  you may keep BEDIT on both machines as 
  480. long as no one is at home using it on your home computer.
  481.  
  482.     LAN licenses grant rights to all users of a file server.  If inter-
  483. networking, a license must exist for each file server that contains a copy
  484. of BEDIT.EXE.  If two or more file servers exist on a single LAN strictly for
  485. mirroring data and fault-tolerance, these will be counted as a single file
  486. server for licensing purposes.  If in doubt, contact me.  We can work out
  487. an agreement.
  488.  
  489.     Site licensing is also available on a negotiated price basis.  I gaurantee
  490. it will be an economical alternative to buying licensines for each user.
  491.  
  492.     You may freely distribute the original BEDIT.ZIP file in any way you see
  493. fit other than selling it.  Users' groups and shareware distribution services
  494. may charge a reasonable fee for the medium and duplication costs, not to exceed
  495. six dollars.  Bulletin boards may not charge additional fees for downloading
  496. this specific program, other than normal connect-time and/or membership
  497. charges.
  498.  
  499.     You are NOT licensed to give anyone your serial number unless you first
  500. remove all serialization from your computer.  You may then no longer use that
  501. serial number.  Only Parity Solutions has the authority to issue serial
  502. numbers.
  503.  
  504.  
  505.