yashsingh1/xdaforums huggingface dataset:
[Windows Mobile Software Development] Premananda_laishram:
help

I am trying to port xip (more specifically trying to add a module to xip). Can anyone help me out. I am lost in the maze. Attached is my out folder
[Windows Mobile Software Development] Nokser:
You have all solutions in this topic....
[Windows Mobile Software Development] Premananda_laishram:
Ok. I am trying to add extendir.dll to xip. What I am confused about is

What are these:

dwFileAttributes: 00000000

ftTime: 01CAD7C23B67DA3B

nFileSize: 0000736C

lpszFileName: P+001A2FDC

ulE32Offset: P+001B29DC

ulO32Offset: P+001B3AC8

These are contents of a file amdnord.dll.txt.(xip\OUT\MODULES\OEMXIPKERNEL\amdnord.dll.txt)

I need such a text file for extendir (extendir.dll.txt) so that xipport will add extendir as a module in xip. How do we calculate the values in red from imageinfo.txt file

Also which one of these values should I change so that there is enough space in xip to put the new file.

dllfirst: D=01FE01FE

dlllast: 02000000

physfirst: P=80000000

physlast: 802B5654

Update: Have been searching this thread and all over xda. Seems there is only one post similar to my situation on page 42 by Calkulin post #420. And there seems to be no answer. Either everyone here is too busy (bringing out new builds and reducing xip) or adding files to xip is not at all possible. I finally give up.:(:(:(:(:(:(:(:(:(:(:(:(
[Windows Mobile Software Development] Sweed2:
Sorry, wrong post...
[Windows Mobile Software Development] :
tried to redownload the tools, tried about 15 different files and i get the same error every time, not sure.

could be my computer but who knows. Thanks for the help none the less.
[Windows Mobile Software Development] DupinBJK:
I'm not a nbmerge expert, but maybe I can help you with the system report. Could you post it somewhere ?
[Windows Mobile Software Development] cruzzmz:
sorry dude i dont use nbmerge either. what error did u hv?
[Windows Mobile Software Development] Ameet:
:eek: Then how do you guys cook with the OS.nb as template if you dont use nbmerge to make the nb out of payload? This is news :D
[Windows Mobile Software Development] Ameet:
Hi Dupin. Just a thought crossed my mind. I'll try and put it as simple as possible :D

How can I determine or know the limit till what I can push the .VM vbase value? I mean if I have the value at 83000000, then can I push it till 84000000 or something? That is the limit I'm asking, how do i know that? :)
[Windows Mobile Software Development] DupinBJK:
Hey don't blame us ! We're just robots blindly following your first post... :D
[Windows Mobile Software Development] Ameet:
:D But my first post does mention using nbmerge :p In fact the cooking tools modded by me work on nbmerge
[Windows Mobile Software Development] DupinBJK:
You change the words, but the question is always the same ;)

I'm looking into the matter, and it seems that we should have room for changes, but not big ones. The memory model has some base addresses, but each phone (or each rom) seems to tweak these boundaries with different amounts. To know how much it would be possible to change them I'll have to deal a bit more with it. The only thing we can do in the meantime is try and learn from our observations (also called mistakes :))
[Windows Mobile Software Development] Ameet:
Just wanted to make sure my question is understood :D I'll make those mistake while you are trying to find out the right ways ;)

But even if I have to make mistakes, how do I edit the .VM? imageinfo.txt in .VM module and what to edit in the hex of imageinfo.bin of this module?
[Windows Mobile Software Development] cruzzmz:
i am using zinc so it is diff from htc dev ... mine is not os.nb but nk.nba plus bunch other bin that eventually become a MarsII.ABI (similar to ruu_signed.nbh)
[Windows Mobile Software Development] DupinBJK:
well, apart from the fact that the e32_vbase seems to be in the kernelspace block, the upper 2GB segment which should be off-limits to us, what does really suggest you that it should be changed ?

The RMHDR struct should contain - as far as I know - only addresses in the userspace block. Yes, I might be wrong - that's why I'm posting :rolleyes:

Anway, the imageinfo.bin file contains just these values:

e32_imageflags - offset 0x0

e32_entryrva - offset 0x7

e32_vbase - offset 0xb

they are in reverse mode (little endian), meaning that from offset 0xb you'll find your reversed e32_vbase value 00 00 00 83.

Let us know ! :)
[Windows Mobile Software Development] Ameet:
I saw that in the hex editor. I actually wanted to know if I could increase the 00 00 00 83 to 00 00 00 84 to make more space for me to increase the ulRamEnd and get more free Ram. I'll make those mistakes and let you guys know ;)
[Windows Mobile Software Development] cruzzmz:
more more more ram ;)
[Windows Mobile Software Development] :
okay so to make sure i get this right, when you first dump your orginal, you keep OEMXIPKernal, and delete MSXIPKernael from the orginal.

then with your donor xip, you move ONLY MSXIPkernel to the OUT folder.

is that right? I think there is where i messed up yesterday.
[Windows Mobile Software Development] DupinBJK:
For both Files and Modules folders, yes.
[Windows Mobile Software Development] :
okay thanks for that. will work on it again when i get home.
[Windows Mobile Software Development] cruzzmz:
@XipPort then do

1. undo

2. P reloc

3. map txt

Open MAP.TXT in any editor

1. hunt for the !!!!!!!!!

;)
[Windows Mobile Software Development] joel2009:
Can someone please tell me what i'm gonna get out of all this :)

Is xip "execute in place" as in sort of giving me more ram on my device?
[Windows Mobile Software Development] try:
AB, sorry I didn't documenting steps that i took before.

But now I restart it again. I want to port the 20924 XIP from ELF to 19707 Raphael.

Here are my steps:

Base 19707 XIP

Dump XIP with XIPPort.exe, and click “write maps” to get MAP.txt in the OUT folder and keep this MAP.txt as a backup

Click “make pkgs”

Delete MSXipKernel folders from \Files and \Modules both

New 20924 XIP

Dump XIP.bin (from 20924 build) with XIPPort.exe, and click “make pkgs” to get “MSXipKernel” folder

Delete osaxst0.dll + osaxst0.dll.imageinfo.txt, hd.dll + hd.dll.imageinfo.txt and bmui.nb0 + bmui.nb0.imageinfo.txt

I can only found osaxst0.dll and hd.dll module, delete both.

Copy the MSXipKernel folders from \Files and \Modules both to the \Files and \Modules in the base OUT folder

Base 19707 XIP

Open XIPPort.exe and click "undo" then click “realloc P” (got ERROR! Unknown o32 region flags: d0000040) also got not enough space.

So I take out WinCENLS_WWE (will put it on SYS later), click “realloc P” again.

then click “write maps” to get the new MAP.txt file (saved as MAP1.txt)

found 1 !!!!!!

02000000 - 03db2000 L01db2000 NUL

03db2000 - 03dbb000 L00009000 Virtual base address of wce_rex.DLL

03dbb000 - 03dc2000 L00007000 Virtual base address of smem.dll

03dbe000 - 03dc2000 L00004000 !!!!!!!!!!!!!!!!!!

03dbe000 - 03dc2000 L00004000 Virtual base address of regenum.dll​

Calculating and realloc

03dbe000 - 7000 = 3DB7000	(new address for smem.dll)

03DB7000 - 9000 = 3DAE000	(new address for wce_rex.DLL)​

Run M'Reloc, open smem.dll and reloc to new address 03dbb000 to 03DB7000

Edit imageinfo.txt (inside smem.dll directory and change e32_vbase: into V=03DB7000

Run M'Reloc, open wce_rex.DLL and reloc to new address 03db2000 to 03DAE000

Edit imageinfo.txt (inside wce_rex.DLL directory and change e32_vbase: into V=03DAE000

Open XIPPort.exe then click “realloc P” then click “write maps” to get the new MAP.txt file (saved as MAP2.txt).

No more !!!!!!

click “build xip_out.bin”

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

Raphael XIP starts at 0x00320000 and the imgfs starts at 0x007A0000

Build OS.nb for use in the ROM folder from the .payload by executing: nbmerge.exe –kaiser OS.nb

Cook & Flash the ROM

During process I also put the WinCENLS_WWE in SYS and run G'reloc

Cannot boot, have the version of radio and the xip in red letters but dont pass this

Can anybody spotted what I did wrong?

Attached is the MAP.txt, MAP1.txt, and MAP2.txt from the process above.

Any help really appreciated.

TIA,
[Windows Mobile Software Development] Ameet:
That is where you went wrong, no wonder the device wont boot :) Happened with me too when I was experimenting with this. Then I found out that for some reason the WinCeNls_xxx has to be located within the memory mapping. Putting this in SYS put it into imgfs which doesnt boot the device. Instead remove this from SYS & use it in XIP

The problem which you mentioned about not enough space is simple occurs when the addresses of new modules are outside the XIP limits coz either they are simply beyond or they are higher in size. Solution to that is to increase the physlast by 1mb and then work on the overlapping. Finally when you arrive at the zero overlap level check the last module address and that + 1 will be your final physlast address. Looking at your MAP.txt, here's what I would gather (although do this on your actual map.txt after you copy the MSXip folders and before you get the error)

803a3daa - 803e1a38 L0003dc8e NUL
[COLOR=blue]803e1a38 [/COLOR]- 803e1a38 L00000000 End: highest physical address

Increase this value to 80400000 (only for working on the porting, do not use it for final flashing)

Then do your overlap correction and then once you get this final value

803a2dcc - [COLOR=red]803a3daa [/COLOR]L00000fde filedata 723fb954-d931-4348-b672-82a188e587b5.dsm
803a3daa - 803e1a38 L0003dc8e NUL
803e1a38 - 803e1a38 L00000000 End: highest physical address

Consider the final physlast value = red + 1

Ensure the addresses in Ram area are divisible by 1000

You get the same thing what you get when you put RAM in your computer or laptop :p "Execute In Place" is the kernel of the device and porting done to get updated drivers and modules of that kernel to make your device run faster and get more stability ;)
[Windows Mobile Software Development] try:
Thanks AB,

I will try again and report the result...
[Windows Mobile Software Development] cruzzmz:
i have 1 more tip

I would like to share a tip that i got frm a friend of mine DVr about xip porting. Dunno if it is applicable on all dev

From the ROMHDR.TXT

usually according to him, the value of :

but then maybe this not applicable is some cases esp after the ram free exercise. As i got mine as follows after the free ram excercise:

physlast: 804124DA
nummods: (00000000)
ulRAMStart: R=80413000
ulRAMFree: 8043D000

Regards ;)
[Windows Mobile Software Development] cruzzmz:
AB does this apply to all devices?

so where do i put this WinCENls? in the MODULES or FILES folder in XIP?

this only applicable if there is no more !!!!! in the MAP.txt but still the dev cannot boot or just stuck at 1st boot screen?
[Windows Mobile Software Development] Ameet:
Put this folder in Files. I dont know about the folder not being used out of XIP. Back in the days of buildxip.exe, we never included in the XIP but in SYS. But since manual porting I cant find a way to integrate the nls into XIP but through imgfs :( Or maybe you can try doing what you suggest, put it in XIP only of your device doesnt boot :D
[Windows Mobile Software Development] Ameet:
cant say much about all devices but here's what I learnt so far and its what I follow for my porting ;) And works well too

ulRAMStart = psylast + x value till result is divisible by 1000

&

ulRAMFree = ulRAMStart + last realaddr region of nk.exe in the RAM space + 1
[Windows Mobile Software Development] cruzzmz:
I usually get the dev stuck at 1st boot screen ... so i have to try this approach & report back

Thx
[Windows Mobile Software Development] joel2009:
Thanks for reply

My next question is, it looks like this has to be cooked into a rom? am i right or is this a matter of copying back and forth and editing files, unsigning and resigning (such as something you would do with a resouse file)...... sorry i have never messed with anything like this before and i don't wanna have to hard reset because i newb'd something up......
[Windows Mobile Software Development] anryl:
I get that but is there not a problem by creating imgfs from dump .

Cause imgfsfromdump is taking old imgfs.bin as for header so i think it will still have old start values inside the created rom .

kaiser tests

by realoc nk.exe and uiramfree start u get the results
from 85.31 MB to 85.45 MB

by this changes
romhdrtxt
ulRAMEnd: 83400000
canged to
ulRAMEnd: 84400000

vm.
txt
e32_vbase: 83400000
to
e32_vbase: 84400000
bin
4083 to 4084

the results are still the same
mem: 85.45MB
[Windows Mobile Software Development] cruzzmz:
where exactly u find the last realaddr region of nk.exe in the RAM space???
[Windows Mobile Software Development] cruzzmz:
actually u can just patch the xip to ur rom using your preferred rom. only u need to know the xip sits on which part (usually it is in part 1) .... As for me i am using msflshtool to patch

:D
[Windows Mobile Software Development] try:
@AB

Ok,

I continue with PhysLast...

From my MAP.txt, the 723*.dsm is the last with address 803e1a38

highest physical address 803e1a38, adding 1 M, should be change ROMHDR.txt so become:

physlast: 804E1A38

ulRAMStart: R=804E2000

ulRAMFree: 80487000​

Run Xipport RelocP, WriteMAP.

New MAP.txt, show:

803e4668 - 803e5a36 L000013ce filedata e163825b-6e7b-b284-7373-da8c33ae39cd.dsm
803e5a38 - 803e6a16 L00000fde filedata 723fb954-d931-4348-b672-82a188e587b5.dsm
803e6a16 - 803e6a16 L00000000 End: highest physical address

803e6a16 end of address --> 803e7000

Look at the original MAP.txt

L00001000 initialized data of region_1 hd.dll
L00004000 initialized data of region_1 osaxst0.dll
L00001000 initialized data of region_1 osaxst1.dll
L00008000 NUL
L00006000 uninitialized data of region_1 nk.exe
L0007e000 initialized data of region_2 nk.exe
L00013000 initialized data of region_1 kd.dll

Calculating:

1000 + 1000 + 8000 + 6000 + 7E000 + 13000 = A1000

FREE RAM as starting address is 803e7000 + 9D000 = 80487000

Change the ROMHDR.txt, into:

physlast: 803E6A16

ulRAMStart: R=803E7000

ulRAMFree: 80487000​

Run Xipport RelocP, WriteMAP.

Here is the end of my MAP.txt:

803d9cc0 - 803e0cc0 L00007000 filedata mxip_lang.vol
803e0cc0 - 803e4665 L000039a5 filedata sysroots.p7b
803e4668 - 803e5a36 L000013ce filedata e163825b-6e7b-b284-7373-da8c33ae39cd.dsm
803e5a38 - 803e6a16 L00000fde filedata 723fb954-d931-4348-b672-82a188e587b5.dsm
803e6a16 - 803e6a16 L00000000 End: highest physical address

803e6a16 - 803e7000 L000005ea NUL

803e7000 - 803e7000 L00000000 Start: start of RAM
803e7000 - 803e8000 L00001000 initialized data of region_1 osaxst1.dll
803e8000 - 803f0000 L00008000 NUL
803f0000 - 803f6000 L00006000 uninitialized data of region_1 nk.exe
803f6000 - 80474000 L0007e000 initialized data of region_2 nk.exe
80474000 - 80487000 L00013000 initialized data of region_1 kd.dll
80487000 - 80487000 L00000000 ------ start of RAM free space
80487000 - 83400000 L02f79000 NUL
83400000 - 83400000 L00000000 End: end of RAM

Do I need to Calculate the COPYENTRY also?

Should I proceed with M'reloc_nk ? Where I can get this M'reloc_nk ?

@lennysh

Your tool will be wonderful... Great job...

When will it available?

But now, I still need to know the manual way...:)

TIA,
[Windows Mobile Software Development] cruzzmz:
you can still push ur region_1 nk.exe up so that u can hv more free ram

in your case:

1. Use MReloc_nk.exe to stack ur nk1 to 803e8000

2. Then nk2 will be 803e8000 + 6000 = 803EE000

3. Value of region_1 kd.dll 803EE000 + 7e000 = 8046C000

3. ulRamFree = 8046C000 + 13000 = 8047F000

In a nutshell:

o32[1].o32_realaddr: R=803e8000

o32[2].o32_realaddr: R=803EE000

kd.dll : R=8046C000

ulRamFree: 8047F000

Regards
[Windows Mobile Software Development] try:
Thank you for your information,

I also though about it. But then I cannot find the MReloc_nk.exe file. I really appreciate if you could you share it with me?

Sorry, Already found the file (MReloc_nk.exe). And I success booting the new 20924 XIP.

Thank you all for your help!!

Now I will try to port the 20924 SYS.

TIA,
[Windows Mobile Software Development] Ameet:
Cruzz's idea worked :) Or better yet an idea :D Delete the os*1.dll and te kd.dll and use them spaces as more free RAM :D
[Windows Mobile Software Development] DupinBJK:
Shame on you... :D:D
[Windows Mobile Software Development] Ameet:
:eek: This will be the most beautiful thing all over the world of PPC hacking. But you'll take away my customers :D Hey Lenny, awaiting the release of this wonderful wonderful wonderful tool

Just a suggestion here, can you also add removal option for kd.dll & os*1.dll too? Also if you can add the option to playaround with the nk.exe realaddr to squeeze out more free Ram space, it will be a beauty :D Else, building the new xip and redumping it to do this reallocation and to play around with the realloc of vbase to get more free NUL space for stability and then recooking also sounds workable ;)
[Windows Mobile Software Development] DupinBJK:
Well, as a general rule, it's just the OEM who decide how to change the values from the basic WinCE5 memory model.

This is what I have here on my kaiser, for the 212 rom:

physfirst: P=80000000
physlast: 80305C60
ulRAMStart: R=80306000
ulRAMFree: 8033B000

So it will vary, depending on several factors. There's not a fixed rule.

80306000 - 80306000 L00000000 Start: start of RAM
80306000 - 80310000 L0000a000 NUL
80310000 - 80316000 L00006000 uninitialized data of region_1 nk.exe
[COLOR="RoyalBlue"][B]80316000 [/B][/COLOR]- 8033b000 L000[COLOR="Red"][B]25000[/B][/COLOR] 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

And that's why Noonski would prefer a tool :D

Actually, the value of last realaddr region of nk.exe in the RAM space is :

0x80316000 + 0x25000 - 1

So, when AB talks about the last realaddr region of nk.exe in the RAM space + 1 he actually means :

ulRAMFree = 0x80316000 + 0x25000

Is it clear ? Who says no ?! :)
[Windows Mobile Software Development] cruzzmz:
Cool man cool :D ...

Tools is good but it will leave me loosing the way to learn hexing the xip ... but then it surely will take care of the headache of seeing lots of !!!!! in the map.txt

keep up the good work

So putting WinCEnls in the FILE folder of ur XIP work eh ;)
[Windows Mobile Software Development] DupinBJK:
Hey ! There's people wasting money on "Dr. Kawashima's Brain Training" out there... you get a totally free trainer with your XIP :D
[Windows Mobile Software Development] DupinBJK:
Doesn't it take it from the new OS.nb, where you have already inserted the new xip_out.bin ? In that case, you should still get the new values in the end...
[Windows Mobile Software Development] anryl:
no i'm inserting xip later so gona try that will see :cool:

edit ok i did insert the xip first then coocked from os.nb so now i got less storage but memory still the same

storage was 122.54 now 114.67

memory still 85.45

might be now for the modified storage i have to insert xip second time again to get modified rom ? dont.know its a mess :D
[Windows Mobile Software Development] dette:
Ok how do I actually extract the xip.bin from os.nb.payload?

Been searching but nothing =\
[Windows Mobile Software Development] cruzzmz:
from os.nb extract it using msflhtool.exe os.nb -d -p1 ...
[Windows Mobile Software Development] Ameet:
I'm going to test removal of ULDR by Htctouchp's guidance in a day or two. That might turn out to be the answer I seek regarding playing with the value of imgfs for more free RAM :D (maybe) Will post updates once something comes up :)
[Windows Mobile Software Development] cruzzmz:
if i may ask, what is ULDR? hopefully all will went well ;) do report back the outcome
[Windows Mobile Software Development] Ameet:
ULDR = Update Loader :D As per Htctouchp it is the Part00.raw of the ROM which he's going to guide me to remove ;)
[Windows Mobile Software Development] m3Jorge:
The way I do it is by opening os.nb.payload with a hex editor. and saving it as xip.bin. Then run imgfsfrom bin against your os,nb.payload and make a note on the imgfs start address... go back to you hex editor and delete from xip.bin starting with the imgfs start adrees all the way to the end. Now go to the begining of your xip.bin file again and find the beging on the xip... most likely 0X000320000 (if you need help with this part let me know, but for the VOGUE it is 320000). now select from that address to the beging of your file and delete it... save xip.bin and now you have your xip! :)
[Windows Mobile Software Development] evalu8t0r:
Now THAT looks great!

...only one small request... command line runnable with parameters :o)
[Windows Mobile Software Development] evalu8t0r:
You can use XIPport http://xdaforums.com/showpost.php?p=1600699&postcount=85
[Windows Mobile Software Development] cruzzmz:
this is the newest xipport?
[Windows Mobile Software Development] boggsie:
2007, 07-22
[Windows Mobile Software Development] dette:
That wont extract xip.bin from os.nb.payload that will just dump xip.bin.. I dont have xip.bin in the first place lol
[Windows Mobile Software Development] boggsie:
Two ways that I am aware of:

1) manually with a hex editor

2) rommaster

RomMaster.exe -x -w 5 -s 0x00320000 -e 0x006c0000 04_OS.nb.payload -o xip.bin

... but you have to use imgfsfromnb to figure out the partition addresses to feed RomMaster.exe.

http://xdaforums.com/showpost.php?p=2491895&postcount=63

Best regards,

-boggsie
[Windows Mobile Software Development] dette:
Yeah I just used a hex editor :) thanks though!
[Windows Mobile Software Development] cruzzmz:
actually what is this ULDR do/for?

so now we know:

part00.raw = ULDR

part01.raw = xip

part02.raw = rom

part03.raw = ?

;)
[Windows Mobile Software Development] dette:
When I run insert.exe it gives me an error and crashes.. Heres my command I am using

Insert.exe -i xip_out.bin -o OS.nb.payload -d 0x00320000 -s 0x00680000
[Windows Mobile Software Development] Ameet:
Hmm. Been experiencing it lately but thats coz I've been playing with Aman to remove the ULDR. Apart from that, no issues. Check the starting address or use the original payload. Maybe something's wrong with the payload file which you are using
[Windows Mobile Software Development] ervius:
I ever use only xipport.exe and xipaddtools.exe to port all xips I need and they boots everytimes!!!
[Windows Mobile Software Development] Ameet:
:) Hey Ervius. Long time brother.. Hows you? For most of the devices the XIPAddrtools reports bugs. I faced those problems myself so went back to full manual :)

p.s. Edited your post to remove the whole first quoted post ;)
[Windows Mobile Software Development] anryl:
Same here on kaiser allways booting fine :D
[ASUS ZenFone 8] Jeff1976A1:
Anybody knows how to turn on Auto Arrange app icons on the Asus Zenfone 8? ... it's so basic already years and i was looking anywhere and couldn't find how to make it auto arrange the apps icons / shortcuts on home screen and other "pages"... i mean that e.g. if i delete some app or it's shortcut, it's automaticall move all the other apps to take it's place... just keeping it in order... very basic and therefore odd it's no where 2B found easily...

Also for moving the app pages from one place to another, like if you want the apps to be right before or after some widget... it's very frustrating.. in Android 10 i think it was by marking some app (With V) on the edit page mode, so the bottom horizontal ribon of pages shown, then simply long tap and drag and drop the entire page to where you want.. but non of this here... it's very frustrating so any help would be very much appreciated here...

Thatks all ahead and have a nice day..