Chishm has released DS firmware unpacker called Fwunpack.
Quote
What does it do? It decrypts and decompresses all the binaries (parts 1-5 and FlashMe stubs) from a firmware dump.
What use is it? To satisfy your curiousity.
Can I make my own firmware with this? No,there is no repacker, but I suppose it isn't too hard to write one now. The worst bit would be writing the compressor for parts 3-5.