yashsingh1/xdaforums huggingface dataset:
[Windows Mobile Software Development] Calkulin:
How can this be fixed? I can manually reallocate in the imageinfo.txt but when I press realloc P in XipPort, it restores the old values and if I build the xip_out.bin by only pressing write maps only with the corrected values, it doesn't boot, so what can I do to fix this?

Now

80252000 - 80252f43 L00000f43 o32 region_0 rva=00001000 vsize=00000f43 real=03e65000 psize=00000f44 f=60000020 for regenum.dll
80252f44 - 80253f44 L00001000 o32 region_1 rva=0006a000 vsize=00001351 real=01ffb000 psize=00001000 f=c0000040 for crypt32.dll
80253000 - 80253f44 L00000f44 !!!!!!!!!!!!!!!!!!
80253000 - 80253068 L00000068 o32 region_2 rva=00003000 vsize=00000068 real=03e66000 psize=00000068 f=40000040 for regenum.dll
80253068 - 80253f44 L00000edc NUL
80253f44 - 80255144 L00001200 o32 region_1 rva=0003c000 vsize=0000b1c4 real=0004c000 psize=00001200 f=c8000040 for filesys.exe
80255144 - 80260144 L0000b000 filedata boot.hv
80260144 - 80267144 L00007000 filedata mxip_lang.vol
80267144 - 8026e132 L00006fee filedata boot.rgu
8026e134 - 80271ad9 L000039a5 filedata sysroots.p7b
80271adc - 80272df0 L00001314 filedata 4f5b030b-10a2-c083-de45-5eb90bff5900.dsm
80272df0 - 80272df0 L00000000 End: highest physical address

Should be like this

80252000 - 80252f43 L00000f43 o32 region_0 rva=00001000 vsize=00000f43 real=03e65000 psize=00000f44 f=60000020 for regenum.dll
80252f43 - 80252fab L00000068 o32 region_2 rva=00003000 vsize=00000068 real=03e66000 psize=00000068 f=40000040 for regenum.dll
80252fab - 80253fab L00001000 o32 region_1 rva=0006a000 vsize=00001351 real=01ffb000 psize=00001000 f=c0000040 for crypt32.dll
80253fab - 802551ab L00001200 o32 region_1 rva=0003c000 vsize=0000b1c4 real=0004c000 psize=00001200 f=c8000040 for filesys.exe
802551ab - 802601ab L0000b000 filedata boot.hv
802601ab - 802671ab L00007000 filedata mxip_lang.vol
802671ab - 8026e199 L00006fee filedata boot.rgu
8026e199 - 80271b3e L000039a5 filedata sysroots.p7b
80271b3e - 80272e52 L00001314 filedata 4f5b030b-10a2-c083-de45-5eb90bff5900.dsm
80272e52 - 80272e52 L00000000 End: highest physical address
[Windows Mobile Software Development] _fm:
yes it could, it was just wrong address,.

see ameet #2 / #3 post about how to change it,.
[Windows Mobile Software Development] ervius:
if you use xipporterex, and put into "old xip", and "new xip", same xip.bin, you can easly reallocate it, and into "xip_out.bin", you'll never see the overlapping "!!!"

bye!
[Windows Mobile Software Development] Calkulin:
Actually that is what I get using your tool, if you look, your tool is writing the same start address for regenum.dll & crypt32.dll, with crypt32.dll being wrong but this is the first time it does that using it, I've tried multiple new sys xips & old xips and all always write that overlap. I havent tried to downgrade to a older revision to see if that helps. But since your tool is not writing it correctly, how can I fix that?
[Windows Mobile Software Development] ervius:
that seems strange, becouse greloc.exe relock all modules, so crypt32 and regenum too, and reallocing P, only have to dispose then modules one after one, following the greloc guide, and I've tested a lot of xips, and never had an overlapping on modules.

Give me your old/new xips, so I can check them and confirm or not all you wrote above.
[Windows Mobile Software Development] Calkulin:
Here you go

XIPs
[Windows Mobile Software Development] ervius:
well.....

new xip, is overlapped also untouched, I don't know where you found it, but maybe is a protected xip, infact in more modules, you cannot find last S00x, compare old and new xips, you'll find in more and more modules, that new modules have less s00x, Maybe is from a bepe rom, or someone else that protect his roms, in IMGFS and also into XIP, You cannot port that xip.bin in other devices than the original device for witch it was builded, so, is not a problem of mine, or of my app, or of the tools included to realloc all modules into xip, it cannot be reallocked, sorry..... you have to use another xip, (maybe original new xip is better than that you posted!)

bye!
[Windows Mobile Software Development] :
okay, any reason why if I try and use your tool to extract the xip from the os.nb.payload. it will not boot when i try that.

But if I take it out manually it will boot. any ideas?

not a big issue, i got it anyways, but might be something to look at.
[Windows Mobile Software Development] Calkulin:
Well, I finally found another donor 20954 xip which worked, so I guess those 5 that I tried, all came from a bepe kitchen or something, cause all did the samething but now it's up and running. One suggestion tho, you should really think about reallocing the nk.exe also with your program, to maximize the RAM, even tho it only takes a couple of mins to do but it would be nice if it was automatically done when porting
[Windows Mobile Software Development] ervius:
no problem found creating it, (yours "auto" xip.bin had problems!), try my last exe revision *24*,

here:

bye!
[Windows Mobile Software Development] ervius:
I think is great to have a tool that port xips for you, and all full working, to manage some cosmetics else inside xip_out.bin, you can also redump it and adjust all that you want by hands ;)

bye!
[Windows Mobile Software Development] :
Thanks, your tools are great, and thank you for this. But yeah not really sure why that happen. the auto xip i posted above was, using your tool. and that is what it created. so yeah. Thanks for the fix though.
[Windows Mobile Software Development] Ameet:
attached the rev 24 tools to ervius's post ;)

hey calcu, from ppcgeeks? hope the new xip worked for you :) although it seems the protected xip was showing overlaps in the copyentries
[Windows Mobile Software Development] ervius:
at post #9:

http://xdaforums.com/showpost.php?p=2813417&postcount=11

new version, revision24 with included payload_importer, (the revision 22 attached to the post was malformed, ameet, forgot, or deleted the ".VM" and ".ROM" modules inside, and greloc was unable to realloc well the xip modules!)

try it!

bye!
[Windows Mobile Software Development] Ameet:
Oh goody :D Thanks brother. I was actually using the rev 22 very nicely. been out of the kitchen and till 2nd jan :) Will test the rev 24 too later. Thanks again
[Windows Mobile Software Development] Calkulin:
Yeah, that's me and I finally was able to get a good donor 20954 xip to port over and as usual using ervius tool, I ported it over and had a running ROM in about 10 mins(would of been like 2-3mins but had to redump new xip to realloc the nk.exe, etc). So as always, thanks ervius for the tool and Ameet for the guide
[Windows Mobile Software Development] ervius:
revision 25, added button (after xip porting!) to realloc ".VM" into \SYS folder, according to the xip's ulRAMEnd, so you can use a complete \sys folder from any device , no more have to keep your original ".VM" and ".ROM" into \sys from your original device, can use all \SYS folder from any other, only have to realloc it with my xipporterex!!!

bye!

ervius!!!
[Windows Mobile Software Development] Ameet:
Great!! :) Actually since you are trying to combine the kitchen and porting tool, I suggest you make the tool read and adjust the nk.exe as per the .VM values and not from ulRamEnd. Since this will then get the xip more space for free ram space ;) And the .VM can be adjusted manually in GReloc. Better yet right now, great job brother :D
[Windows Mobile Software Development] ervius:
about nk.exe reallocking etc..., I tryed some times, with no success, maybe understood bad about, but, If I try and work then, I insert the "trick" into tool, if doesn't, I cannot insert trick into...., maybe you have to explayn me better, around nk.exe reallocking..... ;)
[Windows Mobile Software Development] Garfiel:
Hello

I need help.

I'm exporting XIP to HTC Touch Pro. I make all de steps using XIPPorter. When I get the final edited OS.nb.payload, I make the following 2 steps to get the Os.nb:

- insert.exe -i xip_out.bin -o OS.nb.payload -d 0x00320000 -s 0x004C0000

- nbmerge -kaiser OS.nb

and I get the OS.nb file.(which incidentally is less than the original megas).

My problem is when I run the Erviuskitchen, starts to cook but then gives me a problem with imgfs. I leave with you a better catch for you shall see what happens.

What am I doing wrong?

Thank you
[Windows Mobile Software Development] ervius:
I have to analyze the payload builded, but maybe appen that you have a xip.bin larger than the space reserved to it into payload and maybe you wrote, writing xip.bin into payload, the IMGFS header, so imgfs tools cannot find the IMGFS header, make payload larger, using "ROM TOOLS tab into my xipporterex (give from xip_out.bin), reduce payload (in this case you'll enlarge payload file!) and use it then to write into xip.bin (or xip_out.bin), try this way, I'm shure (not at 100%, but.....) that you'll solve the problem......

P.S.: another little apps was born: "ROM_Deprotector".....

here:

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

TODO on xipporterex: Adding pagepool-changer onboard ;)

happy new year...... ;)
[Windows Mobile Software Development] Ameet:
Holy Batman!! :D Great job my brother :D You are really on fire. Keep up the great works. A quick description of how the tool works would be great, just to know the background the tool works on (just for knowledge) Linking this to first page in misc updates :)

and wish you all a VERY VERY VERY HAPPY AND PROSPEROUS NEW YEAR!!!! :D
[Windows Mobile Software Development] ervius:
the tool can deprotect some protected roms, not all ;) but in some cases can help, if nb or payload cannot be dumped, becouse IMGFS Signature was destroyed, it reconstruct IMGFS Header and referece, so after it you are abvle to dump the nb or payload

bye!
[Windows Mobile Software Development] ervius:
UPDATE

:

Revision 26(only exe attached!), added button (after or while xip porting!) to change PagePool value, or inserting preferred value, you can also change it into preferred payload by pressing relative button on right groupbox!

enjoy here:

http://xdaforums.com/showpost.php?p=2813417&postcount=11
[Windows Mobile Software Development] MickyMax:
ervius, do you sleep sometimes ? :)

Maybe can you add date changer too ? ;)
[Windows Mobile Software Development] Ameet:
Yes. Thats from the original XIP

Hey C. After deleting those modules which you mentioned are safe to be removed, I reloced all the addresses to remove the NULL from in between. Here's the new MAP.txt. I was wondering if we could put all the NULL space in the XIP to some good use either in program memory or the storage memory. Also I increased the Physlast from "803E0A34" to "803E0FFF" (ulRAMStart: R=803E1000 - 1) Would this help me gain some speed or stability?
[Windows Mobile Software Development] cmonex:
if you mean the NULL for the addresses that you relocate for the modules (0x01xxxxx / 0x03xxxxxx), then yes, as i said you can change .VM values to leave more memory for imgfs(and in xip might want to edit dllfirst to be a higher value and). maybe easier to explain through some example, so what about you give me the .VM values for your imgfs

and eventually if you manage to save some space in the 0x01xxxxx range in imgfs, you will have more virtual memory for the running processes (EXE's) in your system. helps stability for sure.
[Windows Mobile Software Development] KMFM$:
THANKS!!!

Just successfully completed a full port, manually!! Thanks for all the hard work and time put into this, ababrekar. I also want to thank everyone else that was involved with this thread and helping ababrekar complete this guide. This is the kind of knowledge and team spirit that makes XDA-Dev's a wonderful place to visit. :D

Now, just to find a way to simplify the process (and possibly speed it up). ;) :D
[Windows Mobile Software Development] abusalza:
Original XIP

Ok all...

here's my original xip dumped from polaris and opal.

Maybe you need it;)

ps: Opal build 19971, Polaris build 19965
[Windows Mobile Software Development] KMFM$:
This is where I hit a road block as well, mbarvian. Simply click "undo" in XIPPort to break down all of the packages. It worked from there on for me. :D

One thing I did notice, though, that I thought was kind of weird. I'm using Kaiser 3.29 shipped as a base and am porting Opal XIP. When I wrote the map, the

only

sign of an overlap (!!!!!!!!!!!!!!) was in the virtual base. There was no signs of overlap in the o32_realaddr spaces at all :eek:. I don't know, I just would assume that an overlap in the one area would also make it overlap in the other. Though, I still did the calculations for the o32_realaddr and o32_vbase, however, they were all ready correct. :eek: I continued on with the guide and successfully booted the new XIP, though it required two soft resets to get all the way up to a full working state (first soft reset was required at "clearing storage" screen. Second was at the today screen where "user customization" takes place.) I successfully ported the Opal SYS earlier and used it successfully in hybrid build.

Also, after M'relocing the necessary files and checking the map, I found null markers in the file at the places where I had to realloc files. I've attached the map file so you can see what I mean.

I'm going to re-port the SYS from scratch again to make sure I didn't screw anything up with that.
[Windows Mobile Software Development] Ameet:
Hmm. KMFM is right above. XIPPort needs to open the packages to re calculate the addresses for writing maps

Thats ok, there is no compulsion that if the higher e32 has overlapping then the o32 should also have it :)

As I can see from your map.txt, you must have deleted some modules (for whatever reasons :))

for example

[COLOR=red]02000000 - 03a55000 L01a55000 NUL[/COLOR]
03a55000 - 03a5e000 L00009000 Virtual base address of wce_rex.DLL
[COLOR=blue]03a5e000 - 03ae5000 L00087000 NUL[/COLOR]
[COLOR=seagreen]03ae5000[/COLOR] - 03aea000 L00005000 Virtual base address of MMMAP.dll
[COLOR=blue]03aea000 - 03b35000 L0004b000 NUL[/COLOR]
[COLOR=seagreen]03b35000[/COLOR] - 03b3c000 L00007000 Virtual base address of htcfsfilter.DLL

Now, the red NUL space is about something that I have asked Cmonex if we can change the ROMHDR to use that space. Blue is where you have deleted the modules ;) So I suggest work your way up from bottom and change the green values to reflect no NUL space. Calculations for the same is similar to what you would do to correct the overlapping
[Windows Mobile Software Development] cmonex:
that will never boot, the addresses should end in 000 (divisible by 0x1000) and you need to use m'reloc-nk if you want to move nk.exe sections. I also wasn't talking about that address range (8xxxxxxx) when talking about .VM. (I'll reply in more detail soon)
[Windows Mobile Software Development] anryl:
YOUR the best m8 kant wait for you next info as post 24 really big help . did managed relocate the nk.

As for the remapping virtual and dll im using xipadresstool . it is buggy for remaping nk.exe. but for remaping new modules to original places it uses mreloc

so you can better see all the maps

so i'm using xipport to dump xip then replacing ms moduls and ms files

open xippadresstoll work folder is OUT refference folder is original or my last good xip . on first screen the red all realoc with space it will mreloc the problems

then xipport realoc write maps

then again xipaddrtool to move modules in second and third screen

then xipport realoc write maps

and go to manualy edit last dll start off ram in romhdr ( nice number xxxx000)

then xipport realoc write maps and manualy edit nk.txt - then mrelocnk (thnx cmonex as i forget that :D )

again xipport realoc write maps --- change startfree ram

and last xipport realoc write maps build xip_out

then usual insert -i xip_out.bin -o OS.nb.payload -d 0x00320000 -s 0x00350000

nbmerge -kaiser os.nb

htcrt -- os.nbh

pagepool changer to change info and date and page pool

nbhextract os.nbh

os nb working for my kaiser

build rom is working :cool:
[Windows Mobile Software Development] cruzzmz:
done that ... now got new error of not enough space ... even though have del the files like u suggested ... hv to change the psylast i think ... but then there is a module or file that i think is out of place? suppose to be before End: highest physical address

Got everything sort out now ... just that my concern is still the above file ... now it sits

ehmmmm
[Windows Mobile Software Development] Ameet:
80411fa4 - 80411fa4 L00000000 End: highest physical address

This is the physlast value that you can increase to contain all the modules within. Then you can play with the max value once you are through with the reallocing

Normally, the 723*.dsm doesnt go in the RAM free space in case if thats what troubling you in writing the maps. Suggest you redo the dumping of original and new xip.bin
[Windows Mobile Software Development] anryl:
here are the maps for kaiser :cool:
[Windows Mobile Software Development] cruzzmz:
ok ive been playing wz the psylast ... and i think i got it all sort out ... the last part of MAP.txt

but then the location of 723*.dsm is still bothering me ... do u think it is ok?

if i do the dumping of new & old, i still get the same result ... any suggestion?
[Windows Mobile Software Development] cruzzmz:
Cool ill try to flash it up ... then ill get the same xip ver that u showed me :D

NUL spaces??? i got a few of those too
[Windows Mobile Software Development] anryl:
start off ram free space - where the memory is starting and how big is it free by cool start. that is the null

802ab000 - 802ab000 L00000000 ------ start of RAM free space
802ab000 - 83400000 L03155000 NUL (still not found any answer on why this is needed or how much is the minimum that is to be maintained)
- free RAM (MEMORY) so i try to get as much as possible
83400000 - 83400000 L00000000 End: end of RAM

original kaiser

80304970 - 80305c60 L000012f0 filedata 3174b293-abb8-d934-b13c-77f0d46081c2.dsm
80305c60 - 80305c60 L00000000 End: highest physical address

80305c60 - 80306000 L000003a0 NUL

80306000 - 80306000 L00000000 Start: start of RAM
80306000 - 80307000 L00001000 initialized data of region_1 hd.dll
80307000 - 8030b000 L00004000 initialized data of region_1 osaxst0.dll
8030b000 - 80310000 L00005000 NUL
80310000 - 80316000 L00006000 uninitialized data of region_1 nk.exe
80316000 - 8033b000 L00025000 initialized data of region_2 nk.exe
8033b000 - 8033b000 L00000000 ------ start of RAM free space
8033b000 - 83400000 L030c5000 NUL
83400000 - 83400000 L00000000 End: end of RAM

modified 20759

8027eff4 - 8027ffee L00000ffa filedata 723fb954-d931-4348-b672-82a188e587b5.dsm
8027ffee - 8027ffee L00000000 End: highest physical address

8027ffee - 80280000 L00000012 NUL

80280000 - 80280000 L00000000 Start: start of RAM
80280000 - 80286000 L00006000 uninitialized data of region_1 nk.exe
80286000 - 802ab000 L00025000 initialized data of region_2 nk.exe
802ab000 - 802ab000 L00000000 ------ start of RAM free space
802ab000 - 83400000 L03155000 NUL
83400000 - 83400000 L00000000 End: end of RAM

increased FREE MEMORY L03155000 from original L030c5000 :D
[Windows Mobile Software Development] Ameet:
What Anryl is trying to do here is (what I can make out of it :))

01f901fd - 01f901fd L00000000 Start: first DLL address
[COLOR=red]01f901fd - 01fdf000 L0004ee03 NUL[/COLOR]
01fdf000 - 01fe1000 L00002000 initialized data of region_1 wce_rex.DLL

Realloc the wce_rex.dll to make it use the NUL in the realaddr above

01ffd000 - 01ffe000 L00001000 initialized data of region_1 certmod.dll
[COLOR=red]01ffe000 - 01fff000 L00001000 NUL[/COLOR]
01fff000 - 02000000 L00001000 initialized data of region_1 busenum.dll
[COLOR=blue]02000000 - 02000000 L00000000 End: last DLL address[/COLOR]
02000000 - 03e14000 L01e14000 NUL
03e14000 - 03e1d000 L00009000 Virtual base address of wce_rex.DLL
03e1d000 - 03e22000 L00005000 Virtual base address of MMMAP.dll

Realloc the busenum.dll to make it use the NUL in the vbase above

Change the dlllast value in ROMHDR.txt to take it above (02000000) and realloc the modules in the higher addresses (03xxxxxxx) (and also maybe change the dllfirst values to leave out more NUL spaces)

I cant confirm if the below can be modified in any way to use the NULs below

03fe1000 - 03fef000 L0000e000 Virtual base address of certmod.dll
03fef000 - 03ffa000 L0000b000 NUL
03ffa000 - 04000000 L00006000 Virtual base address of busenum.dll
[B]04000000 - 80000000 L7c000000 NUL[/B]
[B]80000000 - 80000000 L00000000 Start: first physical address[/B]
80000000 - 80001000 L00001000 RomLDR.PARTHDR
80001000 - 8006ddd4 L0006cdd4 o32 region_0 rva=00001000 vsize=0006cdd4 real=80001000 psize=0006cdd4 f=60000020 for nk.exe

But I think you may be able to do it by changing the Physfirst and Physlast values. But I dont know where to edit the rva values in the modules, so wont comment on it right now

Also if the below can be modified to get more free RAM space

[B]8027ffee - 8027ffee L00000000 End: highest physical address[/B]
[B]8027ffee - 80280000 L00000012 NUL[/B]
80280000 - 80280000 L00000000 Start: start of RAM

And then finally at the bottom

[B]802ab000 - 802ab000 L00000000 ------ start of RAM free space
802ab000 - 83400000 L03155000 NUL
[/B][COLOR=blue]83400000 [/COLOR]- 83400000 L00000000 End: end of RAM

Maybe Cmonex in her post #24 mentioned something about reallocing the .VM and increase the ulRAMEnd: 83400000 to increase the free RAM space

can you confirm this Anryl? :)
[Windows Mobile Software Development] anryl:
just tried on 20921xip sys -- (from you port's V7 :D )

free memory no programs 54 with m2d off m2d on 49.25 nk.exe on 31 but start ram moved

ulRAMStart: R=802C0000
ulRAMFree: 8033B000
ulRAMEnd: 83400000

without modification the ram free is less
[Windows Mobile Software Development] :
very very nice. i was just reading aobut porting the XIP, i dont want the patch, that is easy to do and like you say, it is just a number. then i came across this, and i have to say very very nice work on this. it looks like a lot of hard work, and a giant headache when you get done, but thank you so much for this, it will help me out a lot.

just curious you have any luck with 20924 yet? i was trying for a lilttle but, but cant seem to get the sys and xip to boot up.

I will take a look at it later for now 20775 will work.

once again thanks for this awesome tutorial.
[Windows Mobile Software Development] Ameet:
:) Thanks conflipper. As you mentioned, it was indeed giant giant headache especially for a person who is not at all from any software background :D But yes, experts were very very helpful. I've simply compiled and posted all the info that I got from them

I have been on 20924 full sys & xip port since past week and not had any issues with anything. In fact the figures posted in post #3 are from this build ;)
[Windows Mobile Software Development] Ameet:
No Cconfusion mate :D

Now read carefuly, here's what needs to be done. You need to take care of the overlapping !!!!!!!!!!!!!! As per your PM, I'll explain a bit in colors, so pay attention :)

In Hex calculator do this calculation: e32_vbase - e32_vsize = e32_vbase

meaning: 03dbe000 - 7000 = 03db7000 (new e32_vbase address for smem.dll)

similarly

03db7000 - 9000 = 03dae000

Do ask if in doubt :)
[Windows Mobile Software Development] Garfiel:
Another question, when I run XipporterEx, it makes my and new error when I run "DO IT":

"Displacement and length are off limits for the parent or the count is greater than the number of items from the index at the end of the source collection"

To give more details:

XIP of the 19,965 ROM weighs 4.6 MB and the new xip (ROM 20754) weighs 3975 MB.
[Windows Mobile Software Development] ervius:
is easyer if you post before/after xips, so I can analyze them and understand if there is something wrong....

bwt there is revision 26 ready, added pagepool changer into... ;)

bye!
[Windows Mobile Software Development] ervius:
uhmmm... its present into rom kitchen, but maybe later..... ;)
[Windows Mobile Software Development] Ameet:
Geez!! You really never sleep my brother :D Great updates. I'm sure rev 27 is on the way now with the date changer too :D and an update to your kitchen combining all these tools in one :D