yashsingh1/xdaforums huggingface dataset:
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] pof:
@ahlok_hk: Please see comment #31 and #34, this answers your question.

Easier explanation if that was not enough clear:

- IMGFS_GUID is hex string which marks where filesystem starts

- Hermes OS.nb has several occurrences of IMGFS_GUID inside, while normal NK.nba expected by prepare_imgfs.exe only has one occurrence.

- Prepare_imgfs.exe only dumps the last occurrence of IMGFS_GUID.

- Because of this, imgfs_raw_data.bin is bad in most OS.nb files

- To "fix" one must split OS.nb in parts, where each ocurrence of IMGFS_GUID is found.

- Only run prepare_imgfs.exe on the BIGGEST part

- After editing imgfs_raw_data.bin, you have to run make_imgfs.exe with result

- Resulting file of make_imgfs should be "joined" with the other parts again.

The process of splitting and joining the files, has to be done manually (with hex editor).

Be careful when flashing resulting OS.nb, if it contains errors... it might break device (bad blocks on NAND).

If someone success, please post and explain :)
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] ahlok_hk:
Thanks again pof. I was too lazy to go through all the posts. Now I can dump the files using the prepare_imgfs.

I found that in the pervious Wizard ROM (O2 1.5.4.2) there are also 4 places that contains the IMGFS_GUID as found in Hermes 1.18 ROM. But it use -nosplit instead of -acer in prepare_imgfs. As there is no -acer in buildimgfs, would it be the reason why the re-build process fail? Also has anyone tried using "-nosplit -acer" in prepare_imgfs?

And I just want to know in case (or your case at #37?) that the flashing of OS.nb fail, will it be possible that I can flash the 1.04 again and do a normal upgrade to recover the error? I want to make sure that before I flash my cooked rom. Thanks again.
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] pof:
I tried -nosplit and -acer, but got same results...

You can flash 1.04 again and do a normal ROM upgrade, but AFAIK the bad blocks in NAND stay there, OS boots but sees less storage memory (only 5Mb)... if you have any idea on how to fix let us know :)
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] rammand:
Fix Bad Blocks after unsuccessful cooked os flash

Hi

I've tried to flash a cooked OS using the SPL-1.01MFG bootloader, and it bricked my hermes.

It appears to have corrupted the NAND memory and generated a lot of bad blocks, I've tried to flash it again, both by extracting OS.nb from a shipped rom with MFG, and by flashing bootloader 1.4 again and flashing a full official rom. The result has always been the same, splash screen appears, version numbers seem correct, but hangs on clean splash screen right after that.

I attach an mtty log containing part of the output to info 8, the list of bad blocks is longer than the mtty buffer, so the listing isn't full.

Rammand
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] ahlok_hk:
Using the imgfs tools, I cannot re-generate the same format(identical file) of the 06_OS.nb by the following sequence:

>prepare_imgfs 06_OS.nb -acer

>make_imgfs 06_OS.nb

If there is chance of having bad block when flashing cooked rom. Is there any chance of having bad block if I flash with just the original extracted 06_OS.nb?

If we can proof that flashing a good 06_OS.nb won't create bad block, I think at least we can modify the imgfs tools so that it can extract and re-create identical 06_OS.nb files, which makes flashing less risky...
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] pof:
@ahlok_hk: If you flash a cooked OS.nb 99% chance you get bad blocks (see rammand's comment!).

If you flash a orignal unmodified OS.nb 99,9% chance it will work and don't produce bad blocks.

I also can't recreate an identical OS.nb, even if I don't modify imgfs_raw_data.bin, so there must be something different, we have to look at the files in depth and see what changes between the original and cooked OS.nb after using imgfs tools.
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] ahlok_hk:
So the first thing I guess is the -acer option that prepare_imgfs.exe provided but not for make_imgfs.exe. During Wizard rom cooking I use -nosplit in both commands but I can't use -acer in make_imgfs now.

As my c++ is bad, maybe someone else could make a new version of make_imgfs that supports the -acer reverse process (the imgfs tools and some source code is available in the following thread):

http://xdaforums.com/showthread.php?t=249836
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] tadzio:
I had a very brief look at the source code, and I can implement the necessary changes. Right now I have to go and do some shopping, so give me a few more hours.

If someone else (pof?) made these changes already, please let me know so we can avoid double work. Btw, I think it also shouldn't be a problem to not just look for the last occurence of the IMGFS_GUID marker, but find them all and then use the one that starts the biggest block. Would avoid having to split up the input file into nine parts beforehand.

One question: where can I find more information about why we need to use the '-acer' flag with the Hermes?

I am new to cooking ROMs (but not to writing software in C/C++, so don't fear :), so I may have some questions.

Cheers

Daniel
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] pof:
No, I haven't and no one did AFAIK.

Would be great if you can implement this too :)

Its only a guess, we don't really know... it's just because this option produces an empty imgfs_removed_data.bin file.

Take a good hex editor that is able to do binary diffs and compare the files created.

The goal should be to accomplish something like this:

prepare_imgfs.exe OS.nb ---> produce valid imgfs_raw_data.bin

make_imgfs.exe newOS.nb (takes previously created raw data file)

OS.nb and newOS.nb should be exact files if the raw data file is not modified.
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] tadzio:
Okay, I did some work on prepare_imgfs.exe.

The -acer flag seems to do very funny things. IMHO the fact that the imgfs_removed_data.bin is empty is a bug. I will have a closer look tomorrow.

I now have a version that creates a imgfs_raw_data.bin with a size of 44.544 kB (on the 1.25 ROM, with the -nosplit option - btw, with the -nosplit option, all the program really does is dump the found IMGFS section unaltered). So it seems to find the correct IMGFS marker. :)

The proof, I think, that the .bin file is correct is to feed it into viewimgfs.exe and get the expected results. That doesn't work yet - if I run my .bin file through viewimgfs.exe, it exits very quickly and produces no output. I will also look into this tomorrow.

The various options of prepare_imgfs.exe basically just set three values: a block size, the number of "useful" bytes per block, and the number of "additional" bytes per block. The useful bytes end up in imgfs_raw_data.bin, the others in imgfs_removed_data.bin. I am not sure if these values are parameters of the IMGFS file system, or if they have something to do with the way the device is flashed. I think it's the first, so I'll try to find some more information about the IMGFS format.

Does anybody have any hints where to find info about the IMGFS used here?

Cheers

Daniel
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] ahlok_hk:
mamaich created the imgfs tools which run on Blue Angel. So maybe the following page could help:

http://wiki.xda-developers.com/index.php?pagename=BA_ROMFileFormat

Looking forward to your great work! :)
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] pof:
Thanks tadzio for your efforts :)

A couple of links that might be helpful:

http://xdaforums.com/showthread.php?t=274912 (see Tutara's comments #24 to #52)

http://blogs.msdn.com/ce_base/archive/tags/File+System/default.aspx
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] tadzio:
prepare_imgfs for Hermes!

I made some progress! :)

(Edit: There was a bug in the attached program, so I removed the attachment. A new version can be found in post #59 in this thread.)

Please find attached a version of prepare_imgfs which works for Hermes .nb files (as I wanted this to get out asap, I only tested it on 06_OS.nb, extracted from an 1.25 and an 1.35 update ROM).

As I did not want to disturb the code for the existing targets, and to make things easier to remember ;) , I added a '-hermes' switch. So, please call it like so:

prepare_imgfs 06_OS.nb -hermes

This will generate, as usual, a imgfs_raw_data.bin and a imgfs_removed_data.bin file.

Note that it is no longer necessary to split the 06_OS.nb file into nine pieces. prepare_imgfs.exe will now find all IMGFS signatures and automatically use the largest one.

If you then run

viewimgfs.exe imgfs_raw_data.bin

you will get a 'dump' subdirectory with all the files expanded. It didn't work for me at first because it needs the 'cecompr_nt.dll' DLL, and exits silently if it can't find that. For your convenience, I put it into the attached zip file.

Please also note that I haven't yet made the necessary changes to make_imgfs.exe. I will do that shortly.

Background info: the '-acer' switch seems to do the same as the '-sp' switch except that it doesn't write data to imgfs_removed_data.bin, which I think is a bug. The new '-hermes' switch does exactly the same thing as the '-sp' switch: every 0x200 bytes it skips 8 bytes (and saves these 8 bytes in imgfs_removed_data.bin). I have no idea about the purpose of these eight bytes.

Enjoy!

Cheers

Daniel
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] Sleuth255:
Wow! Nicely done tadzio!
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] pippo-big worm:
I have a big problem with my O2 Xda Trion.

Ｔrion's (STORAGE TOTAL) changed to 13.08MB.I will show the picture．Ｉdon't know this is a hardware or software problem.

yesterday,I do this

SPL 1.01

USB> task 32

USB> task 28

USB> lnb OS.nb(WM6 dopod838)

USB> task 28

USB> task 8

But WM6 can’t no work in O2 Xda Trion.And I go back to 1.04,and Install RUU_HERMES_HTC_WWE_1[1].35.255.2_1.35.255.102_1.08.00.10_SHIP

And O2 Xda Trion can work,But have a big problem (STORAGE TOTA)L is 13.08MB.

POF,Please provide details of how to solve the problem．My English is not very good．some information i don't understand the means. please help ,and tell me how to solve the problem（details)

Or someone can help me!~~~~~~~~~~~~~
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] ahlok_hk:
Thanks Daniel. I have tried the Qtek 1.18 ROM and result is as follow:

ROM url : ftp://xda:xda@ftp.xda-developers.co...5.3_1.18.255.108_1.03.03.10_qtek_wwe_ship.zip

Command line output:

-------------------

C:\hermes>prepare_imgfs.exe 06_OS.nb -hermes

prepare_imgfs.exe (Build Sun Jan 21 15:17:40 2007)

Searching for IMGFS start...

Found IMGFS at 00659000.

No IMGFS signature found. Exiting.

C:\hermes>

----------------

And no imgfs_raw_data.bin or imgfs_removed_data.bin is produced. But I am sure it will be fine in later versions. :)
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] tadzio:
Oops - indeed there was a bug concerning the last (or only) found IMGFS signature. I just fixed it, and tried it on the 1.18 version you mentioned. Seems to work better. :)

In the attachment you'll find not only a fixed version of prepare_imgfs.exe, but also my first attempt on make_imgfs.exe. This now also understands the same command line switches as prepare_imgfs.exe (except the '-acer', but of course including the '-hermes' switch).

Disclaimer: both files have undergone only light testing. There may well be bugs. Use at your own risk!

Cheers

Daniel
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] ahlok_hk:
Thanks again Daniel!

The new prepare_imgfs and make_imgfs run smoothly by the following procedure:

[Preparation]

- put a nbh file to C:\cook ( e.g. extract the nbh from the file : ftp://xda:xda@ftp.xda-developers.co...5.3_1.18.255.108_1.03.03.10_qtek_wwe_ship.zip )

- Get the original imgfs_tools_182.rar ( http://xdaforums.com/showthread.php?t=249836 ) and extract to C:\cook

- Get NBHextract ( http://xdaforums.com/showthread.php?t=289830 ) and extract to C:\cook

- Get new version of imgfs_tools from tadzio ( http://xdaforums.com/attachment.php?attachmentid=33407&d=1169400630 ) and extract to C:\cook

- Get VBinDiff, a binary diff program ( http://home.comcast.net/~chris-madsen/vbindiff/ ), and extract to C:\cook

[Command]

C:\cook> NBHextract.exe xxxxxxxx.nbh (must be a valid hermes nbh file!)

C:\cook> copy 06_OS.nb 06_OSa.nb

C:\cook> prepare_imgfs.exe 06_OS.nb -hermes

C:\cook> echo 111 > test.txt

C:\cook> Addfile.exe test.txt

C:\cook> make_imgfs.exe 06_OS.nb -hermes

I found that although the new 06_OS.nb contains only an extra file (test.txt), there are many many minor differents when compared with the original 06_OSa.nb using the command "VBinDiff.exe 06_OSa.nb 06_OS.nb". Does anybody know if it is normal for such different?

If the above different is normal, we just need a brave people (who could risk bricking their device ) to try to flash the newly cooked rom to their device ( http://wiki.xda-developers.com/index.php?pagename=Hermes_BootloaderMFG ) to verify the process.
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] tadzio:
My pleasure. :)

Thanks for detailing the sequence of how to set up and do things. I think this'll go into the Wiki as soon as the first ROM was cooked successfully.

Well, probably. When I tested my version of make_imgfs, I changed a few bytes in both .bin files with a hex editor, and after I ran make_imgfs I found the exact same changes in the .nb file. So I'm quite confident that make_imgfs does not produce any artefacts, and the changes you mentioned indeed come from AddFile.

After running AddFile, do you see the same amount of differences already in the .bin files?

Also, if you run viewimgfs on the new .nb file, does it create the dump directory without any error message? And if so, is the test.txt you added present?

Unfortunately my Hermes is in daily use, and I can't be without. So I'll chicken out here and hope that someone else takes the risk. Where is pof, btw? ;)

Having said that, I think we now solved all Hermes-specific problems, and we should be able to learn the rest from the Universal folks (and whoever else cooks WM5 ROMs already).

Cheers

Daniel
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] pippo-big worm:
Someone help me !~~~~~~Page6
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] ahlok_hk:
I guess your Hermes is having bad NAND block after you flash the Wizard ROM. So I would suggest you to go to http://xdaforums.com/showthread.php?t=286755 to seek for help.
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] ahlok_hk:
I just use the same method to modify a Wizard ROM and did a binary compare to the nba(similar to nb) files. And found that the Wizard nba file only have two parts of difference instead of many many little parts(2 bytes) of the Hermes one.

You may check some attached screen dump of VBinDiff for investigation.
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] pof:
Off-line and studying during the weekend because I have one exam today :(

I've read what I have missed yesterday, but still haven't had time to look at your modified imgfs tools, hopefully tomorrow after exams!

I have a couple of Hermes, so if the created OS.nb looks good I can use one as a guinea pig :eek:
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] tadzio:
Good luck then! :)

Sounds cool. Looking forward to your findings - and I do hope you don't have to brick any of them. :)

Cheers

Daniel
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] miguelromerom:
i´ll wait you...

thanks for all
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] pof:
Success!! :D

tadzio, I'm very happy!! successfully flashed first "slightly cooked" ROM on Hermes without producing bad blocks on NAND using your modified imgfs tools. I just removed "Photo.gif" from HTC 1.35 ROM to try it:

C:\imgfs>prepare_imgfs.exe 06_OS.nb -hermes
C:\imgfs>DelFile.exe Photo.gif
C:\imgfs>make_imgfs.exe 06_OS.nb -hermes

NAND is still intact after flashing this OS.nb, and "Photo.gif" is not there anymore :)
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] ahlok_hk:
Yeah! That's the greatest news for my Hermes since the day I bought it! It's cooking time!

BTW, has anyone tried adding a file? I guess the make_imgfs.exe or Addfile.exe may have to tuned a bit so that those "many many small differences" are gone.
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] pof:
AddFile.exe crashes when I try to use it with raw_data dumped from HTC 1.35 rom. :confused:
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] ahlok_hk:
Remember to use a .nbh file(extracted from a RUU upgrade file), and add the -hermes option when using prepare_imgfs.exe(and new version of prepare_imgfs.exe by tadzio).
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] pof:
Of corse I did... but AddFile.exe produces a windows crash after showing this on system window:

C:\imgfs>echo 111 > test.txt
C:\imgfs>AddFile.exe test.txt
Total Sectors: 0000
Used Sectors : 15bcb
Free Sectors : fffea435
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] mousey_:
Well Pof This Cuts Your Esitmated Time Of Cooking ROMS Down As Well. So 2 Weeks Instead Of 3 Months.

Great Work tadzio You've Helped The Cheifs So They Can Start Cooking.

Cheers

Mousey
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] tadzio:
pof, can you send me the file you tried to add? We have the source code for AddFile.exe, so maybe I can find where and why it crashes. A wild guess would be that there isn't enough space left in the image file. Did you delete some files before you tried to add that one?

Edit: I just saw that the Free Sectors number you quoted is negative. Seems you indeed ran out of space in the image file. AddFile should handle that siuation a bit more gracefully though, methinks. :) )

On another note, I just hacked together a version of prepare_imgfs.exe which creates image files for all occurences of the IMGFS signature. As expected, only the biggest one is a completely valid FS image. However, the second biggest one also seems to contain one or two files (according to the output of viewimgfs.exe before that crashed :) ). viewimgfs.exe is a bit more complex, so I don't know if I'll have the time to analyse it in depth. My first priority (probably next weekend) will be to find out why AddFile crashed for you, pof. Please just send me the file you tried to add.

Cheers

Daniel
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] pof:
I just tried "echo 111 > test.txt" so this is the file :)

Will do some more tests with other ROMS when I have some time and report my findings. Many thanks for your great work tadzio :)
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] dcdivenut:
VERY nice work

Just wanted to take a second to thank everyone who seems to be working towards allowing the chefs to cook.

As an eager consumer of cooked ROMs who has ZERO capability to produce them, I have been holding off moving to a 8525 from a 8125 because of the unavailability of cooked ROMs.

I am always happy to test, but all this talk of hex files and nbfs makes my hair start to frizz! If anyone wants to start a collection to buy Molski a 8525 I will certainly help if he promises to cook a 3.3 ROM for it (only partially kidding here!!)
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] shogunmark:
we are all definitely working on it.. to bad its more than just editing the rom and so much is involved with the hermes roms.. But we will get there, and it should be soon...
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] mxlaser:
Well, like its been offered before, im happy to help pay for the benifits, as with no knowledge myself on how to do, im a believer in doing what i can (in this case financial) to help the community.

Looks like its been a bit of a snow ball effect, and its come forward from the orginal possible 6 months to a few weeks potentially.

Now we can wait for the official 3.3 update (possibly) that will have some sort of new code to stop the progress we've made so far :rolleyes:
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] shogunmark:
it progressed a little faster since some people decided to jump in and we have made some great progress, there are some mountains to climb, but we are getting there... we are certainly closer now than what we were 2 weeks ago..
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] ahlok_hk:
Hi Daniel, here's the test result that I've done. Seems the make_imgfs.exe need more enhancement. :)

No.

The difference of imgfs_raw_data.bin is attached for reference. The differences of 06_OS.nb are too much to attach. You may refer to my earlier post.

Yes. Yes.

Thanks again!
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] qooqoo:
thanks for dadzio and pof's work.

i did

and

and I got dump folder.

but i found a lot of differences with in windows folder. ex:

i want to delete all files concerned in PreConfig.txt, just like:

PreAutoRun.exe, SetHSDPA.exe, MP_CVSDcpl_20060920.cab etc, but i found none of them in dump rom. anything wrong?

thanks at first and sorry for my bad english.:p
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] kyphur:
Please confirm that you tried to Flash Crossbow for Dopod838 (which is a Wizard) OS file onto a Hermes Device.

I would see that as a big No-No...
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] kyphur:
Okay, I'm ready to jump in here and see if I can help test this.

Where can I find the Addfile.exe & DelFile.exe?
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] pof:
In this thread, attached on a comment. Read the full thread if you're ready to jump in ;)
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] kyphur:
Okay, that confirms that addfile & delfile have not been modified like the make & prepare have.

Got all of the tools (I think). and have even dumped the contents of an OS image just to see what's in it!
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] tripledes:
Hi pof, I had crashes with BuildImgfs.exe while doing a little cooking on my Universal since I increased the swap memory I haven't got any crash again.

I don't think this could be your problem but just for checking...I think addfile.exe won't take the memory amount BuildImgfs.exe takes.
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] Sleuth255:
I've always suspected this. I've noticed that output from viewimgfs.exe never seems to have all the files. For example: coredll.dll is never there. From a cooking perspective, this isn't usually a huge deal, but it can be an issue when you're trying to extract ROM based dlls from various sources for custom builds. Lately I've been working with the WM6 build for the Universal by Helmi and several dlls known to exist in that build aren't appearing in the dump folder. The Universal ROM formats are well known so one would think that mamiach's original tools would work perfectly... yet there are missing pieces. I hope you pursue this further Daniel! :)
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] lvsw:
INFO!!!!! http://xdaforums.com/showpost.php?p=1120639&postcount=53
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] ahlok_hk:
In the day when I cooked Wizard ROM, some files are not able to extracted by imgfs_tools. Those file are located at WM5 boot XIP partition. And I used a program called RomMaster.exe ( http://xdaforums.com/showthread.php?t=249015 ) to add or delete files in XIP.

BTW, I think right now we are very close to the point of rom cooking. We need better make_imgfs.exe and then better addfiles.exe only...
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] pof:
As we seem to have two threads open for the same matter, I am closing this one. So please use the following thread for the Hermes ROM cooking progress from now on:

http://xdaforums.com/showthread.php?t=290206​
[XDA Assist] vermajatin620:
Can you please port CM11 to Micromax A74. It has specs very similar to Galaxy SII.

Specs : -

1.3 GHz dual core MT6572 processor

Resolution - 480*854

LCD Density - 240 dpi

512 mb ram

Can you please port CM11.

I also tried to port but i ended up in a bootloop, so i am requesting you to port this rom !