[Windows Mobile Software Development] utak3r:
Hello guys...

I was reviewing those tuts, and spotted on something...

Do you know the fantastic tool by Weisun from PDAclan.com, named OSNBTool? It can solve quite many problems while cooking and porting. Let's see some examples:

Getting xip.bin out of os.nb (even the SRPX packed ones, like in Asus, HP or Eten!!):

C:\osnbtool>osnbtool -d os.nb 1 xip.bin

OS ROM Partition Tool V1.56 By Weisun :> PDAclan.com
Sector size : 0x00000200
Extra data bytes : 0x00000000
OS IMAGE found.
Partitions infomation:
**************************************
Part-0 type: BOOT SECTION image
Part-1 type: XIP RAM Image
Part-2 type: IMGFS file system
Part-3 type: legit DOS partition
**************************************
Can not find compression signature.
Part-1 de-packing...
Successfully de-packed to xip.bin

inserting it back is with -c option, instead of -d.

NOTE: you DON'T HAVE TO know the XIP's address anymore!

Getting imgfs is the same:

C:\osnbtool>osnbtool -d os.nb 2 imgfs.bin

OS ROM Partition Tool V1.56 By Weisun :> PDAclan.com
Sector size : 0x00000200
Extra data bytes : 0x00000000
OS IMAGE found.
Partitions infomation:
**************************************
Part-0 type: BOOT SECTION image
Part-1 type: XIP RAM Image
Part-2 type: IMGFS file system
Part-3 type: legit DOS partition
**************************************
Can not find compression signature.
Part-2 de-packing...
Successfully de-packed to imgfs.bin

Changing the page pool:

C:\osnbtool>osnbtool -ap xip.bin 6.0

OS ROM Partition Tool V1.56 By Weisun :> PDAclan.com
Find "NKKD8" signature at offset: 0x0010E414
Find instruction at offset: 0x0010E6D4
Find PagePool Value at offset: 0x0010E6E4
Old value: 0x00400000(4MB)

Sure to modify it to 0x00600000 (6MB)(y/n)? y

New value: 0x00600000(6MB) written to offset 0x0010E6E4.

Again: it can find the proper signature on its own!

Plus some more possibilities, like splitting os.nb file from extra data:

C:\osnbtool>osnbtool -sp os.nb

OS ROM Partition Tool V1.56 By Weisun :> PDAclan.com
Sector size : 0x00000200
Extra data bytes : 0x00000008
OS IMAGE found.
Partitions infomation:
**************************************
Part-0 type: BOOT SECTION image
Part-1 type: XIP RAM Image
Part-2 type: IMGFS file system
Part-3 type: legit DOS partition
**************************************
It does not include .PRE section in source file.
-------------------------------------------------
Sector counters (extra-data) found in source file.
Partition 0 true offset:00000002 true size:000018FE Len:000018FE
Partition 1 true offset:00001900 true size:00001900 Len:00001900
Partition 2 true offset:00003200 true size:00019D00 Len:00019D00
Partition 3 true offset:00000000 true size:00000000 Len:0001D900
os.nb.OS.NB written.

or decrypting XOR ciphered image (like in Himalaya for example):

C:\osnbtool>osnbtool -x nk.nbf 0x20040304 nk.nba

OS ROM Partition Tool V1.56 By Weisun :> PDAclan.com
Unmasked to nk.nba
Sector size : 0x00001000
Extra data bytes : 0x00000000
OS IMAGE found.
Partitions infomation:
**************************************
Part-0 type: BOOT SECTION image
Part-1 type: XIP ROM Image
Part-2 type: IMGFS file system
**************************************

So... you see, it's a really powerful tool :D