From: Tony Lawrence <firstname.lastname@example.org> Subject: Re: Command Line Length, Upper Limit? Date: Wed, 15 Jan 2003 20:16:03 GMT Mark Conrad wrote: > In article <JXbV9.687809$WL3.722374@rwcrnsc54>, Tony Lawrence > <email@example.com> wrote: > > >>>The main sticking point is that I don't know how to execute the >>>necessary 3rd-party application "HexEdit" from the command-line. >> >>AppleScript. Which can be embedded in your shell script with osascript... > > > Thanks for that tip, I looked at 'man osascript' and it looks like it > would work. > > > >>However, why use Hexedit? Looks to me (not that I've read carefully >>through that mess) like you are just changing some bytes - put 'em >>in a file and use ddd to slap 'em where you want them. > > > I thought you would never ask<g> > > The reason I use HexEdit along with dd is because dd can't write to > specific free-space bytes in certain areas of disk, like for example > the Driver Descriptor Map area (absolute disk sector zero) If dd can read it, dd can write it. Or are you saying you don't know WHERE to write until you see it in hex edit? You can skip right by bytes with dd and write any number of new bytes you like. A simple example: echo "AAAAAAAAAA" > /tmp/a echo "BBB" > /tmp/b dd if=/tmp/b bs=1 count=3 seek=2 conv=notrunc of=/tmp/a cat /tmp/a (notrunc is necessary with regular files; see the man page)
Got something to add? Send me email.