main page
download
FAQ
research notes
data sheets
schematics
hardware mods
mailing list
IRC
tools
photos
daily builds
CVS
sourceforge
linux driver


Tools

Descrambler / Scrambler

The archos.mod file is scrambled, but luckily not using encryption.

Each data byte is inverted and ROLed 1 bit. The data is then spread over four memory segments. The two least significant bits of the address is used as segment number and the rest as offset in the segment. So, basically:

  • segment number = address % 4
  • segment offset = address / 4
  • segment length = imgsize / 4

A 6-byte header is added to the beginning of the scrambled image:

  • 32 bit length (big-endian)
  • 16 bit checksum

I've written a small utility to descramble the firmware files:

  • descramble.c - 1835 bytes - The source code (pure ANSI C, should work everywhere). GPL licensed.
  • descramble - 4280 bytes - Dynamically linked i386 linux executable
  • descramble.static.bz2 - 176015 bytes - bzip2 compressed statically linked i386 linux executable
  • descramble.exe - 45056 bytes - win32 executable

...and one to scramble files:

  • scramble.c - 2242 bytes - The source code (pure ANSI C, should work everywhere). GPL licensed.
  • scramble - 4376 bytes - Dynamically linked i386 linux executable
  • scramble.static.bz2 - 176117 bytes - bzip2 compressed statically linked i386 linux executable
  • scramble.exe - 93385 bytes - win32 executable

Disassembler

I found a nice public domain SH-1/SH-2 disassembler written by Bart Trzynadlowski, called sh2d:

Update: I've added address lookup and register name translation to the disassembler (2001-12-09)

  • sh2d.c - 28 kB - Source code
  • sh2d - 15 kB - Dynamically linked i386 linux executable
  • sh2d.static.bz2 - 170 kB - bzip2 compressed statically linked i386 linux executable
  • sh2d.exe - 40 kB - win32 executable (original version; no lookup)

Compiler

GCC supports the SH processor. Just cook yourself a cross-compiler (sh-elf-gcc) and voila, instant SH-1 code.

There are also pre-cooked RH7.1 RPMs available from sh-linux.org, although some people have reported difficulties getting Rockbox to work with this.

Felix Arends has written a page about setting up an SH-1 compiler for Windows.

Justin Heiner has built a win32 cross compiler for cygwin users.


Page was last modified "Aug 7 2002" Björn Stenberg