--- ncurses-hexedit-0.9.7.orig/Makefile.in +++ ncurses-hexedit-0.9.7/Makefile.in @@ -82,9 +82,9 @@ all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -251,10 +251,15 @@ -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ --- ncurses-hexedit-0.9.7.orig/hexedit.lsm +++ ncurses-hexedit-0.9.7/hexedit.lsm @@ -0,0 +1,22 @@ +Begin3 +Title: [N]curses Hexedit +Version: 0.9.7 +Entered-date: 08AUG99 +Description: Hexedit is an editor which allows editing and viewing of + a file or disk in hexadecimal, along with its ASCII + or EBCDIC text equivalent. Standard editing features + include insert, delete, search (text or byte searches), + highlighted changes, undo, two different viewing formats, + base converter, and full screen text snapshots. Editing + fixed disks (i.e. /dev/hda) in Linux and OpenBSD is supported. + Color terminals are supported. +Keywords: hexedit hex binary disk ASCII EBCDIC editor Linux GNU GPL +Author: apoc@laker.net (Adam Rogoyski) +Maintained-by: apoc@laker.net (Adam Rogoyski) +Primary-site: sunsite.unc.edu /pub/Linux/apps/editors/terminal + 161 kb hexedit-0.9.7.tar.gz + 1 kb hexedit.lsm +Platforms: Unix like system with curses, DOS with pdcurses +Copying-policy: GPL +End + --- ncurses-hexedit-0.9.7.orig/README +++ ncurses-hexedit-0.9.7/README @@ -112,9 +112,9 @@ like the best thing to do here. Or else I'd be highlighting all the rest of the file. - Undo: for undo, if the modified byte is on the screen, it is reverted - to it's previous state. If it is not on the screen, you are brought + to its previous state. If it is not on the screen, you are brought to the byte's location so it is viewable on the screen. The next - Undo command will revert the byte back to it's previous state. + Undo command will revert the byte back to its previous state. - Environment variable HEXEDIT can be used to save your command line options. Example, export HEXEDIT=-8r would put hexedit into readonly mode with 8-bit printing on by default. @@ -124,7 +124,7 @@ - You currently can only edit files and disks up to 4.2 gigs. - On SunOS if you use control-v for page down you have to do it twice. This has to do with the terminal driver interpreting - Control-v for it's purposes. If there is a portable way to + Control-v for its purposes. If there is a portable way to changes this let me know. *** I've been informed that this is a normal terminal driver thingy. Still, how do I get around it? --- ncurses-hexedit-0.9.7.orig/docs/Makefile.am +++ ncurses-hexedit-0.9.7/docs/Makefile.am @@ -1,4 +1,4 @@ -info_TEXINFOS = hexedit.texinfo -man_MANS = hexedit.1 +#info_TEXINFOS = hexeditor.texinfo +#man_MANS = hexeditor.1 -EXTRA_DIST = hexedit.1 texinfo.tex +EXTRA_DIST = hexeditor.1 texinfo.tex --- ncurses-hexedit-0.9.7.orig/docs/hexeditor.info +++ ncurses-hexedit-0.9.7/docs/hexeditor.info @@ -0,0 +1,814 @@ +INFO-DIR-SECTION Editors +START-INFO-DIR-ENTRY +* hexeditor: (hexeditor.info). Binary ascii/ebcdic terminal hex editor. +END-INFO-DIR-ENTRY + +This is hexedit.info, produced by makeinfo version 4.0 from +hexeditor.texinfo. + + [N]Curses Hexedit Manual + + Copyright (C) 1999 Adam Rogoyski + + +File: hexedit.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) + +* Menu: + +* Introduction:: About hexedit, the author, and life in general. +* Getting Started:: Getting hexedit, compiling, running. +* Program Operations:: Program usage and commands. + + +File: hexedit.info, Node: Introduction, Next: Getting Started, Prev: Top, Up: Top + +Introduction +************ + +* Menu: + +* What is Hexedit:: Brief intro to the program. +* Copyright and License:: Terms of copying. +* Author:: Info about me. +* Feedback and Bugs:: When to contact me. +* Contributions:: Who's helped so far. + + +File: hexedit.info, Node: What is Hexedit, Next: Copyright and License, Up: Introduction + +What is Hexedit? +================ + + *hexedit* is a Curses based Hex editor. Unlike a text editor, which +is used for editing text documents in the desired language, *hexedit* +lets you edit any file as its byte(1) for byte representation. It can +even let you view and edit your fixed disks on your Linux system. This +is not ideal for writing a letter or writing c code, but there are my +times when this is ideal: + + * Editing binary executables. + + * Editing your fixed disks (i.e. /dev/hda) + + * Checking the output of a Program's binary data file. + + * Any place you might use od(1) but need more power. Compare more + vs less. + + * Any other time you find this useful (tell me). + + ---------- Footnotes ---------- + + (1) I assume a byte is an 8-bit octet. If this is not the case, I +really recommend NOT using this program. + + +File: hexedit.info, Node: Copyright and License, Next: Author, Prev: What is Hexedit, Up: Introduction + +Copyright and License +===================== + + *[N]Curses Hexedit* Copyright (C) 1998,1999 Adam Rogoyski +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as publish by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, +Inc., 675 Mass Ave, Cambridge, MA 02139, USA + + +File: hexedit.info, Node: Author, Next: Feedback and Bugs, Prev: Copyright and License, Up: Introduction + +Author +====== + + *[N]Curses Hexedit* was written by Adam Rogoyski(1)(2). At the time +of writting (December 1998) I am a Sophomore of Computer Science at the +University of Texas at Austin. I use Debian GNU/Linux and OpenBSD, I +enjoy playing electric guitar, and I currently reside Pflugerville, +Texas USA. My heroes are Richard Stallman, Stevie Ray Vaughan, and +Lisa Loeb. + + ---------- Footnotes ---------- + + (1) Email me at apoc@laker.net + + (2) There is a picture of me at http://profiles.yahoo.com/rogoyski/ + + +File: hexedit.info, Node: Feedback and Bugs, Next: Contributions, Prev: Author, Up: Introduction + +Feedback and Bugs +================= + + Astounding as it may be, there quite possibly are bugs in *hexedit*. +You can do your share to help Free Software(1) be robust and secure by +telling me about any problems you find. Patches are even better. +General feedback is appreciated as well, if only to tell me that +*hexedit* saved the day again, or that my obscure program wasted half +your day when you already knew how to use emacs (M-x hexl-mode) in the +first place. +I can be reached at _apoc@laker.net_ + + ---------- Footnotes ---------- + + (1) http://www.gnu.org/philosophy/free-sw.html + + +File: hexedit.info, Node: Contributions, Prev: Feedback and Bugs, Up: Introduction + +Contributions +============= + + The following people contributed valuable feedback and information + * John Gatewood Ham: Gave some tips for the documentation. + + * Cort (unknown): Idea for Undo. + + * Matt Noel: EBCDIC support and spacing. Countless suggestions and + ideas. + + * Everyone else who mailed me and told me things that broke and gave + suggestions. + + +File: hexedit.info, Node: Getting Started, Next: Program Operations, Prev: Introduction, Up: Top + +Getting Started +*************** + +* Menu: + +* Obtaining Source:: Where to find hexedit. +* Obtaining Binaries:: Where to find binaries. +* Building from Source:: What to do to build hexedit. +* Command Line Invocation:: starting from the shell. + + +File: hexedit.info, Node: Obtaining Source, Next: Obtaining Binaries, Up: Getting Started + +Obtaining Source +================ + + The latest source tar'd and gzip'd can be obtained at +_http://ccwf.cc.utexas.edu/~apoc/programs/c/hexedit/_ +and also from everyone's favorite ftp site +_ftp://metalab.unc.edu/pub/Linux/apps/editors/terminal/_ +If you do not know what tar and gzip are, and are using a DOS derived +OS, *Note Obtaining Binaries::. + + +File: hexedit.info, Node: Obtaining Binaries, Next: Building from Source, Prev: Obtaining Source, Up: Getting Started + +Obtaining Binaries +================== + + Pre-compiled statically linked binaries can be obtained for the +following operating systems: i386 Linux, i386 OpenBSD, and DOS. The +location for these is: +_http://ccwf.cc.utexas.edu/~apoc/programs/c/hexedit/_ + + I've Built and tested hexedit on the following platforms: + + * Linux 2.0.36 i386 ncurses 4.2 (gcc) + + * Linux 2.2.6 i386 ncurses 4.2 (gcc) + + * OpenBSD 2.4 i386 ncurses (gcc) + + * SunOS 5.6 Sparc curses (gcc) + + * AIX 4.3.2 rs6000 curses (gcc and cc) + + * AIX 4.3.2 ppc curses (gcc and cc) + + * DOS 6.22 i386 pdcurses (djgpp gcc) + + * IRIX 6.3 mips curses (gcc) + + * HP-UX B.10.20 curses (gcc) + + * SunOS 5.5.1 sparc curses (gcc) + + * OSF V4.0 alpha curses (gcc) + + +File: hexedit.info, Node: Building from Source, Next: Command Line Invocation, Prev: Obtaining Binaries, Up: Getting Started + +Building from Source +==================== + + Building from source should be very strait forward. I used the GNU +configure system (autoconf and automake) so, like any GNU compliant +program, the sequence + ./configure + make + make install + should be all that's needed to install the package. Additional +options may need to be given to configure, check INSTALL for such +options. + +i386 Linux +---------- + + I extremely recommend you upgrade to ncurses 4.2 for hexedit to +work. It should work with all versions, but resizing in an xterm seems +to work better with the newest release. The latest ncurses can be +obtained at the nearest GNU ftp archive (or ftp://ftp.gnu.org/pub/gnu/). + +i386 OpenBSD +------------ + + OpenBSD 2.4 I believe comes with ncurses, and it worked fine at my +end. + +rs/6000 AIX 4.3 +--------------- + + I belive I've fixed the previous AIX problems I was having. Let me +know if anything else turns up. + + +File: hexedit.info, Node: Command Line Invocation, Prev: Building from Source, Up: Getting Started + +Command Line Invocation +======================= + + Basic program usage is as follows: + *hexedit* [_flags_] [_filename_] + +Where filename is the file which you wish to edit. Additionally, +starting the program with no file + *hexedit* [_flags_] + +will bring up the file selection widget which will allow you to browse +for the file. The command line arguments which are supported are +-h, -help Prints help. +-8, -highbit Allows displaying of high order bit text. +-a, -alltext Allows displaying of all text (probably bad idea). +-b, -buffer Buffer the entire file into memory. +-d, -disk View a fixed disk (Linux only). +-f, -force Allow editing of disk (Linux only). +-q, -quiet No Beeping! +-r, -readonly Prevents modifying the file. +-v, -version Prints version number. +Defaults may be specified in the HEXEDIT environment variable, i.e. +sh: _export HEXEDIT=-8r_ +csh: _setenv HEXEDIT=-8r_ + +File: hexedit.info, Node: Program Operations, Prev: Getting Started, Up: Top + +Program Operations +****************** + +* Menu: + +* Choosing a file:: How to select a file to edit. +* Choosing a fixed disk:: How to select a fixed disk to view/edit. +* Windows:: Descriptions of the various windows. +* Moving About:: How to traverse the file. +* Editing:: Editing procedures. +* Undo:: Fixing mistakes. +* Searching:: Locating specific strings. +* Quit:: Exiting the editor. +* Save:: Commiting changes to disk. +* Save and Quit:: Commiting changes with exit. +* Redraw:: Refreshing the screen. +* View as Text:: Take an text snapshot of offset. +* Ascii <=> EBCDIC:: Switch between text representations +* Switch Spacings:: Change the way the bytes are grouped +* Binary Calculator:: Base conversions. +* Help:: Accessing online help. + + +File: hexedit.info, Node: Choosing a file, Next: Choosing a fixed disk, Up: Program Operations + +Choosing a file +=============== + + Before editing can begin, you much select a file to edit. This can +be done on the command line: + hexedit filename + Quite possibly, you may not remember the location of the file you +wish to edit, or you may wish to browse over many possible files +availible to find the file you are looking for. Hexedit comes equipted +with a full screen file/directory browser which enables you to specify +the file you wish to edit. Not specifying any file on the command line: + hexedit + will bring up the file selection browser. Choosing (pressing enter) +a directory will open that directory for viewing. Choosing a file will +open that file in the editor. + + +File: hexedit.info, Node: Choosing a fixed disk, Next: Windows, Prev: Choosing a file, Up: Program Operations + +Choosing a fixed disk. +====================== + + Hexedit, when run in Linux, permits access to read and edit fixed +disks (i.e /dev/hda). Using the _-d_ option will allow you to edit a +disk. Currently, the disk can be only up to 4.2 gigs, but this will +probably change in a future release. +By default, editing a disk will put you in read-only mode. This is for +your own protection. If you really think you know what you are doing, +issue the _-f_ flag and it will force edit mode for the disk and allow +you to make changes to your disk. Use this with *EXTREME CAUTION!* If +you make a mistake to your boot sector, erase a few important inodes, +or hit the wrong keystroke, you could be seriously out of luck. It is +really easy to put your disk in an unusable state. Also, remember that +the disk could very well be changing as you look at it. So the next +time you view a chunk, it may be different, or even the chunk you are +currently viewing may have changed on disk since you read it into the +editor's buffer. So be careful if you want to edit a mounted disk. +To put this in another way, if you don't know exactly why you would +want to use this option, _Never Use It!_ *IMPORTANT*: Never use this +in conjunction with the _-b_ option to buffer the entier file into +memory. I will leave it to you to think why this would be bad. + + +File: hexedit.info, Node: Windows, Next: Moving About, Prev: Choosing a fixed disk, Up: Program Operations + +Windows +======= + + The screen is made up of three windows, the *Status* window, the +*Main* window, and the *Help* window. A typical view would look +something like this. + File: data.dat ASCII Offset: 0x00004250 / 0x000096BB (%44) + 00004200 55 89 E5 53 8b 5D 08 A1 A8 0D 05 08 39 05 AC 0D U..S.]......9... + 00004210 05 08 0F 8C 8C 00 00 00 05 00 04 00 00 A3 A8 0D ................ + 00004220 05 08 C1 E0 02 50 A1 B0 0D 05 08 50 E8 4B CB FF .....P.....P.K.. + . + . + etc + . + . + ^G Help ^C Exit (No Save) ^T goTo Offset ^X Exit and Save ^W Search + + And so on. + +Status Window +------------- + + The Status Window is the first line of the screen. At all times, it +conveys the following information + * *Filename* which you are working on + + * *Character Set* which you are using, ASCII or EBCDIC + + * *Current Offset* which you are at + + * *Size* of file + + * *Percent*age way through the file + + * *Modified Flag*: A M in the upper right corner signals + that the file has been modified + since last save, or that the file is read-only + + It typically looks like this + File: data.dat ASCII Offset: 0x00004250 / 0x000096BB (%44) + +Main Window +----------- + + The Main Window is the bulk of your view. It is where all viewing +and editing of the file takes place. All cursor operations and +movements take place within this window. Operations within the Main +Window are described in detail in section *Note Moving About:: + + The Main Window is broken up vertically into three columns of +information. The first column from the left is the base offset(1) +which represents the offset of the first byte of that row in the Data +column. + + The second column is the Data column, where the Hexadecimal +representation of each byte of the file is listed. Each row consists +of 16 bytes, seperated into 2 columns of 8 bytes, each seperated into +columns of 4 bytes. A typical row looks like: (third column not shown) + 00004280 50 E8 A6 CA FF FF E8 41 CA FF FF 68 90 F5 04 08 + + The third column of the main window is the text representation on +that row's bytes. Non printable characters are represented as a "." +dot. + +Help Window +----------- + + The Help Window is the friendly reminder of basic commands within +the editor. It cannot be removed. + +Popup Windows +------------- + + Various commands may bring up a Popup Window. This is a smaller +window centered in the Main Window. Various operations, such as +Searching, Jumping to another offset, saving, etc. require their own +window, and will "Pop" one up. _Escape_, _Control-X_, and _Control-G_ +can be used to cancel most Popup Windows. + + ---------- Footnotes ---------- + + (1) All offsets are in Hexadecimal (base16) + + +File: hexedit.info, Node: Moving About, Next: Editing, Prev: Windows, Up: Program Operations + +Moving About +============ + + Moving about the file is done through the full screen terminal +interface. Operations were meant to be easy to learn and comfortable +to use. + +Hex <=> Text (Tab) +------------------ + + The Main Window is composed of the hex and text representation of +the file. The cursor may be moved from one to the other by use of +*Tab* or *Control-I*(1). Being on the Hex representation will be +called Hex Mode, with being on the text representation Text Mode. + +Arrow Keys +---------- + + The arrow keys are the basic way to move about the file. In Hex +Mode, left and right shift you four bits in the file. Going right, you +could move to the lower 4 bits of the current byte (b & 0x0F), or move +to the higher 4 bits of the next byte (b & 0xF0). Left can bring you +either to the higher 4 bits of the current byte, or to the lower bits +of the previous byte. Up and Down move you 16 bytes (offset +- 0x10) +through the file(2). + + In Text Mode, left and right always move you one byte, with Up and +Down moving you 16 bytes. + +Jumping +------- + + From your current offset, you can jump to an offset relative to +where you are. With the cursor in the hex data area, Pressing _+_ or +_-_ will bring up a entry box in the help window, in which you can type +in the amount to jump. Depending on whether you did a plus or minus, +you will traverse to *current offset* _+|-_ *value*. After the first +jump, you can use the _n_ key to continue to jump by that offset a +multitude of times. + +Misc +---- + + The following keys function as you'd expect them to + * _Page Up_ (also _Control-Y_, _Control-B_, _Alt-V_, _u_, + _y_) + + * _Page Down_ (also _Control-F_, _Control-V_, _space_, _v_) + + * _Home_ + + * _End_ + +GoTo Offset +----------- + + At any time, you may jump to a specific offset of the file with +_Control-T_ or _t_. This will bring up a Popup Window which will +prompt you to enter the new file offset. The new offset may be given in +decimal(3), octal(4), or hex(5). + + Note, the default value will be 0, permitting a fast way to jump to +the begining of the file. + + ---------- Footnotes ---------- + + (1) Control-X signifies holding down the control key and hitting X + + (2) This isn't always true if you are near the end of the file + + (3) Decimal numbers are base10, ex: 255 + + (4) Octal numbers are base8, prefixed by a 0, ex: 0377 + + (5) Hex numbers are base16, prefixed by 0x, ex: 0xFF + + +File: hexedit.info, Node: Editing, Next: Undo, Prev: Moving About, Up: Program Operations + +Editing +======= + + Editing is the primary(1) function of the editor. + +Modifying Bytes +--------------- + +Hex Mode +........ + + In this mode, Characters 0-9 and A-F may be used to change the +current byte. All other characters are ignored. + +Text Mode +......... + + In this mode, any printable character may be used to change the +current byte. + +Insert +------ + + Insert allows you to, inplace, insert a new byte of data into the +file, thus increasing the size of the file by one byte. The new byte +is always equal to zero until you modify it. Insert is done through +the _Insert_ key or _Control-A_. Insert is only enabled if you use the +_-b_ option to buffer the entire file into memory. This is not +something I will consider changing. If you want to modify your copy to +allow this, best of luck to you. Insert cannot work on disks either. + + To simulate appending a byte to the end of the file, Jump to the end +of the file, and insert a byte. This will have pushed the last byte +over one. Copy the value of that byte to the new zero'd byte. Now +zero the last byte. + +Delete +------ + + Delete allows you to delete the current byte, shifting the remainder +of the file back one, thus decreasing the size of the file by one byte. +Delete is done through the _Delete_ key or _Control-D_. Delete will +only work if you use the _-b_ option to buffer the entire file into +memory. Same as with Insert, this is not going to change in a future +release. Usually, you can use dd(1) to get the part of the file/disk +you want, insert and delete on that to your heart's content, and then +dd that back to the file/disk. + + If there is only one byte in the file, Delete will zero the byte, +but you cannot reduce the file to zero bytes(2) + + ---------- Footnotes ---------- + + (1) This would make viewing the secondary function, perhaps. + + (2) I recommend rm(1) for this + + +File: hexedit.info, Node: Undo, Next: Searching, Prev: Editing, Up: Program Operations + +Undo +==== + + While editing a file, it is quite likely that you may make a +mistake(1). To facilitate this, an extensive Undo command has been +implemented on your behalf. _Control-U_ Undoes the previous change to +the file. The editor keeps track of all modifications, insertions, and +deletions. What this means is that at any time you can, if you wish, +revert the file back to its original state by a series of Undo's. + + If you do _Control-U_ and the last changed byte is currently viewable +in the Main Window, then the cursor will relocate to that byte and +revert it to its previous state. If the last changed byte is not +currently viewable, the currently viewable area will shift so that the +changed byte is viewable. In other words, you will be relocated to +that part of the file, with the cursor on that byte at that offset. +The Byte WILL NOT be Un-done. Another _Control-U_ will now undo the +change(2). + + ---------- Footnotes ---------- + + (1) Or a typo, if you prefer + + (2) This is probably worded poorly, but it's easy to see what I mean +when you try it + + +File: hexedit.info, Node: Searching, Next: Quit, Prev: Undo, Up: Program Operations + +Searching +========= + + Searching allows you to quickly(1) locate a specific sequence of +characters or bytes in the file. _Control-W_ or _w_ brings up a Popup +Window giving you the options of Find Next (_N_), Search for text +string (_A_), and Search for Hex bytes (_H_). + +Search for Text String +---------------------- + + This options allows you to search for specific character strings of +text. Spaces are allowed. + +Search for Hex Bytes +-------------------- + + This options allows you to search for a specific string of bytes in +the file. The Popup Window has an entry box, which accepts a sequence +of bytes in Hex (0-9, A-F), while it shows the text representation of +those bytes above. Non printable characters are shown as "." dot. + +Find Next +--------- + + This options allows you to find the next occurence of the previous +search (text or Hex). This option is not availible until after your +first search is completed. + + This options is bound to _Control-N_ to allow quickly locating the +next match. + + ---------- Footnotes ---------- + + (1) The fast Boyer-Moore algorithm is used + + +File: hexedit.info, Node: Quit, Next: Save, Prev: Searching, Up: Program Operations + +Quit +==== + + Quiting without prompting to save is done by _Control-C_. It will +bring up a Popup Window to make sure of your decision to quit the +program. + + +File: hexedit.info, Node: Save, Next: Save and Quit, Prev: Quit, Up: Program Operations + +Save +==== + + To save the file at any time with the currently made changes is done +with _Control-O_(1). The file may be saved over the current file(2), +or you may save the file as a new or different file. In the event of +an error or inability to save, you will be given the standard(3) error +message in the Popup Window. + + ---------- Footnotes ---------- + + (1) On OpenBSD and a few other OS's, This keystroke does not seem to +work. It has something to do with the terminal using it + + (2) This isn't always possible. One place is in DOS if you try to +save over the executable currently being ran + + (3) perror (filename) + + +File: hexedit.info, Node: Save and Quit, Next: Redraw, Prev: Save, Up: Program Operations + +Save and Quit +============= + + To exit the program, saving the file as you go, use _Control-X_. If +the file has not been modified since the last save, the program will +exit without saving. If the file has been modified, you will be +prompted for the filename to save to, which may be different than the +current filename. In the event of an error or inability to save, you +will be given the standard error message in the Popup Window, and the +program will resume operations without terminating. + + +File: hexedit.info, Node: Redraw, Next: View as Text, Prev: Save and Quit, Up: Program Operations + +Redraw +====== + + In the event that the terminal becomes unreadable, or for any other +reason, the screen may be redrawn with _Control-L_. This will only +erase and redraw the screen. If the terminal needs to be reset(1), the +terminal will still need to be reset. + + ---------- Footnotes ---------- + + (1) By '/bin/echo "\033c"' perhaps + + +File: hexedit.info, Node: View as Text, Next: Ascii <=> EBCDIC, Prev: Redraw, Up: Program Operations + +View as Text +============ + + If at any time, you would like to see what the current file looks +like as an text dump, _Control-E_ will let you. Note: This feature was +intended for files which are mostly made up of text. I implemented +this by traveling back to the previous new line so that the text would +be aligned how it would be in a text editor. Because of this, in a +file without any new lines for a long time, you may not be able to view +certain parts of the file in this mode. I do not see this as a +problem, and I can recommend some really nice text editors for you if +you disagree. Just don't use this function(1). + + This feature was meant to just show you a snapshot of the current +section as text. That's all it does, that's all it will do. + + ---------- Footnotes ---------- + + (1) Don't use this function. Never use it. I don't. + + +File: hexedit.info, Node: Ascii <=> EBCDIC, Next: Switch Spacings, Prev: View as Text, Up: Program Operations + +Ascii <=> EBCDIC +================ + + Some old IBM mainframes use EBCDIC instead of the ASCII character +set. To switch between which way the text is represented, _Control-R_ +will switch it. If you don't know what this is, you probably should +not use it. + + +File: hexedit.info, Node: Switch Spacings, Next: Binary Calculator, Prev: Ascii <=> EBCDIC, Up: Program Operations + +Switch Spacings +=============== + + Some people like having spaces between each byte, and between each 8 +bytes: + 04 30 40 23 23 43 23 54 23 48 83 29 23 12 00 45 + Some people like having the bytes grouped into four byte words: + 04304023 23432354 23488329 23120045 + To select which way you'd like to view the file as, use _Control-P_ +to switch the spacings around to the way you like it. + + +File: hexedit.info, Node: Binary Calculator, Next: Help, Prev: Switch Spacings, Up: Program Operations + +Binary Calculator +================= + + A binary calculator is included which will let you convert between +base2, base8, base10, and base16 easily. This can be brought up with +_Control-+_. Currently, this doesn't have all the features I'd like to +spend the time to put into it, but it still is quite useful. + + Currently, all numbers in the calculator are represented in the +machines default signed Integer size, a size which will be displayed in +the status window. This means that most likely setting the highest bit +will lead to a negative number. If I get time, unsigned ints as well +as indefinite precision, and arithmetic functions will be added. + + +File: hexedit.info, Node: Help, Prev: Binary Calculator, Up: Program Operations + +Help +==== + + At any time, _Control-G_ may be used to get a list of commands for +the editor. The Help Window will also list some commonly used commands. + + + +Tag Table: +Node: Top146 +Node: Introduction410 +Node: What is Hexedit788 +Ref: What is Hexedit-Footnote-11615 +Node: Copyright and License1727 +Node: Author2600 +Ref: Author-Footnote-13125 +Ref: Author-Footnote-23160 +Node: Feedback and Bugs3232 +Ref: Feedback and Bugs-Footnote-13875 +Node: Contributions3926 +Node: Getting Started4389 +Node: Obtaining Source4736 +Node: Obtaining Binaries5181 +Node: Building from Source6136 +Node: Command Line Invocation7211 +Node: Program Operations8251 +Node: Choosing a file9096 +Node: Choosing a fixed disk9895 +Node: Windows11351 +Ref: Windows-Footnote-114433 +Node: Moving About14481 +Ref: Moving About-Footnote-116741 +Ref: Moving About-Footnote-216812 +Ref: Moving About-Footnote-316879 +Ref: Moving About-Footnote-416923 +Ref: Moving About-Footnote-516982 +Node: Editing17039 +Ref: Editing-Footnote-118902 +Ref: Editing-Footnote-218967 +Node: Undo19002 +Ref: Undo-Footnote-120051 +Ref: Undo-Footnote-220084 +Node: Searching20173 +Ref: Searching-Footnote-121313 +Node: Quit21360 +Node: Save21608 +Ref: Save-Footnote-122063 +Ref: Save-Footnote-222193 +Ref: Save-Footnote-322309 +Node: Save and Quit22335 +Node: Redraw22930 +Ref: Redraw-Footnote-123336 +Node: View as Text23375 +Ref: View as Text-Footnote-124280 +Node: Ascii <=> EBCDIC24338 +Node: Switch Spacings24712 +Node: Binary Calculator25237 +Node: Help26005 + +End Tag Table --- ncurses-hexedit-0.9.7.orig/docs/Makefile.in +++ ncurses-hexedit-0.9.7/docs/Makefile.in @@ -10,6 +10,9 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +#info_TEXINFOS = hexeditor.texinfo +#man_MANS = hexeditor.1 + SHELL = @SHELL@ @@ -62,21 +65,10 @@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ -info_TEXINFOS = hexedit.texinfo -man_MANS = hexedit.1 - -EXTRA_DIST = hexedit.1 texinfo.tex +EXTRA_DIST = hexeditor.1 texinfo.tex mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = -TEXI2DVI = texi2dvi -INFO_DEPS = hexedit.info -DVIS = hexedit.dvi -TEXINFOS = hexedit.texinfo -man1dir = $(mandir)/man1 -MANS = $(man_MANS) - -NROFF = nroff DIST_COMMON = Makefile.am Makefile.in texinfo.tex @@ -86,170 +78,13 @@ GZIP_ENV = --best all: all-redirect .SUFFIXES: -.SUFFIXES: .dvi .info .ps .texi .texinfo .txi $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps docs/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -hexedit.info: hexedit.texinfo -hexedit.dvi: hexedit.texinfo - - -DVIPS = dvips - -.texi.info: - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) `echo $< | sed 's,.*/,,'` - -.texi.dvi: - TEXINPUTS=.:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.texi: - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) `echo $< | sed 's,.*/,,'` - -.texinfo.info: - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) `echo $< | sed 's,.*/,,'` - -.texinfo: - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) `echo $< | sed 's,.*/,,'` - -.texinfo.dvi: - TEXINPUTS=.:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.txi.info: - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) `echo $< | sed 's,.*/,,'` - -.txi.dvi: - TEXINPUTS=.:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.txi: - @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] - cd $(srcdir) \ - && $(MAKEINFO) `echo $< | sed 's,.*/,,'` -.dvi.ps: - $(DVIPS) $< -o $@ - -install-info-am: $(INFO_DEPS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(infodir) - @list='$(INFO_DEPS)'; \ - for file in $$list; do \ - d=$(srcdir); \ - for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ - if test -f $$d/$$ifile; then \ - echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ - $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ - else : ; fi; \ - done; \ - done - @$(POST_INSTALL) - @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ - list='$(INFO_DEPS)'; \ - for file in $$list; do \ - echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ - install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ - done; \ - else : ; fi - -uninstall-info: - $(PRE_UNINSTALL) - @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ - ii=yes; \ - else ii=; fi; \ - list='$(INFO_DEPS)'; \ - for file in $$list; do \ - test -z "$ii" \ - || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ - done - @$(NORMAL_UNINSTALL) - list='$(INFO_DEPS)'; \ - for file in $$list; do \ - (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ - done - -dist-info: $(INFO_DEPS) - list='$(INFO_DEPS)'; \ - for base in $$list; do \ - d=$(srcdir); \ - for file in `cd $$d && eval echo $$base*`; do \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file; \ - done; \ - done - -mostlyclean-aminfo: - -rm -f hexedit.aux hexedit.cp hexedit.cps hexedit.dvi hexedit.fn \ - hexedit.fns hexedit.ky hexedit.kys hexedit.ps hexedit.log \ - hexedit.pg hexedit.toc hexedit.tp hexedit.tps hexedit.vr \ - hexedit.vrs hexedit.op hexedit.tr hexedit.cv hexedit.cn - -clean-aminfo: - -distclean-aminfo: - -maintainer-clean-aminfo: - cd $(srcdir) && for i in $(INFO_DEPS); do \ - rm -f $$i; \ - if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ - rm -f $$i-[0-9]*; \ - fi; \ - done - -install-man1: - $(mkinstalldirs) $(DESTDIR)$(man1dir) - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ - done - -uninstall-man1: - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ - rm -f $(DESTDIR)$(man1dir)/$$inst; \ - done -install-man: $(MANS) - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-man1 -uninstall-man: - @$(NORMAL_UNINSTALL) - $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 tags: TAGS TAGS: @@ -259,20 +94,24 @@ subdir = docs distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu docs/Makefile @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done - $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info -info-am: $(INFO_DEPS) +info-am: info: info-am -dvi-am: $(DVIS) +dvi-am: dvi: dvi-am check-am: all-am check: check-am @@ -281,20 +120,19 @@ install-exec-am: install-exec: install-exec-am -install-data-am: install-info-am install-man +install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am -uninstall-am: uninstall-info uninstall-man +uninstall-am: uninstall: uninstall-am -all-am: Makefile $(INFO_DEPS) $(MANS) +all-am: Makefile all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: - $(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(mandir)/man1 mostlyclean-generic: @@ -306,33 +144,30 @@ -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -mostlyclean-am: mostlyclean-aminfo mostlyclean-generic +mostlyclean-am: mostlyclean-generic mostlyclean: mostlyclean-am -clean-am: clean-aminfo clean-generic mostlyclean-am +clean-am: clean-generic mostlyclean-am clean: clean-am -distclean-am: distclean-aminfo distclean-generic clean-am +distclean-am: distclean-generic clean-am distclean: distclean-am -maintainer-clean-am: maintainer-clean-aminfo maintainer-clean-generic \ - distclean-am +maintainer-clean-am: maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am -.PHONY: install-info-am uninstall-info mostlyclean-aminfo \ -distclean-aminfo clean-aminfo maintainer-clean-aminfo install-man1 \ -uninstall-man1 install-man uninstall-man tags distdir info-am info \ -dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ -install-exec install-data-am install-data install-am install \ -uninstall-am uninstall all-redirect all-am all installdirs \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-am install-data install-am install uninstall-am uninstall \ +all-redirect all-am all installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. --- ncurses-hexedit-0.9.7.orig/docs/hexeditor.texinfo +++ ncurses-hexedit-0.9.7/docs/hexeditor.texinfo @@ -0,0 +1,643 @@ +\input texinfo @c -*-texinfo-*- +@c %**start of header +@setfilename hexedit.info +@settitle Ncurses Hexedit +@c %**end of header + + +@ifinfo +[N]Curses Hexedit Manual + +Copyright (C) 1999 Adam Rogoyski +@end ifinfo + +@titlepage +@title [N]Curses Hexedit +@subtitle The hexedit manual +@author Adam Rogoyski + +@page +@vskip 0pt plus 1filll +Copyright @copyright{} 1999 Adam Rogoyski + +Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided that the entire +resulting derived work is distributed under the terms of a permission +notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified version, +except that this permission notice may be stated in a translation approved +by the Free Software Foundation. + +@end titlepage + +@node Top, Introduction, (dir), (dir) + +@menu +* Introduction:: About hexedit, the author, and life in general. +* Getting Started:: Getting hexedit, compiling, running. +* Program Operations:: Program usage and commands. +@end menu + + + + +@node Introduction, Getting Started, Top, Top +@chapter Introduction + +@menu +* What is Hexedit:: Brief intro to the program. +* Copyright and License:: Terms of copying. +* Author:: Info about me. +* Feedback and Bugs:: When to contact me. +* Contributions:: Who's helped so far. +@end menu + + +@node What is Hexedit, Copyright and License, , Introduction +@section What is Hexedit? + + +@strong{hexedit} is a Curses based Hex editor. +Unlike a text editor, which is used for editing text documents in the desired language, +@strong{hexedit} lets you edit any file as its byte@footnote{I assume a byte is an 8-bit +octet. If this is not the case, I really recommend NOT using this program.} +for byte representation. It can even let you view and edit your fixed disks on your Linux +system. This is not ideal for writing a letter or writing c code, but +there are my times when this is ideal: + +@itemize @bullet +@item +Editing binary executables. +@item +Editing your fixed disks (i.e. /dev/hda) +@item +Checking the output of a Program's binary data file. +@item +Any place you might use od(1) but need more power. Compare more vs less. +@item +Any other time you find this useful (tell me). +@end itemize + + +@node Copyright and License, Author, What is Hexedit, Introduction +@section Copyright and License +@strong{[N]Curses Hexedit} Copyright @copyright{} 1998,1999 Adam Rogoyski @* +@ @* +This program is free software; you can redistribute it and/or modify it under the terms of the GNU +General Public License as publish by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version.@* +@ @* +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +License for more details.@* +@ @* +You should have received a copy of the GNU General Public License along with this program; if not, +write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA + + +@node Author, Feedback and Bugs, Copyright and License, Introduction +@section Author +@strong{[N]Curses Hexedit} was written by Adam Rogoyski@footnote{Email me at +apoc@@laker.net}@footnote{There is a picture of me at http://profiles.yahoo.com/rogoyski/}. +At the time of writting (December 1998) I am a Sophomore of Computer Science at the University of +Texas at Austin. I use Debian GNU/Linux and OpenBSD, I enjoy playing electric guitar, and +I currently reside Pflugerville, Texas USA. My heroes are Richard +Stallman, Stevie Ray Vaughan, and Lisa Loeb. + + +@node Feedback and Bugs, Contributions, Author, Introduction +@section Feedback and Bugs +Astounding as it may be, there quite possibly are bugs in @strong{hexedit}. You can do your +share to help Free Software@footnote{http://www.gnu.org/philosophy/free-sw.html} be robust +and secure by telling me about any problems you find. Patches are even better. General +feedback is appreciated as well, if only to tell me that @strong{hexedit} saved the day +again, or that my obscure program wasted half your day when you already knew how to use +emacs (M-x hexl-mode) in the first place.@* +@ @* + I can be reached at @emph{apoc@@laker.net} + + +@node Contributions, , Feedback and Bugs, Introduction +@section Contributions +The following people contributed valuable feedback and information +@itemize @bullet +@item +John Gatewood Ham: Gave some tips for the documentation. +@item +Cort (unknown): Idea for Undo. +@item +Matt Noel: EBCDIC support and spacing. Countless suggestions and ideas. +@item +Everyone else who mailed me and told me things that broke and gave suggestions. +@end itemize + + + +@node Getting Started, Program Operations, Introduction, Top +@chapter Getting Started + +@menu +* Obtaining Source:: Where to find hexedit. +* Obtaining Binaries:: Where to find binaries. +* Building from Source:: What to do to build hexedit. +* Command Line Invocation:: starting from the shell. +@end menu + + + +@node Obtaining Source, Obtaining Binaries, , Getting Started +@section Obtaining Source +The latest source tar'd and gzip'd can be obtained at@* +@emph{http://ccwf.cc.utexas.edu/~apoc/programs/c/hexedit/}@* +and also from everyone's favorite ftp site@* +@emph{ftp://metalab.unc.edu/pub/Linux/apps/editors/terminal/}@* +If you do not know what tar and gzip are, and are using a DOS derived OS, +@xref{Obtaining Binaries}. + + +@node Obtaining Binaries, Building from Source, Obtaining Source, Getting Started +@section Obtaining Binaries +Pre-compiled statically linked binaries can be obtained for the following +operating systems: i386 Linux, i386 OpenBSD, and DOS. +The location for these is:@* +@emph{http://ccwf.cc.utexas.edu/~apoc/programs/c/hexedit/} + +I've Built and tested hexedit on the following platforms: + +@itemize @bullet +@item +Linux 2.0.36 i386 ncurses 4.2 (gcc) + +@item +Linux 2.2.6 i386 ncurses 4.2 (gcc) + +@item +OpenBSD 2.4 i386 ncurses (gcc) + +@item +SunOS 5.6 Sparc curses (gcc) + +@item +AIX 4.3.2 rs6000 curses (gcc and cc) + +@item +AIX 4.3.2 ppc curses (gcc and cc) + +@item +DOS 6.22 i386 pdcurses (djgpp gcc) + +@item +IRIX 6.3 mips curses (gcc) + +@item +HP-UX B.10.20 curses (gcc) + +@item +SunOS 5.5.1 sparc curses (gcc) + +@item +OSF V4.0 alpha curses (gcc) +@end itemize + + +@node Building from Source, Command Line Invocation, Obtaining Binaries, Getting Started +@section Building from Source +Building from source should be very strait forward. I used the GNU +configure system (autoconf and automake) so, like any GNU compliant program, +the sequence +@example + ./configure + make + make install +@end example +should be all that's needed to install the package. Additional options may +need to be given to configure, check INSTALL for such options. + + +@subsection i386 Linux +I extremely recommend you upgrade to ncurses 4.2 for hexedit to work. It should +work with all versions, but resizing in an xterm seems to work better with the +newest release. The latest ncurses can be obtained at the nearest GNU ftp archive +(or ftp://ftp.gnu.org/pub/gnu/). + + +@subsection i386 OpenBSD +OpenBSD 2.4 I believe comes with ncurses, and it worked fine at my end. + +@subsection rs/6000 AIX 4.3 +I belive I've fixed the previous AIX problems I was having. Let me know if +anything else turns up. + + +@node Command Line Invocation, , Building from Source, Getting Started +@section Command Line Invocation +Basic program usage is as follows:@* +@example +@strong{hexedit} [@emph{flags}] [@emph{filename}]@* +@end example +Where filename is the file which you wish to edit. Additionally, starting the program +with no file@* +@example +@strong{hexedit} [@emph{flags}]@* +@end example +will bring up the file selection widget which will allow you to browse +for the file. The command line arguments which are supported are@* + + -h, --help Prints help.@* + -8, --highbit Allows displaying of high order bit text.@* + -a, --alltext Allows displaying of all text (probably bad idea).@* + -b, --buffer Buffer the entire file into memory.@* + -d, --disk View a fixed disk (Linux only).@* + -f, --force Allow editing of disk (Linux only).@* + -q, --quiet No Beeping!@* + -r, --readonly Prevents modifying the file.@* + -v, --version Prints version number.@* +@* + +Defaults may be specified in the HEXEDIT environment variable, i.e.@* + + sh: @emph{export HEXEDIT=-8r}@* + csh: @emph{setenv HEXEDIT=-8r}@* + + +@node Program Operations, , Getting Started, Top +@chapter Program Operations + + +@menu +* Choosing a file:: How to select a file to edit. +* Choosing a fixed disk:: How to select a fixed disk to view/edit. +* Windows:: Descriptions of the various windows. +* Moving About:: How to traverse the file. +* Editing:: Editing procedures. +* Undo:: Fixing mistakes. +* Searching:: Locating specific strings. +* Quit:: Exiting the editor. +* Save:: Commiting changes to disk. +* Save and Quit:: Commiting changes with exit. +* Redraw:: Refreshing the screen. +* View as Text:: Take an text snapshot of offset. +* Ascii <=> EBCDIC:: Switch between text representations +* Switch Spacings:: Change the way the bytes are grouped +* Binary Calculator:: Base conversions. +* Help:: Accessing online help. +@end menu + + + +@node Choosing a file, Choosing a fixed disk, , Program Operations +@section Choosing a file +Before editing can begin, you much select a file to edit. This can be done on the +command line: +@example + hexedit filename +@end example +Quite possibly, you may not remember the location of the file you wish to edit, or you +may wish to browse over many possible files availible to find the file you are looking +for. Hexedit comes equipted with a full screen file/directory browser which enables you +to specify the file you wish to edit. Not specifying any file on the command line: +@example + hexedit +@end example +will bring up the file selection browser. Choosing (pressing enter) a directory will open +that directory for viewing. Choosing a file will open that file in the editor. + + + +@node Choosing a fixed disk, Windows, Choosing a file, Program Operations +@section Choosing a fixed disk. +Hexedit, when run in Linux, permits access to read and edit fixed disks (i.e /dev/hda). +Using the @emph{-d} option will allow you to edit a disk. Currently, the disk can be +only up to 4.2 gigs, but this will probably change in a future release.@* + By default, editing a disk will put you in read-only mode. This is for your own +protection. If you really think you know what you are doing, issue the @emph{-f} flag +and it will force edit mode for the disk and allow you to make changes to your disk. +Use this with @strong{EXTREME CAUTION!} If you make a mistake to your boot sector, +erase a few important inodes, or hit the wrong keystroke, you could be seriously out +of luck. It is really easy to put your disk in an unusable state. Also, remember that +the disk could very well be changing as you look at it. So the next time you view a +chunk, it may be different, or even the chunk you are currently viewing may have changed +on disk since you read it into the editor's buffer. So be careful if you want to edit +a mounted disk.@* + To put this in another way, if you don't know exactly why you would want to use +this option, @emph{Never Use It!} @strong{IMPORTANT}: Never use this in conjunction +with the @emph{-b} option to buffer the entier file into memory. I will leave it to +you to think why this would be bad. + + + +@node Windows, Moving About, Choosing a fixed disk, Program Operations +@section Windows +The screen is made up of three windows, the @strong{Status} window, the @strong{Main} +window, and the @strong{Help} window. A typical view would look something like this. +@example +File: data.dat ASCII Offset: 0x00004250 / 0x000096BB (%44) +00004200 55 89 E5 53 8b 5D 08 A1 A8 0D 05 08 39 05 AC 0D U..S.]......9... +00004210 05 08 0F 8C 8C 00 00 00 05 00 04 00 00 A3 A8 0D ................ +00004220 05 08 C1 E0 02 50 A1 B0 0D 05 08 50 E8 4B CB FF .....P.....P.K.. + . + . + etc + . + . +^G Help ^C Exit (No Save) ^T goTo Offset ^X Exit and Save ^W Search +@end example + +And so on. + +@subsection Status Window +The Status Window is the first line of the screen. At all times, it conveys the following +information +@itemize @bullet + @item + @strong{Filename} which you are working on + @item + @strong{Character Set} which you are using, ASCII or EBCDIC + @item + @strong{Current Offset} which you are at + @item + @strong{Size} of file + @item + @strong{Percent}age way through the file + @item + @strong{Modified Flag}: A M in the upper right corner signals that the file has been + modified since last save, or that the file is read-only +@end itemize + +It typically looks like this +@example +File: data.dat ASCII Offset: 0x00004250 / 0x000096BB (%44) +@end example + + +@subsection Main Window +The Main Window is the bulk of your view. It is where all viewing and editing of the file +takes place. All cursor operations and movements take place within this window. +Operations within the Main Window are described in detail in section @ref{Moving About} + +The Main Window is broken up vertically into three columns of information. The +first column from the left is the base offset@footnote{All offsets are in Hexadecimal (base16)} +which represents the offset of the first byte of that row in the Data column. + +The second column is the Data column, where the Hexadecimal representation of +each byte of the file is listed. Each row consists of 16 bytes, seperated into 2 +columns of 8 bytes, each seperated into columns of 4 bytes. +A typical row looks like: (third column not shown) +@example +00004280 50 E8 A6 CA@ @ FF FF E8 41@ @ @ CA FF FF 68@ @ 90 F5 04 08 +@end example + +The third column of the main window is the text representation on that row's bytes. +Non printable characters +are represented as a "." dot. + +@subsection Help Window +The Help Window is the friendly reminder of basic commands within the editor. It cannot +be removed. + +@subsection Popup Windows +Various commands may bring up a Popup Window. This is a smaller window centered in the +Main Window. Various operations, such as Searching, Jumping to another offset, saving, etc. +require their own window, and will "Pop" one up. @emph{Escape}, @emph{Control-X}, and +@emph{Control-G} can be used to cancel most Popup Windows. + + +@node Moving About, Editing, Windows, Program Operations +@section Moving About +Moving about the file is done through the full screen terminal interface. Operations were +meant to be easy to learn and comfortable to use. + +@subsection Hex <=> Text (Tab) +The Main Window is composed of the hex and text representation of the file. The cursor +may be moved from one to the other by use of @strong{Tab} or @strong{Control-I}@footnote{Control-X signifies holding down the control key and hitting X}. +Being on the Hex representation will be called Hex Mode, with being on the text +representation Text Mode. + +@subsection Arrow Keys +The arrow keys are the basic way to move about the file. In Hex Mode, left and right +shift you four bits in the file. Going right, you could move to the lower 4 bits of +the current byte (b & 0x0F), or move to the higher 4 bits of the next byte (b & 0xF0). +Left can bring you either to the higher 4 bits of the current byte, or to the lower bits +of the previous byte. Up and Down move you 16 bytes (offset +- 0x10) through the +file@footnote{This isn't always true if you are near the end of the file}. + +In Text Mode, left and right always move you one byte, with Up and Down moving you +16 bytes. + + +@subsection Jumping +From your current offset, you can jump to an offset relative to where you are. With +the cursor in the hex data area, Pressing @emph{+} or @emph{-} will bring up a entry +box in the help window, in which you can type in the amount to jump. Depending on whether +you did a plus or minus, you will traverse to @strong{current offset} @emph{+|-} +@strong{value}. After the first jump, you can use the @emph{n} key to continue to +jump by that offset a multitude of times. + +@subsection Misc +The following keys function as you'd expect them to +@itemize @bullet + @item + @emph{Page Up} (also @emph{Control-Y}, @emph{Control-B}, @emph{Alt-V}, @emph{u}, @emph{y}) + @item + @emph{Page Down} (also @emph{Control-F}, @emph{Control-V}, @emph{space}, @emph{v}) + @item + @emph{Home} + @item + @emph{End} +@end itemize + +@subsection GoTo Offset +At any time, you may jump to a specific offset of the file with @emph{Control-T} or @emph{t}. +This will bring up a Popup Window which will prompt you to enter +the new file offset. The new offset may be given in +decimal@footnote{Decimal numbers are base10, ex: 255}, +octal@footnote{Octal numbers are base8, prefixed by a 0, ex: 0377}, +or hex@footnote{Hex numbers are base16, prefixed by 0x, ex: 0xFF}. + +Note, the default value will be 0, +permitting a fast way to jump to the begining of the file. + + +@node Editing, Undo, Moving About, Program Operations +@section Editing +Editing is the primary@footnote{This would make viewing the secondary function, perhaps.} +function of the editor. + +@subsection Modifying Bytes + +@subsubsection Hex Mode +In this mode, Characters 0-9 and A-F may be used to change the current byte. All other +characters are ignored. + +@subsubsection Text Mode +In this mode, any printable character may be used to change the current byte. + +@subsection Insert +Insert allows you to, inplace, insert a new byte of data into the file, thus increasing +the size of the file by one byte. The new byte is always equal to zero until you modify +it. Insert is done through the @emph{Insert} key or @emph{Control-A}. Insert is only +enabled if you use the @emph{-b} option to buffer the entire file into memory. This is +not something I will consider changing. If you want to modify your copy to allow this, +best of luck to you. Insert cannot work on disks either. + +To simulate appending a byte to the end of the file, Jump to the end of the file, +and insert a byte. This will have pushed the last byte over one. Copy the value of that +byte to the new zero'd byte. Now zero the last byte. + +@subsection Delete +Delete allows you to delete the current byte, shifting the remainder of the file back one, +thus decreasing the size of the file by one byte. Delete is done through the @emph{Delete} +key or @emph{Control-D}. Delete will only work if you use the @emph{-b} option to buffer +the entire file into memory. Same as with Insert, this is not going to change in a future +release. Usually, you can use dd(1) to get the part of the file/disk you want, insert and +delete on that to your heart's content, and then dd that back to the file/disk. + +If there is only one byte in the file, Delete will zero the byte, but you cannot +reduce the file to zero bytes@footnote{I recommend rm(1) for this} + + +@node Undo, Searching, Editing, Program Operations +@section Undo +While editing a file, it is quite likely that you may make a mistake@footnote{Or a typo, if you prefer}. +To facilitate this, an extensive Undo command has been implemented on your behalf. +@emph{Control-U} Undoes the previous change to the file. The editor keeps track +of all modifications, insertions, and deletions. What this means is that at any time +you can, if you wish, revert the file back to its original state by a series of +Undo's. + +If you do @emph{Control-U} and the last changed byte is currently viewable +in the Main Window, then the cursor will relocate to that byte and revert it to its +previous state. If the last changed byte is not currently viewable, the currently +viewable area will shift so that the changed byte is viewable. In other words, you +will be relocated to that part of the file, with the cursor on that byte at that +offset. The Byte WILL NOT be Un-done. Another @emph{Control-U} will now undo the +change@footnote{This is probably worded poorly, but it's easy to see what I mean when +you try it}. + + +@node Searching, Quit, Undo, Program Operations +@section Searching +Searching allows you to quickly@footnote{The fast Boyer-Moore algorithm is used} +locate a specific sequence of characters or bytes in the file. @emph{Control-W} or @emph{w} +brings up a Popup Window giving you the options of Find Next (@emph{N}), +Search for text string (@emph{A}), and Search for Hex bytes (@emph{H}). + +@subsection Search for Text String +This options allows you to search for specific character strings of text. Spaces +are allowed. + +@subsection Search for Hex Bytes +This options allows you to search for a specific string of bytes in the file. The +Popup Window has an entry box, which accepts a sequence of bytes in Hex (0-9, A-F), +while it shows the text representation of those bytes above. Non printable +characters are shown as "." dot. + +@subsection Find Next +This options allows you to find the next occurence of the previous search (text or +Hex). This option is not availible until after your first search is completed. + +This options is bound to @emph{Control-N} to allow quickly locating the +next match. + + +@node Quit, Save, Searching, Program Operations +@section Quit +Quiting without prompting to save is done by @emph{Control-C}. It will bring up +a Popup Window to make sure of your decision to quit the program. + + +@node Save, Save and Quit, Quit, Program Operations +@section Save +To save the file at any time with the currently made changes is done with +@emph{Control-O}@footnote{On OpenBSD and a few other OS's, This keystroke +does not seem to work. It has something to do with the terminal using it}. +The file may be saved over the current file@footnote{This isn't always possible. One place is +in DOS if you try to save over the executable currently being ran}, or you may save the file as +a new or different file. In the event of an error or inability to save, you will be given +the standard@footnote{perror (filename)} error message in the Popup Window. + + +@node Save and Quit, Redraw, Save, Program Operations +@section Save and Quit +To exit the program, saving the file as you go, use @emph{Control-X}. If the file has not +been modified since the last save, the program will exit without saving. If the file has +been modified, you will be prompted for the filename to save to, which may be different +than the current filename. In the event of an error or inability to save, you will be given +the standard error message in the Popup Window, and the program will resume operations without +terminating. + + +@node Redraw, View as Text, Save and Quit, Program Operations +@section Redraw +In the event that the terminal becomes unreadable, or for any other reason, the screen may +be redrawn with @emph{Control-L}. This will only erase and redraw the screen. If the +terminal needs to be reset@footnote{By '/bin/echo "\033c"' perhaps}, the terminal will +still need to be reset. + + +@node View as Text, Ascii <=> EBCDIC, Redraw, Program Operations +@section View as Text +If at any time, you would like to see what the current file looks like as an text dump, +@emph{Control-E} will let you. Note: This feature was intended for files which are +mostly made up of text. I implemented this by traveling back to the previous new line +so that the text would be aligned how it would be in a text editor. Because of this, in +a file without any new lines for a long time, you may not be able to view certain parts +of the file in this mode. I do not see this as a problem, and I can recommend some really +nice text editors for you if you disagree. Just don't use this function@footnote{Don't use this function. Never use it. I don't.}. + +This feature was meant to just show you a snapshot of the current section as text. +That's all it does, that's all it will do. + + +@node Ascii <=> EBCDIC, Switch Spacings, View as Text, Program Operations +@section Ascii <=> EBCDIC +Some old IBM mainframes use EBCDIC instead of the ASCII character set. To switch between +which way the text is represented, @emph{Control-R} will switch it. If you don't know +what this is, you probably should not use it. + + +@node Switch Spacings, Binary Calculator, Ascii <=> EBCDIC, Program Operations +@section Switch Spacings +Some people like having spaces between each byte, and between each 8 bytes: +@example +04 30 40 23 23 43 23 54 23 48 83 29 23 12 00 45 +@end example +Some people like having the bytes grouped into four byte words: +@example +04304023 23432354 23488329 23120045 +@end example +To select which way you'd like to view the file as, use @emph{Control-P} to +switch the spacings around to the way you like it. + +@node Binary Calculator, Help, Switch Spacings, Program Operations +@section Binary Calculator +A binary calculator is included which will let you convert between +base2, base8, base10, and base16 easily. This +can be brought up with @emph{Control-+}. Currently, this doesn't +have all the features I'd like to spend the time to put into it, but +it still is quite useful. + +Currently, all numbers in the calculator are represented in +the machines default signed Integer size, a size which will be displayed +in the status window. This means that most likely setting the highest +bit will lead to a negative number. If I get time, unsigned ints as well +as indefinite precision, and arithmetic functions will be added. + + +@node Help, , Binary Calculator, Program Operations +@section Help +At any time, @emph{Control-G} may be used to get a list of commands for the editor. The +Help Window will also list some commonly used commands. + + + +@contents + + +@bye --- ncurses-hexedit-0.9.7.orig/docs/hexeditor.1 +++ ncurses-hexedit-0.9.7/docs/hexeditor.1 @@ -0,0 +1,144 @@ +.\" Copyright (C) 1998,1999 Adam Rogoyski +.TH HEXEDITOR 1 +.SH NAME +hexeditor \- Full screen curses Hex editor +.SH SYNOPSIS +.nr a \n(.j +.ad l +.nr i \n(.i +.in +\w'\fBhexedit 'u +.ti \niu +.B hexeditor +.de OP +.ie \\n(.$-1 .RI "[\ \fB\\$1fP" "\\$2" "\ ]" +.el .RB "[\ " "\\$1" "\ ]" +.. +.OP \-8abdfgqrv +.RI "[\ " filename "\ ]" +.br +.ad \na +.SH DESCRIPTION +.I Hexeditor +is an editor to edit binary (or any) files or disks. The Display consists +of the current offset from 0 (the first byte), the next sixteen bytes +(aligned by bytes or 32-bit words), and its ASCII or EBCDIC text +representation. +.SH OPTIONS +.TP +.B \fI-h, --help\fR +Display help +.TP +.B \fI-8, --highbit\fR +Display 8-bit text +.TP +.B \fI-a, --alltext\fR +Display all text regardless that you know better +.TP +.B \fI-b, --buffer\fR +Buffer the entire file into memory. Faster, and enables insert and delete. +.TP +.B \fI-d, --disk\fR +File editing is a disk. OpenBSD and Linux only. +.TP +.B \fI-f, --force\fR +Force editing of a disk. Need this option to enable writing to disks. +.TP +.B \fI-q, --quiet\fR +Quiet Mode; Turn off all beeping. +.TP +.B \fI-r, --readonly\fR +Do not allow modifying the file +.TP +.B \fI-v, --version\fR +Display version number + +.SH Commands and keys +.TP +.B \fI^A\fR +Insert byte +.TP +.B \fIInsert\fR +Insert byte +.TP +.B \fI^D\fR +Delete byte +.TP +.B \fIDelete\fR +Delete byte +.TP +.B \fI^E\fR +viEw as text dump +.TP +.B \fI^F\fR +Page down +.TP +.B \fI^V\fR +Page down +.TP +.B \fIPage Down\fR +Page down +.TP +.B \fI^B\fR +Page Up +.TP +.B \fI^Y\fR +Page Up +.TP +.B \fIAlt-V\fR +Page Up +.TP +.B \fIPage Up\fR +Page Up +.TP +.B \fITab\fR +Switch from hex to text representation +.TP +.B \fI^I\fR +Switch from hex to text representation +.TP +.B \fI^T\fR +goTo offset +.TP +.B \fI^G\fR +Get help +.TP +.B \fI^L\fR +Redraw screen +.TP +.B \fI^C\fR +Quit without saving +.TP +.B \fI^O\fR +Save +.TP +.B \fI^X\fR +Save and Quit +.TP +.B \fI^W\fR +Search (text/hex) +.TP +.B \fI^N\fR +find Next +.TP +.B \fI^U\fR +Undo +.TP +.B \fI^R\fR +ASCII <=> EBCDIC +.TP +.B \fI^P\fR +Switch Spacings +.TP +.B \fI^+\fR +Binary Calculator + +.SH Author +Adam Rogoyski +.SH "See Also" +od (1) +.SH BUGS +Editing disks is only supported in Linux and OpenBSD. + +Please email Adam Rogoyski with any bugs you might find. +This man page is intentionally brief. Please Read the included documentation +in Texinfo format for additional information --- ncurses-hexedit-0.9.7.orig/src/Makefile.am +++ ncurses-hexedit-0.9.7/src/Makefile.am @@ -1,6 +1,6 @@ -bin_PROGRAMS = hexedit +bin_PROGRAMS = hexeditor -hexedit_SOURCES = asciikey.c \ +hexeditor_SOURCES = asciikey.c \ calc.c \ calckeys.c \ edit.c \ --- ncurses-hexedit-0.9.7.orig/src/help.c +++ ncurses-hexedit-0.9.7/src/help.c @@ -23,7 +23,7 @@ /* The help messages used with the online help screen. */ const char *help_msgs[] = { - "Maneuver Arror Keys (or h,j,k,l), Home, End", + "Maneuver Arrow Keys (or h,j,k,l), Home, End", "Page Up Control-y, Control-b, Alt-v, Page Up (^Y) (^B) u y", "Page Down Control-v, Control-f, Page Down (^V) (^F) v space", "Bytes <=> text Tab, Control-i (^I)", --- ncurses-hexedit-0.9.7.orig/src/search.c +++ ncurses-hexedit-0.9.7/src/search.c @@ -39,7 +39,7 @@ if (!buf) return &found; - memset (l_table, 0, 256 * sizeof (int)); + memset (l_table, 0, sizeof (l_table)); i = 0; s = substr + len - 1; while (i < len) --- ncurses-hexedit-0.9.7.orig/src/Makefile.in +++ ncurses-hexedit-0.9.7/src/Makefile.in @@ -62,9 +62,9 @@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ -bin_PROGRAMS = hexedit +bin_PROGRAMS = hexeditor -hexedit_SOURCES = asciikey.c calc.c calckeys.c edit.c file.c filebuf.c filekeys.c hash.c help.c hexkeys.c init.c main.c misc.c print.c search.c undo.c widgets.c windows.c hexedit.h +hexeditor_SOURCES = asciikey.c calc.c calckeys.c edit.c file.c filebuf.c filekeys.c hash.c help.c hexkeys.c init.c main.c misc.c print.c search.c undo.c widgets.c windows.c hexedit.h mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h @@ -76,12 +76,12 @@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ -hexedit_OBJECTS = asciikey.o calc.o calckeys.o edit.o file.o filebuf.o \ -filekeys.o hash.o help.o hexkeys.o init.o main.o misc.o print.o \ -search.o undo.o widgets.o windows.o -hexedit_LDADD = $(LDADD) -hexedit_DEPENDENCIES = -hexedit_LDFLAGS = +hexeditor_OBJECTS = asciikey.o calc.o calckeys.o edit.o file.o \ +filebuf.o filekeys.o hash.o help.o hexkeys.o init.o main.o misc.o \ +print.o search.o undo.o widgets.o windows.o +hexeditor_LDADD = $(LDADD) +hexeditor_DEPENDENCIES = +hexeditor_LDFLAGS = CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) @@ -93,16 +93,20 @@ TAR = tar GZIP_ENV = --best -SOURCES = $(hexedit_SOURCES) -OBJECTS = $(hexedit_OBJECTS) +DEP_FILES = .deps/asciikey.P .deps/calc.P .deps/calckeys.P .deps/edit.P \ +.deps/file.P .deps/filebuf.P .deps/filekeys.P .deps/hash.P .deps/help.P \ +.deps/hexkeys.P .deps/init.P .deps/main.P .deps/misc.P .deps/print.P \ +.deps/search.P .deps/undo.P .deps/widgets.P .deps/windows.P +SOURCES = $(hexeditor_SOURCES) +OBJECTS = $(hexeditor_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -132,9 +136,6 @@ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ done -.c.o: - $(COMPILE) -c $< - .s.o: $(COMPILE) -c $< @@ -151,9 +152,9 @@ maintainer-clean-compile: -hexedit: $(hexedit_OBJECTS) $(hexedit_DEPENDENCIES) - @rm -f hexedit - $(LINK) $(hexedit_LDFLAGS) $(hexedit_OBJECTS) $(hexedit_LDADD) $(LIBS) +hexeditor: $(hexeditor_OBJECTS) $(hexeditor_DEPENDENCIES) + @rm -f hexeditor + $(LINK) $(hexeditor_LDFLAGS) $(hexeditor_OBJECTS) $(hexeditor_LDADD) $(LIBS) tags: TAGS @@ -189,10 +190,15 @@ subdir = src distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/Makefile @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ @@ -200,6 +206,37 @@ fi; \ done +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) + +-include $(DEP_FILES) + +mostlyclean-depend: + +clean-depend: + +distclean-depend: + -rm -rf .deps + +maintainer-clean-depend: + +%.o: %.c + @echo '$(COMPILE) -c $<'; \ + $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.c + @echo '$(LTCOMPILE) -c $<'; \ + $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp info-am: info: info-am dvi-am: @@ -237,23 +274,24 @@ maintainer-clean-generic: mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ - mostlyclean-tags mostlyclean-generic + mostlyclean-tags mostlyclean-depend mostlyclean-generic mostlyclean: mostlyclean-am -clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \ - mostlyclean-am +clean-am: clean-binPROGRAMS clean-compile clean-tags clean-depend \ + clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \ - distclean-generic clean-am + distclean-depend distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-binPROGRAMS \ maintainer-clean-compile maintainer-clean-tags \ - maintainer-clean-generic distclean-am + maintainer-clean-depend maintainer-clean-generic \ + distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." @@ -263,12 +301,13 @@ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile tags mostlyclean-tags distclean-tags \ -clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ -check-am installcheck-am installcheck install-exec-am install-exec \ -install-data-am install-data install-am install uninstall-am uninstall \ -all-redirect all-am all installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean +clean-tags maintainer-clean-tags distdir mostlyclean-depend \ +distclean-depend clean-depend maintainer-clean-depend info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. --- ncurses-hexedit-0.9.7.orig/src/misc.c +++ ncurses-hexedit-0.9.7/src/misc.c @@ -382,7 +382,8 @@ void usage (char *prog) { - printf ("[N]Curses Hexedit %s by Adam Rogoyski \n" \ + char *usage; + usage = "[N]Curses Hexedit %s by Adam Rogoyski \n" \ "Copyright (C) 1998, 1999 Adam Rogoyski\n" \ "This is free software; see the source for copying conditions.\n" \ "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n" \ @@ -402,7 +403,8 @@ " -n, --nocolor Force Gray scale, no colors.\n" " -q, --quiet Quiet Mode, No annoying beeping\n" " -r, --readonly Do not modifying of the file.\n" - " -v, --version Print the version number and exit.\n", + " -v, --version Print the version number and exit.\n"; + printf(usage, VERSION, prog); } --- ncurses-hexedit-0.9.7.orig/src/hexedit.h +++ ncurses-hexedit-0.9.7/src/hexedit.h @@ -33,6 +33,9 @@ #ifdef HAVE_LIMITS_H #include #endif +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif #ifdef STDC_HEADERS #include --- ncurses-hexedit-0.9.7.orig/src/widgets.c +++ ncurses-hexedit-0.9.7/src/widgets.c @@ -62,22 +62,20 @@ wmove (win, y, x); wattrset (win, color_term ? S_BOX_COLOR : A_REVERSE); - str = malloc (len + 2); + str = malloc (len + 1); if (!str) { /* fprintf (stderr, "%s - StringBox\n", NOT_ENOUGH_MEMORY); */ popup_Error (NOT_ENOUGH_MEMORY, 0); return NULL; } - *(str + len + 1) = '\0'; - memset (str, ' ', len + 1); - strncpy (str, sample ? sample : "", samplelen); + memset (str, 0, len + 1); + if (sample) + strncpy (str, sample, samplelen); for (i = 0; i < max; i++) { - if (*(str + i) && (i < max)) - { + if (*(str + i)) wprintw (win, "%c", *(str + i)); - } else wprintw (win, " "); } @@ -170,10 +168,10 @@ { i--; for (n = strlen (str); n < len; n++) - *(str + n) = ' '; + *(str + n) = 0; for (n = i; n < len; n++) *(str + n) = *(str + n + 1); - *(str + n) = ' '; + *(str + n) = 0; oldx = win->_curx; wmove (win, y, x); for (n = left; n <= right; n++) @@ -220,7 +218,7 @@ *(str + n) = *(str + n - 1); } *(str + i) = ' '; - *(str + len) = ' '; + *(str + len) = 0; i++; wmove (win, y, x); for (n = left; n <= right; n++) @@ -240,7 +238,7 @@ *(str + n) = *(str + n - 1); } *(str + i) = ' '; - *(str + len) = ' '; + *(str + len) = 0; i++; if (right < len - 1) { --- ncurses-hexedit-0.9.7.orig/src/windows.c +++ ncurses-hexedit-0.9.7/src/windows.c @@ -253,7 +253,7 @@ filename = stringBox (wpopup, 3, 2 + strlen ("Filename: "), FILE_SAVE_STRING_BOX_MAX, FILE_SAVE_STRING_BOX, (char *) Globals.filename); - chompWhiteSpace (filename); +/* chompWhiteSpace (filename); */ if (!filename); else if (!*filename) @@ -635,15 +635,10 @@ SEARCH_STRING_BOX, NULL); s = (unsigned char *) str; laststr = s; - for (str = s + SEARCH_STRING_BOX_MAX - 1; str != (s - 1); str--) - { - if (*str != ' ') - { - *(str + 1) = '\0'; - done = 1; - break; - } - } + + if (*s) + done = 1; + if (Globals.charset == EBCDIC_CHAR_SET) { unsigned char *p = s; @@ -697,20 +692,21 @@ spot = boyer_moore_search (retr->str, offset + 1, last_str_len = retr->len, Globals.filesize - offset); + if (laststr) + free (laststr); + laststr = malloc (retr->len + 1); + memset (laststr, 0x00, retr->len + 1); + memcpy (laststr, retr->str, retr->len); + free (retr->str); + retr->str = NULL; + retr->len = 0; + if (spot && spot->flag) { offset += spot->offset + 1; /* started search one character ahead of offset */ cursor_y = 1; cursor_x = mappos (offset & M_0x0F); - if (laststr) - free (laststr); - laststr = malloc (retr->len + 1); - memset (laststr, 0x00, retr->len + 1); - memcpy (laststr, retr->str, retr->len); - free (retr->str); - retr->str = NULL; - retr->len = 0; } else { --- ncurses-hexedit-0.9.7.orig/gnu/Makefile.in +++ ncurses-hexedit-0.9.7/gnu/Makefile.in @@ -76,9 +76,9 @@ all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps gnu/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu gnu/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -91,10 +91,15 @@ subdir = gnu distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu gnu/Makefile @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ --- ncurses-hexedit-0.9.7.orig/debian/docs +++ ncurses-hexedit-0.9.7/debian/docs @@ -0,0 +1 @@ +AUTHORS NEWS README docs/hexeditor.texinfo hexedit.lsm --- ncurses-hexedit-0.9.7.orig/debian/dirs +++ ncurses-hexedit-0.9.7/debian/dirs @@ -0,0 +1,3 @@ +usr/bin +usr/share/info +usr/share/man/man1 --- ncurses-hexedit-0.9.7.orig/debian/compat +++ ncurses-hexedit-0.9.7/debian/compat @@ -0,0 +1 @@ +5 --- ncurses-hexedit-0.9.7.orig/debian/README.Debian +++ ncurses-hexedit-0.9.7/debian/README.Debian @@ -0,0 +1,7 @@ +ncurses-hexedit for Debian +---------------------- + +Change the binary from hexedit to hexeditor to avoid conflict with the +hexedit package + + -- Adam F. Rogoyski , Fri, 23 Apr 1999 20:54:29 -0500 --- ncurses-hexedit-0.9.7.orig/debian/rules +++ ncurses-hexedit-0.9.7/debian/rules @@ -0,0 +1,77 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + rm docs/hexedit.1 docs/hexedit.info docs/hexedit.texinfo || true + ./configure --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info + + touch configure-stamp + +build: configure-stamp build-stamp +build-stamp: + dh_testdir + + $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + [ ! -f Makefile ] || $(MAKE) distclean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/ncurses-hexedit. + $(MAKE) install prefix=$(CURDIR)/debian/ncurses-hexedit/usr + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot +# dh_installdebconf + dh_installdocs +# dh_installexamples +# dh_installmenu +# dh_installemacsen +# dh_installpam +# dh_installinit +# dh_installcron + dh_installmanpages + dh_installinfo +# dh_undocumented + dh_installchangelogs ChangeLog + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_suidregister +# dh_makeshlibs + dh_installdeb +# dh_perl + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- ncurses-hexedit-0.9.7.orig/debian/copyright +++ ncurses-hexedit-0.9.7/debian/copyright @@ -0,0 +1,15 @@ +This package was debianized by Adam F. Rogoyski on +Fri, 23 Apr 1999 20:54:29 -0500. + +It was downloaded from ftp://metalab.unc.edu/pub/Linux/apps/editors/terminal/hexedit-0.9.7.tar.gz + +Upstream Author: Adam F. Rogoyski + +Copyright: (C) 1998, 1999 Adam F. Rogoyski + +[N]curses hexedit is released under the GNU GPL license as free, open +source software. Hopefully it will seem useful to someone. NO WARRANTY. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in /usr/share/common-licenses/GPL'. + --- ncurses-hexedit-0.9.7.orig/debian/ncurses-hexedit.postinst +++ ncurses-hexedit-0.9.7/debian/ncurses-hexedit.postinst @@ -0,0 +1,47 @@ +#! /bin/sh +# postinst script for ncurses-hexedit +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/share/doc/packaging-manual/ +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +case "$1" in + configure) + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- ncurses-hexedit-0.9.7.orig/debian/ncurses-hexedit.info +++ ncurses-hexedit-0.9.7/debian/ncurses-hexedit.info @@ -0,0 +1 @@ +docs/hexeditor.info --- ncurses-hexedit-0.9.7.orig/debian/ncurses-hexedit.prerm +++ ncurses-hexedit-0.9.7/debian/ncurses-hexedit.prerm @@ -0,0 +1,37 @@ +#! /bin/sh +# prerm script for ncurses-hexedit +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see /usr/share/doc/packaging-manual/ + +case "$1" in + remove|upgrade|deconfigure) +# install-info --quiet --remove /usr/info/ncurses-hexedit.info.gz + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- ncurses-hexedit-0.9.7.orig/debian/control +++ ncurses-hexedit-0.9.7/debian/control @@ -0,0 +1,19 @@ +Source: ncurses-hexedit +Section: editors +Priority: optional +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Manfred Lichtenstern +Build-Depends: debhelper (>> 5.0.0), libncurses5-dev (>> 5.0.0) +Standards-Version: 3.8.0 + +Package: ncurses-hexedit +Architecture: any +Depends: ${shlibs:Depends} +Description: Edit files/disks in hex, ASCII and EBCDIC + Hexedit is a file editor which allows editing and viewing a file in + hexadecimal, along with its ASCII or EBCDIC text equivalent. Standard + editing features include insert, delete, search (text or byte searches), + highlighted changes, undo, two different viewing formats, and full + screen text snapshots. Allows editing of fixed disks as well. Includes + a binary/octal/decimal/hex converter. + --- ncurses-hexedit-0.9.7.orig/debian/changelog +++ ncurses-hexedit-0.9.7/debian/changelog @@ -0,0 +1,133 @@ +ncurses-hexedit (0.9.7-14ubuntu1) karmic; urgency=low + + * src/windows.c: Fixes a crash which was caused by searching for + values that were not in the file being viewed. + Thanks to Jakob Hilmer for the patch. (LP: #122349) + + -- Stephen Burke Sat, 04 Jul 2009 12:19:11 -0500 + +ncurses-hexedit (0.9.7-14) unstable; urgency=low + + * New Maintainer. (Closes: #419075) + * Added patch from Eduardo PĂ©rez Ureta + to correct programing error in search.c (Closes: #484056). + * update docs/hexeditor.1 and remove docs/hexedit.1 (Closes: #510952) + * Conforms to Standards version 3.8.0 + + -- Manfred Lichtenstern Wed, 07 Jan 2009 20:03:22 +0100 + +ncurses-hexedit (0.9.7-13) unstable; urgency=low + + * QA upload. + * src/hexedit.h: Define a fallback value for PATH_MAX on GNU/Hurd. + Thanks to Santiago Vila for the patch. Closes: #218335. + * src/help.c: Fix typo in help screen. Closes: #291656. + * debian/changelog: Remove obsolete Emacs local variables. + + -- Matej Vela Fri, 27 Apr 2007 16:48:49 +0200 + +ncurses-hexedit (0.9.7-12) unstable; urgency=low + + * QA upload. + * Set maintainter to QA Group, Orphaned: #419075 + * Remove build dependency on make (build-essential can be omitted) + * Bump debian/compat to 5, use newer debhelper, update debian/rules + * Update Standards Version to 3.7.2 + + -- Michael Ablassmeier Thu, 26 Apr 2007 11:23:22 +0200 + +ncurses-hexedit (0.9.7-11) unstable; urgency=low + + * Upgrade to standards version 3.5.8.0. Forgot this in last release. + + -- Adam F. Rogoyski Sun, 15 Dec 2002 19:50:58 -0600 + +ncurses-hexedit (0.9.7-10) unstable; urgency=low + + * Remove setting link in /usr/doc as reported by lintian. + * Add make build-depends. + + -- Adam F. Rogoyski Sun, 15 Dec 2002 19:36:52 -0600 + +ncurses-hexedit (0.9.7-9) unstable; urgency=low + + * Fix stringBox widget to treat all white space as significant. + * Allow saving files with spaces in them. + * Closes Bug #147229. + + -- Adam F. Rogoyski Sun, 26 May 2002 21:03:13 -0500 + +ncurses-hexedit (0.9.7-8) unstable; urgency=low + + * Fix "it's" --> "its" when using the possessive form of it. + * Closes Bug #109488. + + -- Adam F. Rogoyski Mon, 20 Aug 2001 20:27:52 -0500 + +ncurses-hexedit (0.9.7-7) unstable; urgency=high + + * Fix NMU. + * Closes Bug #104567. + * Closes Bug #104570. + + -- Adam F. Rogoyski Mon, 20 Aug 2001 19:46:37 -0500 + +ncurses-hexedit (0.9.7-6.1) unstable; urgency=low + * Non-maintainer upload. + * Fix printf-is-a-macro issue (gcc 3.0). Closes: #103155 + + -- LaMont Jones Mon, 9 Jul 2001 21:39:34 -0600 + +ncurses-hexedit (0.9.7-6) unstable; urgency=low + + * Add build-depends on libncurses5-dev, closes BUG #91894 + + -- Adam F. Rogoyski Sun, 8 Apr 2001 21:43:23 -0500 + +ncurses-hexedit (0.9.7-5) unstable; urgency=low + + * Use standards 3.2.1. + * Use debhelper >> 3.0.0. + * Add hexedit.lsm from linux software map to docs. + * Add AUTHORS to docs. + + -- Adam F. Rogoyski Tue, 13 Mar 2001 13:54:30 -0600 + +ncurses-hexedit (0.9.7-4) unstable; urgency=low + + * Fix .orig.tar.gz to untar to ncurses-hexedit-0.9.7/ instead of hexedit-0.9.7/ + * Fix .orig.tar.gz directory. + + -- Adam F. Rogoyski Sat, 27 Nov 1999 18:38:27 -0600 + +ncurses-hexedit (0.9.7-3) unstable; urgency=low + + * fix build source to include .orig.tar.gz + * Fix copyright - source urlc + + -- Adam F. Rogoyski Sun, 14 Nov 1999 20:09:51 -0600 + +ncurses-hexedit (0.9.7-2) unstable; urgency=low + + * Change usr -> usr/share where necessary. + + -- Adam F. Rogoyski Sat, 13 Nov 1999 20:57:11 -0600 + +ncurses-hexedit (0.9.7-1) unstable; urgency=low + + * New Upstream Release. + + -- Adam F. Rogoyski Sat, 7 Aug 1999 23:55:01 -0500 + +ncurses-hexedit (0.9.6-2) unstable; urgency=low + + * Fixed info documentation installation + + -- Adam F. Rogoyski Fri, 4 Jun 1999 22:02:31 +0000 + +ncurses-hexedit (0.9.6-1) unstable; urgency=low + + * Initial Release. + * Changed binary from hexedit to hexeditor to avoid conflict + + -- Adam F. Rogoyski Fri, 23 Apr 1999 20:54:29 -0500