Diary of a geek

September 2004
Mon Tue Wed Thu Fri Sat Sun

Andrew Pollock


Other people's blogs


RSS feed

Contact me

JavaScript required

Monday, 13 September 2004

New trick: hexediting with dd

Today's excuse to procrastinate on doing assignments was getting the USB-serial adapter (a Targus PA088 that my Dad gave me because he didn't need it) to work with MacOS X.

Google happened upon this page (some guy's blog), which mentioned the PA088, but was more a red-herring in that it sent me off down the wrong path, trying to hack a driver for another vendor's adapter to work with my adapter, which I presume was a totally different chipset.

There was a lot of user comments for this blog entry, and some of them were helpful, and I ended up finding a driver on the chipset vendor's driver page

The interesting thing that I learned in the whole process was how to make changes to a binary file using only printf and dd. I ended up having to make use of this, because the driver insisted on naming the device /dev/tty.USB Serial (yes, there's a space in there).

Using hexdump -C, I identified the offset in the driver file of the space in the string "USB Serial", and then did this: printf "\137" | dd conv=notrunc of=USBSerialDriver seek=26071 count=1 bs=1 and then lo and behold (well actually after a bit of unloading and reloading of the kernel extension) the device had a more sane name.

[01:23] [tech] [permalink]