dumprom romfile extraction tool

system files in windows ce are packed in rom in several ways. normally you are not able to copy files from rom. files can be stored compressed, or uncompressed, and in some cases split into several sections, ready to be executed from rom. dumprom uncompresses the data, and reconstructs the original file from its parts.

To get almost usable versions of the files in rom, the relocation information is missing, but for most it is not an issue, and most files seem to have a truncated resources section ( probably due to a bug in microsofts romimage tool ) I created this tool, you can find the source here
there is also a page on dumprom on the xda-developer wiki

restoring the relocation information is a hard problem, it requires reverse engineering of the code, to identify what data are offsets, and what is just data.

also exchanging modules from different roms is usually not possible, since modules in a specific rom, are usually fixed to specific memory layout. a module from a different rom will probably not fit.

to compile:

cl /Zi /Wall /wd4710 /wd4217 /wd4668 /wd4820 /wd4619 /EHsc dumprom.cpp NKCOMPR.LIB
or to compile under unix: ( with dummy compression lib )
g++ dumprom.cpp compress.cpp -o dumprom
Note: the linux version will only extract uncompressed files correctly, and producre garbage for compressed files
btw, weird that microsofts own header files generate so many warnings

dumprom was last updated on july 1st 2003, fixes include:

   dumprom nk-e740-1.0618.0409.bin
   img 00000000 : hdr=80273c8c base=80040000  commandlineoffset=8003ffe5
   img 00282000 : hdr=8057cd38 base=80040000  commandlineoffset=8003ffe5
   img 00540000 : hdr=80759a38 base=80040000  commandlineoffset=8003ffe5
then type
dumprom nk-e740-1.0618.0409.bin 0x8003ffe5
to view the rom contents.
dumprom nk-e740-1.0618.0409.bin 0x8003ffe5 -d files >e740info.txt 
to save the info to a text file, and extract the rom files to a directory

tools to do the reverse ( create a rom from a set of files ) can be found here.

news Tue Jun 8 11:41:57 CEST 2004
fixed crash bug that made it difficult to extract files from smartphone rom.

news Fri Apr 8 09:46:54 CEST 2005
fixed problem with imports and other sections at negative rva. now defaults to 4.x compression.

news Tue Jun 21 15:24:54 CEST 2005
added support for wm2005 '-5' : different e32rom struct
now writes extension list only once
dataptr=NULL now handled correctly
now correctly identifies kernel jump at start

news Tue Jun 6 21:54:49 CEST 2017
Re-releasing my windows-ce romeditting tool. This tool also supports modifying the rom, and runs on MacOS.