config commands - Windows Mobile Development and Hacking General

hi to all
I managed to open the extended rom on my iMate using exteded rom tools
I even added files (*.CAB) in it and added them into the config file to install them automatically each time I make a hard reset.
My problem now is this:
I have a file that I copied into extended rom and I want it to be copied to (let us say) "\windows\" directory. Is there such a copy command in config file that i can add it to the command lines in config file? And if so what is the correct syntax
Thanks

there is.
Search in the forum.
It is smt like
CPY1: on one line indicating source
CPY2: on next line indicating target
Why dont you make a CAB file in which you can do whatever you want?
Nice thing of a CAB file is that the action will be registered (as an installed program!)

do you mean like :
cpy1: \extended_rom\kk.exe
cpy2: \windows\
to move the file kk.exe from the extended rom directory to the windows directory
and how can i read about making cab files and with which program

I have been using Win CE cab manager to make cabs, it's a great program, but the trial will only run 10 times.
http://www.ocpsoftware.com/products.php?nm=cecabmgr
andit is too expensive for me to buy... ($146)
So I have been using it sparingly to save my free goes.

to move the file kk.exe from the extended rom directory to the windows directory will look like this
cpy1: \extended_rom\kk.exe
cpy2: \windows\kk.exe

did not work
hi
i have tried the command cpy1, cpy2 to copy files within extended rom, but the files were not copied, do you have any idea why?
i am sure that i typed the path and the filename correct
thanks

Related

n00b question about adding my own programs

Okay I understand you have to use mkrom and Linux (or cygwin on Windows) to roll your own ROM my question is regarding how one could say remove one program from the SE ROM and include something else, for instance take off the byte counter and put another different counter on or such, would you just copy the necessary files (.exe and dll's) to the files1 or files2 folder and that's it ? What more is involved? Thanks in advance!
for simple programs, that is all there is to it.
some might need more research, as to which registry settings need to be tweaked to get te program to run from the windows directory. and what settings it needs to run at all.
You copy the files to either files1 or files2. Both sets of files end up in the \Windows subdir. So if you do not want to copy the files to RAM (see below), you should make sure the program is set to run from \Windows. Then you add any necessary registry keys to "default.reg", and any file-copy or directory creation commands to initobj.txt. Then run "mkrom <ROMfile>" and hey-presto.
Thanks so much for all your guys awesome work!!
entropy1980 said:
ok sounds good, what would one need to do to mod the registry for the programs (By that I mean prior to booting) I don't want to be mucking around with a reg editor after the device boots just to get the progs to work...
Click to expand...
Click to collapse
Not sure I understand the question. Default.reg just holds the entire registry as present after a cold restart. So if you put something in there, this will be in the registry when the device wakes up.
I think we wrote at the same time , so you answered my question before I posted it !!! What you said made complete sense! Thanks!
entropy1980 said:
[...]so you answered my question before I posted it !!! [...]
Click to expand...
Click to collapse
I installed the phpBB telepathy mod a couple of days ago, so I guess it's working.
Hey I knew you were going to say that.... :lol: :lol:
hi,
i want to add the skelmir java virtual machine (thats default installed in windows\ceej) and copy the swingall.jar in the windows\ceej map.
I have the cab file of the virtual machine but i can't find out which files are in it (when i open it with cabextract is shows .001 files and not the files that i find back in the device)
please help me
Using Special Edition ROM, Tthe CabInst tool will run CAB files on the device if you move it there manually and double-tap it. It allows to set a new directory to install in.
Also the System Snapshot tool will write a file in the root of the device which holds a list of the entire filesystem and registry contents, so you can compare and see what changed. UltraEdit for the desktop has a compare function.
Good luck...
hi,
i installed it to a seperate directory and zipped the files. i also took a snapshot when the xda was fresh and after install. i only can't find where the xda's gets is files from in:
43 <! [\Windows\AppMgr]
8544 <! 31/12/2002 12:31 1632 FC0E9EE1 Skelmir CEEJ Virtual Machine.DAT
8576 <! 16/02/2003 23:10 27 AEBB1DF3 CEEJ.lnk
8587 <! 16/02/2003 23:10 40 1EAF4EB3 CEEJ Examples.lnk
8588 <! 16/02/2003 23:10 27 AEBB1DF3 CEEJ.lnk
because these are not in the map where i extracted the cab file too. maybe you can take a look for me and tell me what i have to change in mkrom to have ceej by default installed
the extraced cab map:
http://www.devosjansen.nl/xda/java installed.rar
the snapfiles:
http://www.devosjansen.nl/xda/xda snapshots files.rar
thanks in advance
laurens0619 said:
hi,
i installed it to a seperate directory and zipped the files. i also took a snapshot when the xda was fresh and after install. i only can't find where the xda's gets is files from in:
43 <! [\Windows\AppMgr]
Click to expand...
Click to collapse
These files are generated during the install process, and contain uninstall information. You do not need to write them if you install in ROM, since you don't need/want your programs to show up the in the 'Add/Remove Programs' dialogue.
ah i understand,
so i just put the files in the files1 or files2 directory and add this reg files to the default.reg? i dony really understand the readme file
ah little kick,
isn't also good for the next SE rom? because you have finally a java virtual machine on the xda and the app is freeware (got it from www.skelmir.com)
laurens0619 said:
isn't also good for the next SE rom?
Click to expand...
Click to collapse
Noted...
nice but can you please help me out for the moment? i dont know which part i must add to the default.reg file
laurens0619 said:
I dont know which part i must add to the default.reg file
Click to expand...
Click to collapse
default.reg holds the registry that is present when the system wakes up from cold-boot. So any registry entries your installer (or first run of the app) has made that you would like to have present should go in there. Clear enough?
almost
so i just copy paste the **** at the end of the reg file? and the files in the files 2 map
but how will the rom know where to put the files??
sorry if i'm stupid but i don't want to f*ck my rom so i can use me xda's as a frisbee
Yes, the registry entries can be pasted at the end of default.reg. It doesn't matter if there's earlier entries with the same values, since the latter ones override.
All files in files1 and files2 will end up in \Windows, and if you want them somewhere else, (where they'll take up RAM), you must manually copy them (or pre-made links pointing to them) by issueing commands in initobj.txt.
Take a real close look at initobj.txt, and you'll get the picture.

Need to put a CAB in rom

I copied a CAB file in files2 (from mkrom) and I put a line in initobj.txt, the line in initobj.txt is:
Directory("Program Files"):-File("m.cab","\Windows\m.cab")
When I did double click on m.cab a pop-up window said me:
"Cannot find 'm' (or one of its components). Make sure the path and filename are correct and all the required libraries are avaliable"
But if I copy the m.CAB with Active Sync It works,
Any idea.
It needs a cab installer!
The problem is that I erased the CabInstall.exe, but I didn`t change the entry in registry for the one that goes with the wceload.exe which is the cab installer that comes with windows CE by default.

use mkrom to cook 4.00.xx rom, a tutorial and bug report

Spent a lot of time on it, trying to figure out what went wrong with mkrom when cooking 4.00.xx roms. finally figured it, well, almostly. here is a short step by step tutorial for people who do not want to set up the complicated kitchen but wish to use mkrom as in the good old 3.17 time.
I assume you already know the rom flush process already, if given a NBF file. also you need a linux box with perl.
I know quite a few people struggled and have not had a clue. and I believe there is some bugs in the mkrom package that gives the trouble.
1. download the newest mkrom from http://xda-developers.com/~itsme/download/mkrom_136.zip. this is the only piece of software you would need.
2. unpack it to, say mkrom, directory. then make directories cfg
3. get hold of a copy of rom file and its corresponding paramter files. the parameter files can be obtained from the demo kitch download ftp://kitchen:[email protected]/data look inside the "00_base ROM" and the parameter files should be under cfg directory of each rom directory. bascially the parameter files tells mkrom, where to start to put added files and how large space there is. there are two blocks of space that can be used. so the file has format
wincever=4
start1=81740000
size1=00040000
start2=81b00000
size2=003c0000
startbmp=81ec0000
startop=81b00000
the first three lines are same for all 4.00.xx roms, start2 varies for different roms, startbmp is also the same for all roms. startop should be the same as start2. size2 will be startbmp-start2, remember they are all in hex. you can calculate how large space there is once you get hold of the start2 parameter.
anyway, put the parameter files under the mkrom/cfg directory, with name "params"
4. copy a rom file (.nbf), say rom.nbf, into mkrom directory and run "./setup rom.nbf". this will creates several files under cfg.
5. mkdir a directory mkrom/romfile, enter it and make another directory file , then type "../dumprom ../cfg/rom.nb1 -4 -d file"
here comes the first bug. the setup.sh tells you that dumprom can only be used in windows box. but in fact, there is a compiled dumprom for linux in the directory (you might need to set it to be executable though). however, this linux version does not put extracted files into the "file" directory as it is supposed to, instead it just write file as "file\xxx" where xxx is the actual file name extracted from rom. it is a bug but as long as we know it, not a big deal. the is someone posted a correct version of dumprom in this forum though.
6. you should be able to find three files (or with the "file\" prefix added) with name default.fdf initobj.dat initdb.ini. these are the three files that needs to be process as indicated by setup.sh. follow the instruction to create the default.reg initobj.txt initdb.ini and copy them to cfg directory.
7. make a directory mkdir/files. you are ready to create a clean rom now by running "./mkrom output.nbf", the created output.nbf should be fine.
So far so good, followed the instruction of mkrom. next would need to add our files. then comes the problem. if you add files into the mkrom/files directory, and run "./mkrom output.nbf" again, it is almost definitely that the created rom is bad. I am not 100% sure why, but here is what I believe:
the mkrom script scan files in the "files" directory and put files in there into the "files1", "files2" directory, each of them is supposed to fill the two space in rom starting from "start1" and "start2" in parameter file. the size of files under "file1" should be less than "size1", similar "files2" and 'size2". when mkrom does this, it is highly possible that the three critial files "default.fdf, initobj.dat, initdb.ini" are placed into "files2" directory instead of "files1" directory and renders the rom bad.
here is what I did
edit the mkrom.sh, delete the line that splits files in "files" into "files1, files2" directory. change the three lines that convert the three critial files so that these three files are created in "files1" directory instead of "files" directory. then put your files into "files1" and "files2". just be careful, keep the size less than specified by "size1" and "size2".
then you can run "./mkrom.sh output.nbf" as before, and the resulted rom will be good.
hope this helps. however still a couple of problems
1. the fdf2reg.pl won't recoganize the default.fdf extracted from 4.00.21 rom or 4.01.00 rom
2. if i change the content of initobj.txt, the created rom won't boot. I might have done something wrong in initobj.txt though. but I used to be able to do this for 3.17 rom
3. I did not try to modify registry, as my only purpose is to put my files into ROM to save space. all registry can be done later by installing the software and choose not to overwrite existing files in ROM. must simpler.
the unix version of dumprom does not decompress files, that is why your default.fdf etc seem corrupted.
this is because I only have the decompression code in the form of a binary library, which I have not figured out how to link to under linux.
the only use of dumprom under unix is to find the offsets in rom where filepointers to default.fdf etc should be patched.
I should maybe disable the '-f' option in dumprom for the unix version, to make things less confusing.
but it looks to me that the dumprom under linux worked for pre- 4.00.16 rom. only not for after 4.00.21 roms. so are they different?
maybe the default.fdf was not compressed in the 3.x roms?
I am quite sure it does not work for compressed files under linux - I just did not implement the compression routines.
dumprom worked with 4.00.05 4.00.11 4.00.16 roms. I cooked 4.00.11 and 4.00.16 roms, and the rom was fine. I never used windows box during the process. only when i tried 4.00.21 and 4.01.00, there was error. anyway, i don't care, since I need as much rom as possible and 4.00.11 seems to be the best choice for me.
thanks for writting mkrom, a terrific tool. I don't like the way xda-developers.com promoting kitchen but not mkrom. mkrom is much simpler to setup and run, as long as you know about linux. the kitchen is much more complicated to get it to work and most people don't actually need such flexibility I believe.
ok i installed cygiwin and was with u till step 5, then i am lost.. when i run step 6 dumprom (in DOS) gives me an ewrror here atr the first few lines from dumprom( wiht latest ATT official release)
img 00000000 : hdr=8c0a1000 base=8c078000 commandlineoffset=8c077fe0
img 00040000 : hdr=800cdde0 base=80000000 commandlineoffset=7fffffe0
img 00180000 : hdr=8024db88 base=80000000 commandlineoffset=7fffffe0
img 00380000 : hdr=8039b334 base=80000000 commandlineoffset=7fffffe0
img 00670000 : hdr=80be2c40 base=80000000 commandlineoffset=7fffffe0
img 00c00000 : hdr=80e99400 base=80000000 commandlineoffset=7fffffe0
img 01050000 : hdr=813efc74 base=80000000 commandlineoffset=7fffffe0
img 01400000 : hdr=815d2ba4 base=80000000 commandlineoffset=7fffffe0
img 015f0000 : hdr=815f0650 base=80000000 commandlineoffset=7fffffe0
img 017c0000 : hdr=81bba0a4 base=80000000 commandlineoffset=7fffffe0
ERROR: could not find pointer for ofs 8c0a1000
invalid romhdr ofs 8c0a1000
ERROR: could not find pointer for ofs 00000000
7fffffe0 - 80000000 L00000020 unknown 30315750 452d3142 412d474e 2d30332e 2d353030 62373239 2d2d2d2d 2d2d2d2d
80000000 - 80000004 L00000004 romsection id=ea0003fe
80000004 - 80000040 L0000003c NUL
80000040 - 80000048 L00000008 'ECEC' -> 8c0a1000
errorsgalore...
so help me here how do i make sure the files extracted are all good also the size (as per ) windows explorer is 33+ not sure how all has been installed in the 32mb rom
did you get default.fdf initobj.dat initdb.ini out of dumprom. dumprom also reported tons of errors but as long as you get the three files out, it is ok.
Dumprom tries to figure out for each byte in the rom what it does. If it doesn't know it says 'unknown' this is not an error, just that dumprom could not determine the use of this byte. The 'could not find 00000000' message means that it encountered a NULL pointer somewhere in rom where it did not expect it, the other one is a pointer to RAM, which dumprom does not know exists. You can safely ignore these errors.
Dumprom was initially written to assist in figuring out what I did not know about the rom, so it tries to figure out stuff that is unknown. Later I added the code to extract files to it. Maybe I should split dumprom in one research tool, to do a detail examination of the rom, and one tool to only extract files.
Most files in rom are compressed, that is why they are more than 33M when uncompressed.
ok i understande the messages...
now here is what i did
ran ssnap and got a picture of the OS and did a compare and have a list of entries i want to add to registru and a folder with bunch of subfolders that need to be added on install
not sure how step 6 goes.. to convert the files to .reg and .txt and how/where do i add my files and registry entries....
any tips...
update...
i did fdf2reg and made a .reg file added my entries in there and then ran reg2fdf to recreatre the fdf...
i hope this is right now i need to fig out how to specify where the files i want added are to be copied i mean some go into windows some in new filders that need to be created...
plz tell me how to go forward.
you don't need to re-create the fdf file again, mkrom does it for you, you only need to take care of the default.reg file under cfg
I am not sure whether you can put files under directories other than \windows only. I did not try that. I suppose all files under /files1 and /files2 go to \windows directory just they happen to locate in different memory location in ROM

ReLoad v0.1 Beta

ReLoad
This is a MortScript script written to simplify reinstalling cab files, and restoring files back to the device from a zip file on the trinity.
More information about MortScript at http://www.sto-helit.de
-v.01 Initial Release
Known Issues
-Cab files that initiate the installation of another cab file ie.Wisbar Advanced
-How to setup:
1)Extract Reload.rar to your storage card.
2)Place cab files in the CabsAuto folder if you want to the cab to be automatically installed to the device (installation to automatically install to the storage card is currently not available).
3)Place cab files in the CabsManual folder if you want to be able to choose where to install the cab.
4)Place file in the Backup.zip file that you want to be restored.
ie. If you wanted example.jpg to be placed in the \Windows folder, place example.jpg in the Windows folder of the zip file.
*Please note that the cab files placed in the CabsAuto folder need to conform to only asking the user for the installation destination, then showing installation successful/unsuccessful. Otherwise you might encounter some
problems. You should place cabs that don't conform in the CabsManual folder, or adjust these cab files with programs such as WinCE CAB Manager.
-How to use:
1)In the Reload folder, execute Run1st. Click ok the the window that pops up. This just installs MortScript
2)Execute Run2nd. This will initiate the script that will first install the CabsAuto, then CabsManual, and finally restore the files in the zip file.
Use at your own risk.
Download
http://rapidshare.com/files/29964511/Reload.rar.html
Thx, that's a good idea.
is there a way to have it restore registry entries from a .reg file?
Is there a way to install certain cab files on RAMDisk/Storage card without individually clicking the install option??
@racerx_
Currently there isn't a way to restore the reg file directly. But you can create a cab from the reg file and then have that cab automatically installed.
MortScript wasn't able to read in the reg files i saved with resco explorer, so I gave up on doing it this way. For right now the easiest way is to create a cab file with WinCE Cab Manager.
@c_shekhar
The best way to install the program to the Storage Card, backup the reg (and any possible files installed on rom), then create a cab from this.
This post has alot of good information on this.
http://forum.xda-developers.com/showthread.php?t=277727
yeah, i've been trying like a madman to get win ce cab manager to make a cab of my .reg file.. but when i click on 'import' and try to grab the .reg file it tells me it's only for registered versions of the program.. is there another way i'm not seeing? cause right now the only other options i see for registry entries is to manually create them one by one which doesn't sound very exciting hah
thanks for the help..
@racerx
What OS and version of WinCE Cab Manager are you running. I heard of some problems with the newest version of WinCE Cab Manager with Vista. I am running version 2.1.0.35.
If that isn't it, you might have run the program past its initial trial use.
hmm.. Win Ce CabManager is 2.1.0.50 running on xp.. still got 17 uses left.. sigh..
Maybe i missed something. Just in case, what button or command are you using to get your .reg file into WinCE? I was using the 'file' 'import' command.
@racerx
That's the same way I do it. I would find an older version and try it again.
Reload V0.2
I made a couple of changes to the script for a rom we are going to be releasing soon...it checks if Backup.zip exists and only does the unzip if it does...I also added a SDBackup.zip for files to unzip to Storage card (specifically exe's and dll's I've already upx'd to shrink them but reinstalling the cabs replaced them again so this puts them back)....
#ReLoad
#v.02 Initial Release
#Use at your own risk.
#v.02 Extract files from SDBackup.zip to Storage Card
If(Question("Do you want to ReLoad?", "Reload 0.2", "YesNo")="No")
EXIT
EndIf
Run("Storage Card\ReLoad\Bin\Message_Running.mscr")
RegWriteDWord("HKLM", "Comm", "AutoRunFlag", "0")
RegWriteString("HKLM", "Comm", "AutoRunCFG", "\Storage Card\ReLoad\CabsAuto\Config.txt")
#Create Config File
Delete("\Storage Card\ReLoad\CabsAuto\Config.txt")
WriteFile("\Storage Card\ReLoad\CabsAuto\Config.txt", "SHOW:\Storage Card\ReLoad\Bin\ReLoad.bmp^NL^")
ForEach x in files { "\Storage Card\ReLoad\CabsAuto\*.cab" }
WriteFile("\Storage Card\ReLoad\CabsAuto\Config.txt", "CAB: ", 1)
WriteFile("\Storage Card\ReLoad\CabsAuto\Config.txt", x, 1)
WriteFile("\Storage Card\ReLoad\CabsAuto\Config.txt", "^NL^", 1)
EndForEach
#CabsAuto Install
RunWait("\Storage Card\ReLoad\Bin\AutoRun.exe")
#CabsManual Install
ForEach x in files { "\Storage Card\ReLoad\CabsManual\*.cab" }
RunWait(x)
EndForEach
If (FileExists("\Storage Card\ReLoad\Backup.zip") )
#Restore files from zip to main storage
UnzipAll("\Storage Card\ReLoad\Backup.zip", "")
EndIf
If (FileExists("\Storage Card\ReLoad\SDBackup.zip") )
#Restore files from zip2 to storage card
UnzipAll("\Storage Card\ReLoad\SDBackup.zip", "\Storage Card\")
EndIf
KillScript("\Storage Card\ReLoad\Bin\Message_Running.mscr")
If(Question("Finished ReLoading.^NL^Do you want to reset?", "Reload 0.2", "YesNo")="No")
Exit
EndIf
Reset
Very good soft, it works nice !!
The only difficulty for the french users is to replace in the script "Storage Card" by "Carte de stockage"
Thx men for this !!!
Nice soft,
I could use FAMAN WM6 on my trinity now !
French translation and modification is (seem to be) ok.
Just wait the OK from the boss and I'll give you !
Edit : Why don't you use the LOCK:Enabled in the header and LOCKDisabled on the end of the config file ? Thxs in advance.
I use SettingsSavior on my Trinity mainly for its similar auto-install functionality
Hello,
Thank you for this very useful tool
My .cab are removed after using Reload. How can I keep my .cab on my SD after a new installation ?
Thank you for your help.
Guillaume
__________________
SPV M700
FAMAN 4.03.FR
1.50.08.11
2.79.7020.19H
can this software reinstall cabs, copy skin files in programs installation directory (eg pocketcm skin) and reconfigure mail and exchange accounts ?
OOPS delete this post.

Issue - Files over-written when creating a ROM

When I'm cooking multiple applications in to my ROM, I have an issue where different applications have the same file name and over-write each other.
For instance,
when cooking in G-Alarm and Opera Mobile they both have image files called something like "nextbutton.png."
So it seems that one of them over writes the image file of the other, which results in one using the image file of the other.
Is there an easy way to fix this?
found the answer!
http://forum.xda-developers.com/showthread.php?t=530710
I don't know if anyone finds this interesting.. But if you are cooking in a lot of EXT packages, chances are you're going to over write several files with common names.. (they all get put in the \Windows\ directory..).
Heres a simple little solution:
(make a batch file and paste this in it)
::for /f "tokens=*" %%a in ('dir /b /a-d') do rename "%%a" "ab0_%%a"
for %%a in (*) do rename "%%a" "ab0_%%a"
Click to expand...
Click to collapse
Paste this in the files directory of your EXT package. It will add a prefix to your files.
Then simply edit the app.dat file in your EXT package with any text editor that has "search and replace" and search for "\Windows\" and replace with "\Windows\ab0_" where ab0 - is the prefix you added to your files.
You'll need to manually edit any lines where \Windows\ was in the destination path, and not the source path. Generally these are a couple lines at the end of your app.dat file.
Hope this helps someone else!

Categories

Resources