yashsingh1/xdaforums huggingface dataset:
[Windows Mobile Software Development] Ameet:
Special Thanks

Abusalza (for the most initial start off guide)

Cmonex (for the “MOST” important finishing touches)

!Aman! (for all the testing and Hex edit helping)

Noonski (for being the inspiration to keep going :D)

Ervius (for developing the kitchen tool to perform all the operations)

In this forum there are many many tools from experts and likes for porting XIP, rebuilding dumped ROMs etc. This threads aims at showing or sharing what goes in the background of these automated tools and also aims at answering all the many unanswered questions about various factors of ROM cooking / editing I have come across in this forum

Suggestions / comments always welcome to make these tutorials even better :)

Index of Tutorials

Manual XIP Porting Guide: CLICK HERE

XIP Porting Updates from members: CLICK HERE

XIP Porting for Himalaya devices & others (Nokser): CLICK HERE

Misc XIP Updates: CLICK HERE

PagePool Changing Guide (for Diamond & Raphael): CLICK HERE

Gain More Storage Memory (Increase imgfs size) Guide: CLICK HERE

ULDR Partition Size Reduction Guide: CLICK HERE

MBR and MSFLSH50 Regions Screenshots: CLICK HERE

Gain More Storage Memory (compress imgfs) with LZX algorithm: CLICK HERE

Get High File System Index (!Aman!): CLICK HERE

Ervius's GUI kitchen thread to perform all operations, Noonski's amazing RunCC & AutoRun & SDAutorun tutorial thread

Ervius's post on patching nk.exe to change the EndRam address for more available RAM in device (original credits to cmonex :))

Da_G's amazing new initiative to utilise the ULDR partition to upgrade ROM without re-flash :)

All the above guides and updates are compiled in pdf file also for offline reading, attached in this post as All Guides.zip

The imgfs Gain.zip is actually the 5th guide with pictorial seperatly put up for members who would want to refer only to that process

The Pictorial.zip is the 7th picture reference for offline reading

Donations for this hard work and research are much appreciated. Below are the links whom you may choose to provide those to :)

Donation to Abusalza, Donation to Cmonex, Donation to !Aman!, Donation to Ameet

Index of Threads (Manila related)

Ameet's Mode9 script editing ideas thread

l3v5y's tutorial thread for editing Manila files

NisseDILLIGAF's Manila Hash tool
[Windows Mobile Software Development] Ameet:
Change PagePool through Hex editing (for Diamond & Raphael)

I'm putting this up here so to answer one more unanswered question about this especially for Diamond & Raphael ROMs

To change PP of Diamond ROMs

:

Open the OS.nb in Hex editing software

1. Go to offset 0x37AD68 to find 03 25 A0 E3 03 15 A0 E3 00 20 83 E5 hex string (If this string is not found at the 37AD68 offset, then search for this hex string)

Replace the string with 20 83 E5 with 00 A0 E1

This will make the string NOP (No Operation) meaning, the ROM wont set the PP to default 12MB but will allow the change in below offset

2. Now go to offset 0x3A7F94 to find E0 E2 04 80 00 00 60 00 hex string

again, if this hex string not found at the 3A7F94 offset, then search for the hex string. Just as a hint, this string is after the second NKKD8 (search for text string)

60 is the size of PP that you can now modify to suit your liking

e.g. I made mine 00 to get 0MB PP. Or change it to 80 to get 8MB PP, so forth and so on

With changing the first hex string and making the Kernel NOP, you can also use the tool to change PagePool and it does work

Also to make it a permanent change you can hex edit the first mentioned string in S000 of nk.exe module in XIP :) and then modify the PP with the program or by hex on OS.nb

To change PP of Raphael ROMs

:

Search for hex string: 03 15 A0 03 02 15 A0 13 00 10 82 E5 and change the last 4 bytes to 03 15 A0 03 02 15 A0 13 00 00 A0 E1 then the normal PP Changer tool will work

This is the 2nd string, ignore the 1st one coz that's in ULDR
[Windows Mobile Software Development] Ameet:
Screenshots of MBR and MSFLSH50 Regions

MBR Region

MSFLSH50 Region

Attached these images in Pictorial.zip with post #1 for offline reference
[Windows Mobile Software Development] Ameet:
Gain more Storage Space with LZX compression

Thanks to:

spocky12 for cecompr_nt.dll (attached)

ivanmmj for cecompr.dll (attached) This module supports LZX compression as well as the default XPR algorithm

Replace the cecompr.dll found in the OEMXipKernel (or whichever folder you have your XIP modules) with the attached cecompr.dll module that supports LZX compression

The LZX compression takes a load of your RAM while cooking which makes the continuing IMGFSFromDump tool crash. To avoid that replace the attached cecompr_nt.dll file found in “Tools/IMGFS” folder of your kitchen

Pause your kitchen process right after it extracts the IMGFS.bin and before it inserts the files into it. (A simple “PAUSE” in the batch file will suffice). Then open up your IMGFS.bin in hex editor of your choice and search for the string "XPR". Replace the FIRST one, FIRST & ONLY ONE with "LZX". Close the hex editor, save the file and let your kitchen continue with the cooking

After flashing the ROM cooked with this module should give you approx. 10MB more space in the storage memory ;)

Original Posts:

ivanmmj: http://xdaforums.com/showpost.php?p=3678382&postcount=877

spocky12: http://xdaforums.com/showpost.php?p=3690996&postcount=904
[Windows Mobile Software Development] Ameet:
Space for Donors

High value real estate space for donors for all my work on XDA ;)

Special Thanks

Piranha1 $5

Vippie $5

Steven Ellis $10

Guitarguy $5

Ckpv5 $5

Letama $10

!Aman! $5

LoriInWa $10

Noonski $15

Kevin $5

Dogmale $1

Nazaliyah $1​
[Windows Mobile Software Development] Ameet:
Miscellanous uploads related to XIP porting ;)

Kitchen Files

I use "DiamondKitchen_v0.4" kitchen to cook Diamond ROMs. The XIPInsert file is something that I made to automate the insertion and nbmerge process (well, something automatic is better than complete manual :D)

If you select to use the XIPInsert batch file then you must have DiamondKitchen_v0.4\XIP\xip_out.bin and DiamondKitchen_v0.4\XIP\OS.nb.payload to use this option, else the existing OS.nb file in \ROM folder will get deleted

Note: The insert values used in the batch file is for Diamond ROMs. Please check and edit these as per your devices

[B][U][I]!COOK.cmd[/I][/U][/B]
Modified to provide options to include the below batch file or to continue without it
Also included necessary warning

[B][U][I]8a.XIPInsert.bat[/I][/U][/B]
@echo off
cd [COLOR=green]XIP[/COLOR]
..\TOOLS\insert.exe -i [COLOR=green]xip_out.bin[/COLOR] -o [COLOR=green]OS.nb.payload[/COLOR] -d 0x00320000 -s 0x004C0000
..\TOOLS\nbmerge -kaiser OS.nb
copy OS.nb ..\ROM\OS.nb
del OS.nb
del *.payload
del *out.bin
exit

Deprotecting ROMs

: My friend, Ervius has made a small tool to "deprotect" a protected ROM ;), here: http://xdaforums.com/showthread.php?t=465642
[Windows Mobile Software Development] jcespi2005:
First to say THANKS ;)

Cheers
[Windows Mobile Software Development] ayyu3m:
and second to say this is real hard work...but u have done it bro.. :D

congrats
[Windows Mobile Software Development] Ather:
another amazing work by the XIP Master ;)
[Windows Mobile Software Development] KMFM$:
Thanks for sharing the info, ababrekar! I'm sure this will help out many people (myself included :D).
[Windows Mobile Software Development] Noonski:
Bite Down and Don't Give Up.

Sounds like someone i know from.... hey, it is you!

Good Job,
[Windows Mobile Software Development] !Aman!:
just to make it more clear, the value for "-s"= (starting offset of imgfs - starting offset of XIP)

PS: wonderful job writing this guide brother ;)
[Windows Mobile Software Development] boggsie:
Ouch - too much like work, but it is nice to know how to do it. :)

Thanks for your effort!

Best regards,

-boggsie

So, how does one get hooked into the flow of new releases? :D :cool:
[Windows Mobile Software Development] jcespi2005:
Perhaps would be a good idea to use one of your reserved posts as a repository of good XIP.BIN files with versions and info about the ROM extracted, so all we can use in our ROMs... only a tought...
[Windows Mobile Software Development] Ameet:
That is a good idea but I'll do that for posting the unedited XIP.bin files from dumped ROMs since the xip_out.bin I build would be for my device. People wont want to ruin their ROMs with someone else's ported XIP, right? :rolleyes:
[Windows Mobile Software Development] cruzzmz:
i use those tools too

but sometimes it is better to do manually (eventhough it will sometimes give u headache) ;)
[Windows Mobile Software Development] Ameet:
Maybe this thread can be visited by members who get errors porting with the XIPAddrTool (like me) or just to read n learn (not actually do it) what happens in the back stage :D
[Windows Mobile Software Development] cruzzmz:
i learned a lot here ... i am all in favor of this thread & everyday will visit to see what is new to be learn here ;)
[Windows Mobile Software Development] pfcsabre:
I'm confused about the o32 real_addr. Are they going to be changed evertime you change the e32_vbase? Or ONLY in cases like this:

802ac000 - 802bf0e4 L000130e4 o32 region_0 rva=00001000 vsize=000130e4 real=03dd9000 psize=000130e4 f=60000020 for FLASHDRV.DLL
802b72c8 - 802bf0e4 L00007e1c !!!!!!!!!!!!!!!!!!
802b72c8 - 802b82c8 L00001000 o32 region_1 rva=0006a000 vsize=00001351 real=01ffa000 psize=00001000 f=c0000040 for crypt32.dll

and before flashing do I also need to port the corresponding donor SYS or I can use my OEM SYS at the moment?
[Windows Mobile Software Development] omaga:
I can say the same, this a exellent thread! Great work ababrekar!! and thanks alot for ALL of your Guides, have learn so much from them
[Windows Mobile Software Development] Ameet:
It is not compulsary that the both addresses to have overlaps. Change only those which you can see !!!!!

Not necessary. Like mentioned use the Gwes.exe and XIP from same build if you are porting for VGA devices
[Windows Mobile Software Development] pfcsabre:
hehe.. well I'm trying to port blackstone XIP to Touch Pro and the XIP was successfully ported without !!!!, but didn't boot (only showed the radio and didn't continue) so I've asked if I also need to port the Blackstone SYS before flashing it to test. What is the workflow though on successful ROM porting? Is it something like:

port XIP, flash, test

if booting, port SYS, flash, test

if booting, pick OEM, flash, test

if booting, optimize OEM, flash, test

if booting, do special, secret (boy, I really have to say this! :D) tweaks, flash, test
[Windows Mobile Software Development] lennysh:
Why are so many ppl reporting problems with the 20757 Build from the Blackstone. I've not had any problems porting it to I think 4 diff devices now. 2 more that I gave somebody else cause I do not have those devices. That SYS isn't much diff other than doing the same thing of replacing the RES 480x800 packages with 480x640 ones.

Do I need to make you an XIP to test with?
[Windows Mobile Software Development] pfcsabre:
I would appreciate if you could give me the final OUT folder from this to see what I'm doing wrong :) Please also delete osaxst0.dll, hd.dll and bmui.nb0 so I can make comparisons :oAttached is the XIP from BlackStone (OUT_NEW folder) and the XIP from Touch Pro OEM from RUU_Raphael_HTC_WWE_1.90.405.1_Radio_Signed_Raphael_CRC_52.33.25.17_1.02.25.19_Ship(OUT folder).

Here's the link: http://rapidshare.com/files/162802825/XIPPort.zip.html

EDIT: And by the way, I'm using XIPAddrTools to change the addresses-- so maybe that why...
[Windows Mobile Software Development] lennysh:
See attachment below:
[Windows Mobile Software Development] pfcsabre:
just got home, checking it now... thanks! :)

EDIT: Compared your port to mine and it has difference on two files:

Did you use the kd.dll and osaxst1.dll from the OEM ROM?
[Windows Mobile Software Development] evalu8t0r:
Sorry, I'm an ass... In the future I'll try not to post when I'm tired...

Rommaster is the way to go...

RomMaster.exe x -w 5 -b 0x320000 OS.nb.payload -o xip.bin
[Windows Mobile Software Development] Ameet:
You can delete both those modules without any issues ;)
[Windows Mobile Software Development] evalu8t0r:
The newest I can find
[Windows Mobile Software Development] lennysh:
I only replaced the MSXIPKernel folders.
[Windows Mobile Software Development] boggsie:
Are you able to use the older version or the newer 32k version?

Best regards,

-Mark
[Windows Mobile Software Development] pfcsabre:
I've tried it, and it didn't boot :D reduplicate lennysh xip mapping and it work :) Thanks for the xip! I'll play more with it :cool:
[Windows Mobile Software Development] lennysh:
Did you doubt my XIPKitchen?
[Windows Mobile Software Development] Ameet:
Hmm. Maybe you also need to realloc the other modules once these are deleted :D

I always remove these and a few more without any issues to get the xip size to minimum. With Htctouchp's study of removing the ULDR, I think soon we may be able to see an addition to this guide which will be related to getting the max from your ROM ;)
[Windows Mobile Software Development] pfcsabre:
Ha! not in a hearbeat ;) But you did it and I didn't and it needs to be done by me so I would know my mistakes :D Hopefully your tool will minimize it :rolleyes: An "ein mass" beer for you when you've finally release your tool. Cheers!
[Windows Mobile Software Development] cruzzmz:
xip 20931

dunno if anyone hv tis yet ... just wanna share :D

happy head cracking ;)
[Windows Mobile Software Development] Ameet:
Was actually waiting for this upload somewhere else :D Thanks bro :D
[Windows Mobile Software Development] cruzzmz:
no prob ... sharing is caring ;)

happy !!!!!!!!!! hunting
[Windows Mobile Software Development] KMFM$:
Exactly! We're just glad you cared enough to share. ;)
[Windows Mobile Software Development] pfcsabre:
lalalaaaaaa.... another sleepless night of tweaking :D thanks cruzzmz!
[Windows Mobile Software Development] Ameet:
Ok Guys. I did change the size of ROM in G'Reloc to 83400000 from 83000000 and increased the ulRAMEnd to the same value (83400000) getting free RAM space of L0306C000 (I dont know how to translate this into the actual size in % or in bytes) but with the original of 83000000 the RAM space was L02C6C000

Having done this, I get about 62% free memory without TF3D and approx 54% free memory with TF3D

I need confirmations that this works on Diamonds before adding it to the first page ;)

Also, anyone figured out yet how to remove the ULDR? I'll add that too to first page

Thanks cruzz, Aman :D
[Windows Mobile Software Development] KMFM$:
Great job, ababrekar! Hopefully someone can confirm this. I wouldn't mind seeing what I can squeeze out of my kaiser. ;)
[Windows Mobile Software Development] Zecanilis:
First off all thank you ababrekar for your TUT... Now i'm starting to understand the process of porting a XIP, all thanks to you... :D

I successfully ported xip 19972 and 19974 to my LOVE.

But for two times now, i didn't had success...

With XIP 20757 and 20931 I've done everything and cooked it into a ROM. It booted OK, but with no phone... It says that doesn't find any wireless connection...

In this moment i'm just cooking new xips only... All the other stuff is the same...

My quest is if someone can port XIP 20931 to Artemis, so i can compare and try to understand what is happening...

Here are the files:

http://www.4shared.com/file/71229956/2c8d57c6/xip_ORIGINAL_ARTEMIS.html

http://www.4shared.com/account/file/71229961/99c491a6/xipnew_20931.html

Thank you
[Windows Mobile Software Development] cruzzmz:
good job AB

do tell us how 2 do the resizing
[Windows Mobile Software Development] anryl:
I did look at the files there are missing some in the new xip so try to get new source for u new xip

i did not see initvmmap.exe as this might be your problem though :cool:
[Windows Mobile Software Development] Ameet:
I simply ran G'Reloc and modified the size of ROM from 83000000 to 83400000 and change the ulRamEnd to 83400000 in ROMHDR.txt ;)

Am wanting to change the PP to 0MB. Any heads up on this can be done?

@Cruzz. The xip.bin you posted is edited? Even I saw the missing items in that file and the device didnt boot so I used the OUT folder given by Htctouchp
[Windows Mobile Software Development] cruzzmz:
yup i think so since it was for zinc. maybe sharing the htptouch out folder is better :)
[Windows Mobile Software Development] lennysh:
Heres the official XIP 20931 without any missing files.
[Windows Mobile Software Development] cruzzmz:
cool man cool :D

anybody any luck wz the WWE SYS folder, rgu? (Sorry AB if tis is OT)
[Windows Mobile Software Development] Zecanilis:
Will try out that one... :D

Thank you

EDIT : If i delete hd.dll and osaxst0.dll XIPPort gives me not enough space error... :|
[Windows Mobile Software Development] Ameet:
I simply replaced the rgu entries from my previous rom and the mui files with the 0409 muis. Working cool :D

Not possible. If you delete those modules then you should have more space to play around ;) Try again :D
[Windows Mobile Software Development] Zecanilis:
Try it then please...

This is my out folder.

This one i've deleted hd... and osa...

http://rapidshare.com/files/163457861/OUT.rar.html

This one i didn't deleted anything...

http://rapidshare.com/files/163459051/OUT2.rar.html

Cheers
[Windows Mobile Software Development] Ameet:
Something's wrong with this OUT folder. Something's edited. The busenum.dll is not written properly since after making pfgs the contents of this module is outside. Moreover boot.rgu is missing in OemXip Files
[Windows Mobile Software Development] Zecanilis:
I can't understand why...

I used same base for 19972 and 1974 buils and all went well.

boot.rgu is in Out\Files folder... Shouldn't it be there?

And i am using this 20931 XIP now... http://xdaforums.com/showpost.php?p=2901440&postcount=207

Thanks for your help again...
[Windows Mobile Software Development] anryl:
TRY THIS tools for realocking bad modules :D

move modules with the txt then move the created back

remove hd and osaxt dll and txt

dont relock nk.exe

afther that xipport working fine
[Windows Mobile Software Development] Ameet:
Guys. Just inserted a post 4 in this thread with the hex editing method to change default PP of Diamond ROMs ;)
[Windows Mobile Software Development] hellonasty:
Hi guys

great job here!!!!

I wait my Diamond repaired... :mad:

Im back!!!! :D
[Windows Mobile Software Development] Zecanilis:
Nice tool.. :D

Thank you! No more calculator for me... :p

I've discovered that if i delete hd.dll, osax.. and mencfilt.dll, then it doesn't give the not enough space error anymore...

Resuming:

1st test : With all files -> No error

2nd test: Without hd.dll and osaxst0.dll -> Not enough space error

3rd test: Without hd.dll,osaxst0.dll and mencfilt.dll -> No error

I saw that at my base xip there is no mencfilt.dll, only encfilt.dll. And on the DONOR xip there isn't encfilt.dll.

But saw at the first post that mencfilt.dll and encfilt.dll are not needed...

So, i'm ready to cook yeah? :cool:
[Windows Mobile Software Development] cruzzmz:
uhuuuu good luck man cooking ur rom ;)

(m)encfilt.dll = storage card encrypting
[Windows Mobile Software Development] Ameet:
Even if you wish to include those modules, play around with the physlast value to make more space for all the modules to fit in. Later post porting, reet the value to correct
[Windows Mobile Software Development] Zecanilis:
XIP 20931 successfully ported... :D

I changed my base XIP and no more "not enough space" error. :D

Running well on my LOVE.

Thank you for all your help.

Cheers
[Windows Mobile Software Development] 1tester01:
Changing Diamond pagepool

Which ROM did you use for os.nb?

Because i couldn't find this second part on a Dutty v2.9, v3 rom or an official dutch htc rom and it seems also different compared to what other chefs did.

http://xdaforums.com/showthread.php?t=442489

The Diamond pagepool is still a mystery for me... :(
[Windows Mobile Software Development] Ameet:
I used it on my own cooked ROM (20934 build) Try searching for the hex string from E0 to 00 (remember, its the one near the 2nd NKKD8 in text string)
[Windows Mobile Software Development] evalu8t0r:
Of RomMaster? it's 147.456 bytes and looks like it's from november 2005
[Windows Mobile Software Development] cruzzmz:
As far as i know, there r only a version of rommaster the 148kb but there r 2 version of dumprom though
[Windows Mobile Software Development] Ameet:
There are 2 versions of RomMaster too. The latest is V2.3
[Windows Mobile Software Development] cruzzmz:
uhuu didnt know that .... thx for the info ;)

what is the changelog?
[Windows Mobile Software Development] Ameet:
K Guys. Guide to reduce the space between XIP & imgfs partitins and to use that space in storage memory added on first page ;)

Boy!! These days I'm hijacking my own thread :D
[Windows Mobile Software Development] kokotas:
Ameet,

I already personally thanked you for the last guide, but I forgot to ask you something..

You're refering to some reg entries:

If I have removed the ULDR, then should I change those entries too?

Regards!
[Windows Mobile Software Development] Ameet:
:) Got your wishes brother :)

You dont need to edit the boot.rgu since we are not changing the flag offset of the partitions types. The hex values mentioned in boot.rgu are only the FLAGs indicating the type of the partition, kind of telling the OS which partition is what in MBR :D

Although you may not have the hex: 04 in 1F2 since Elfins dont have the part03 ;)
[Windows Mobile Software Development] kokotas:
Thanx again for the clarification:D

I got it now!
[Windows Mobile Software Development] !Aman!:
not quite correct :D

those values are not starting offsets of the partitions. each of those HEX values is like a FLAG indicating the type of the partition.
[Windows Mobile Software Development] Ameet:
Ok my master :D Edited the above post and also the first page ;)
[Windows Mobile Software Development] cruzzmz:
I have pm Ameet but then he asked me to post here to get more clear idea ...

I have ported rose xip to cavalier & have made the xip_out.bin

my q is how do i use the insert.exe as in in the tutorial

from imgfstoNB from cavalier i got

i just want to know the -d

value

& -s

value

TIA
[Windows Mobile Software Development] !Aman!:
both these values depend upon the starting offset of the XIP. if u are unsure about that, check the MBR, you can find it there.
[Windows Mobile Software Development] cruzzmz:
how do i check my MBR?

and do i have to check it on the ori wm6 rom os.nb.payload?

BTW

does the MBR can be found in the below reg?

[HKEY_LOCAL_MACHINE\System\StorageManager\Partition Table]
[Windows Mobile Software Development] !Aman!:
no, MBR is not in the registry. open your payload file in HEX editor. MBR starts from offset to 0x0 upto 0x1ff.
[Windows Mobile Software Development] Ameet:
So the size of XIP will be number of sectors * sector size

e.g. (if the no of sectors in lil endian) 0640 * 800 (sector size for diamonds) = 320000

This value shall be the -s in insert and the start of the XIP will be

imgfs start + -s = XIP start
[Windows Mobile Software Development] cruzzmz:
the payload will be on the ori WM6 rom?

or

on my cooked rom?
[Windows Mobile Software Development] !Aman!:
yeah, thats also correct. but u still need to read the MBR :D
[Windows Mobile Software Development] Ameet:
The one that you are using as template to cook your ROM
[Windows Mobile Software Development] cruzzmz:
ok if that is the case is it save to use my template rom ( sys frm wm6.1 frm BJ2). Is that correct?

Can i just use my cooked rom?
[Windows Mobile Software Development] Ameet:
Yes the template payload which you are using to cook your ROM

I started using my own cooked ROM payload as template since last time I dumped my earlier cooking, found that many folders re surfaced which I didnt want
[Windows Mobile Software Development] cruzzmz:
here what i have ... from my cooked rom

Care 2 advise???

So i can use my cooked rom for the payload?