John Clarke wrote: > On Tue, Jun 13, 2006 at 09:01:17 +1000, Erik de Castro Lopo wrote: > > > This is almost *certainly* *not* what you want. My guess is that > > while this filesystem has *some* 16 byte integers, it also has 32 > > bit integers and probably also 64 bit integers. Swapping pairs of > > bytes will do the right thing for 16 bit integers, but not for > > any of the others. > > I'd treat the data as 32-bit words and swap the bytes within those > words.
Please read what I wrote above. The binary in question is a complete file system. As such it is likely to contain plain text, 16 bit integers, 32 bit integers and 64 bit integers. Problem is that within that file system image, you don't who what parts are what type. End swapping every 4 bytes will be correct for the 32 bit integers that are 4 byte aligned. It will be *wrong* for everything else on the filesystem. Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo +-----------------------------------------------------------+ "I'll just say that having programmed in Lisp the shortcomings of Java are glaringly obvious." -- Erann Gat -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
