Loading ...
Sorry, an error occurred while loading the content.

Editing HEX files - WAS Re: [NRN] "simple?" wishes

Expand Messages
  • elssner <elssner@yahoo.de>
    Hi Larry and all, ... common ... create a ... First it was only an short idea to help Pete with his wishes to edit any file / hex files. Now it looks that a
    Message 1 of 2 , Feb 12, 2003
    • 0 Attachment
      Hi Larry and all,

      --- In ntb-clips@yahoogroups.com, "Larry Hamilton" <lmh@h...> wrote:
      > From a discussion on the NRN list about editing Hex files.
      >
      > Well, I got myself on another quick utils fix. Here are the most
      common
      > options one would want for using this tool. I built an option to
      create a
      > ...

      First it was only an short idea to help Pete with his wishes to edit
      any file / hex files. Now it looks that a relatively simple clip can
      make NoteTab editing Hex Files at least useful-enough to any who know
      how and really needs editing them?

      I for myself need this rather seldom, however it looks interesting.

      So I tested your clip (Sure, it works ;) ) and made some minor
      changes for that. Still hoping someone other will pick this up and
      make it the "hex-edit" clip ... :)

      All lines begin with ^ : or ; (Command, Label, or Comment) or are
      empty.

      -- snip --
      H="xd 0.2"
      ;Hex Editing in NoteTab, using xd written by John Walker
      ;See http://www.fourmilab.ch/xd/
      ;
      ;Ground work by
      ;Larry Hamilton, February 10, 2003
      ;
      ;Version 0.2 (just for testing) Stefan Elssner, Feb 12, 2003
      ;- pathes for xd, infile and outfile still hardcoded but script vars
      ;- ascii output hardcoded to be Hex with ISO alongside (-ah -c)
      ;NOTES:
      ;- You'll need the xd utility to get this working ;)
      ; (it's free and open source, to get it see above)
      ;- With the options harcoded in this clip xd dumps the Hex
      ; representation of the infile bytes on the left,
      ; and the regarding printable chars (if applicable,
      ; otherwise a '.') on the right, partened by a column of '|'.
      ; Contrary to the function of some specialised hex-editors it has
      ; _no_ effect to edit the printable/iso representation on the
      ; right side. If you need to change something, you must replace the
      ; Hex representations on the left.
      ;- This clip is working! IT SHOULD OVERWRITE ANY FILE THAT IS NAMED AS
      ; outfilepath WITHOUT NOTICE and make it unusable if you made a bad
      ; change to the dump before. So be careful :)

      ^!SetDebug ON

      ; Change this for your needs!
      ^!Set %xdpath%=c:\programs\xd.exe
      ; Change this for your needs!
      ^!Set %infilepath%=c:\programs\calen.exe
      ; Change this for your needs!
      ^!Set %outfilepath%=c:\programs\calen2.exe

      ^!Set %choice%=^?{Action=Show dump as Info only^=1|Print dump to New
      Doc^=2|Make new file from dump^=3}
      ^!If ^%choice%=1 NEXT ELSE ONE

      ^!Info ^$GetDosOutput(^%xdpath% -ah -c ^%infilepath%)$

      :ONE
      ^!IF ^%choice%=2 NEXT ELSE TWO

      ^!Set %dump%=^$GetDosOutput(^%xdpath% -s -ah -c ^%infilepath%)$
      ^!Toolbar New Document
      ^!Insert ^%dump%

      :TWO
      ^!IF ^%choice%=3 NEXT ELSE END

      ^!^%xdpath% -l -s ^** ^%outfilepath%

      -- snap --
    Your message has been successfully submitted and would be delivered to recipients shortly.