new left-side menu
[kugel-rb.git] / www / tools.t
blobb367d73fb86dbf3d2aa589b83ed4b14c6e1e991c
1 #define _PAGE_ Tools
2 #include "head.t"
4 <h2>Descrambler / Scrambler</h2>
6 <p>The archos.mod file is scrambled, but luckily not using encryption.
8 <p>Each data byte is inverted and ROLed 1 bit.
9 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:
11 <ul>
12 <li>segment number = address % 4
13 <li>segment offset = address / 4
14 <li>segment length = imgsize / 4
15 </ul>
17 <p>A 6-byte header is added to the beginning of the scrambled image:
18 <ul>
19 <li>32 bit length (big-endian)
20 <li>16 bit checksum
21 </ul>
23 <p>I've written a small utility to descramble the firmware files:
24 <ul>
25 <li><a href="tools/descramble.c">descramble.c</a> - 1835 bytes - The source code (pure ANSI C, should work everywhere). GPL licensed.
26 <li><a href="tools/descramble">descramble</a> - 4280 bytes - Dynamically linked i386 linux executable
27 <li><a href="tools/descramble.static.bz2">descramble.static.bz2</a> - 176015 bytes - bzip2 compressed statically linked i386 linux executable
28 <li><a href="tools/descramble.exe">descramble.exe</a> - 45056 bytes - win32 executable
29 </ul>
31 <p>...and one to scramble files:
32 <ul>
33 <li><a href="tools/scramble.c">scramble.c</a> - 2242 bytes - The source code (pure ANSI C, should work everywhere). GPL licensed.
34 <li><a href="tools/scramble">scramble</a> - 4376 bytes - Dynamically linked i386 linux executable
35 <li><a href="tools/scramble.static.bz2">scramble.static.bz2</a> - 176117 bytes - bzip2 compressed statically linked i386 linux executable
36 <li><a href="tools/scramble.exe">scramble.exe</a> - 93385 bytes - win32 executable
37 </ul>
39 <h2>Disassembler</h2>
41 <p>I found a nice public domain SH-1/SH-2 disassembler written by Bart Trzynadlowski, called <a href="http://saturndev.emuvibes.com/Files/sh2d020.zip">sh2d</a>:
42 <p><b>Update:</b> I've added address lookup and register name translation to the disassembler (2001-12-09)
43 <ul>
44 <li><a href="tools/sh2d.c">sh2d.c</a> - 28 kB - Source code
45 <li><a href="tools/sh2d">sh2d</a> - 15 kB - Dynamically linked i386 linux executable
46 <li><a href="tools/sh2d.static.bz2">sh2d.static.bz2</a> - 170 kB - bzip2 compressed statically linked i386 linux executable
47 <li><a href="tools/sh2d.exe">sh2d.exe</a> - 40 kB - win32 executable (original version; no lookup)
48 </ul>
50 <h2>Compiler</h2>
52 <p>GCC supports the SH processor. Just 
53 <a href="cross-gcc.html">cook yourself a cross-compiler</a>
54 (sh-elf-gcc) and voila, instant SH-1 code.
56 <p>There are also 
57 <a href="http://www.sh-linux.org/rpm/RPMS/i386/RedHat7.1/">
58 pre-cooked RH7.1 RPMs</a> available from sh-linux.org, although some people have reported difficulties getting Rockbox to work with this.
60 <p>Felix Arends has written a page about
61 <a href="sh-win/">setting up an SH-1 compiler for Windows</a>.
63 <p>Justin Heiner has built a 
64 <a href="http://merwin.bespin.org/sh1cygwin/">win32 cross compiler for cygwin users</a>.
66 #include "foot.t"