XboxHacker BBS
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2013, 03:50:39 PM


Login with username, password and session length


Pages: 1 2 »
  Print  
Author Topic: Nand compare & reconstruction tool  (Read 21681 times)
rab
Hacker
***
Posts: 63


View Profile
« on: December 11, 2009, 01:37:55 PM »

Made this for my own use, thought others might benefit from it too.

v1.4: http://rapidshare.com/files/340047921/NandCompare-v1.4.rar
v1.3: http://rapidshare.com/files/322604464/NandCompare-v1.3.rar
v1.2: http://rapidshare.com/files/321306149/NandCompare-v1.2.rar
v1.1: http://rapidshare.com/files/320407953/NandCompare-v1.1.rar
v1.0: http://rapidshare.com/files/319500515/NandCompare.rar


nand compare (v1.4):
--------------------

  i made 6 reads of my nand with no matches (one of them was good but of course i
  didn't know that at the time), but diffing them i could see that the differences
  where spread all throughout the file, so i wrote this tool to reconstruct it

  then i also discovered the usefulness of the compare function in verification of
  the write, so hopefully this tool will be of use to other people
 
  please send feedback, bugs, etc. to rab (richardaburton@gmail.com) or post in
  the thread on xbox-scene or xboxhacker


the tool has two functions:
---------------------------

- compare 2 nand images
  better than simply using md5 as it tells you which blocks are mismatched, which
  allows you to reread only those that are in error rather than the entire chip
  (speeding up the process)
 
  one use of this is when verifying a write by reading back the nand and comparing
  it against the original you wrote, if you get a bad block just reread that
  individual block, patch it into the full read and compare again (files are
  reread each time you click compare, no need to reselect the same files in the
  gui)

  e.g. nandpro lpt: -w16 XBR.bin (write image as normal)
       nandpro lpt: -r16 verify.bin (read back image)
       (do comparison, shows block 2e mismatches)
       nandpro lpt: -r16 2e.bin 2e 1 (read block 2e)
       nandpro verify.bin: -w16 2e.bin 2e 1 (patch this new read into verify image)
       (do comparison again, if still bad rewrite just this block and read it back again as above)


- reconstruct image from 3 bad reads
  assumes that read errors don't occur in same place each time, which is true for
  some read errors (e.g. lpt timing problems), if there is a good reason why you
  can't read something then this may not be true

  this tool cannot recreate a nand out of nothing, if you give it 3 files full of
  zeros you'll get a recreated nand full of zeros, always look at a dump to make
  sure it looks correct (e.g. has a microsoft copyright at the top, once you've
  reconstructed a nand open it in 360 flash tool and make sure it reads ok there)

  the tool works by comparing blocks between the 3 files, any block found matching
  in 2 (or 3) of the files will be considered good, you will be warned if not all
  blocks can be recovered, in which case you'll need to get more reads or look for
  a good reason why your reads are so bad


version history:
----------------
  1.4 (2010/01/23) - support any size image (any number of blocks at 0x4000 + ecc)
                     for partial dumps of large nands, 2mb xell backups, etc.
  1.3 (2009/12/18) - reduce block size for 256/512mb nands (to 0x4000 + ecc) based
                     on user feedback (nandpro uses small block numbering so our
                     output didn't match up with nandpro)
                   - make gui more responsive when operating on large nands
  1.2 (2009/12/15) - support for 256mb nand
                   - use correct block size for 256/512mb nand (0x20000 + ecc)
                   - added progress bar
  1.1 (2009/12/13) - support for 512mb nand (assumes same block size as 16mb)
  1.0 (2009/12/12) - first release


Edit reason: updated to v1.4
« Last Edit: January 23, 2010, 05:44:59 PM by rab » Logged
iLLNESS
Master Hacker
****
Posts: 398


View Profile
« Reply #1 on: December 11, 2009, 06:59:49 PM »

testing it out now. ive got 2 nand dumps that are not matched, with 5 dumps that are good. will compare the 2 unmatched with 1 matched and see what it comes up with Smiley

nevermind, i cant test it
rs21.rapidshare is down for me right now

any chance you could mirror it on megaupload or some other site?
« Last Edit: December 11, 2009, 07:06:56 PM by iLLNESS » Logged
vintage_guitar
Hacker
***
Posts: 55


View Profile
« Reply #2 on: December 11, 2009, 09:00:16 PM »

http://www.megaupload.com/?d=34JHYO6S
Logged
iLLNESS
Master Hacker
****
Posts: 398


View Profile
« Reply #3 on: December 11, 2009, 10:36:06 PM »

i get wrong file lengths error trying to load my dumps..

then again they are 512mb Shocked
Logged
rab
Hacker
***
Posts: 63


View Profile
« Reply #4 on: December 12, 2009, 06:41:42 PM »

I can add support for that. Are your files 553,648,128 bytes (32,768 blocks at 16,896 bytes/block)?
Logged
iLLNESS
Master Hacker
****
Posts: 398


View Profile
« Reply #5 on: December 12, 2009, 07:17:52 PM »

yes they are
Logged
uN0pEn
Hacker
***
Posts: 54


View Profile
« Reply #6 on: December 12, 2009, 07:21:43 PM »

Thanks. This app helps out alot.
Logged

As with all things uN0pEn
rab
Hacker
***
Posts: 63


View Profile
« Reply #7 on: December 13, 2009, 02:37:28 PM »

App updated to handle 512mb nand images as requested (see first post for details). v1.0 read all the files into memory at once since they were small (worst case app would need about 64mb of ram), but this wouldn't be great for 512mb nands (would need 2gb of ram) so I've rewritten to be more efficient from a ram view point. Note: reconstructing a 512mb nand takes about 20 seconds.
Logged
badwolf
Member
**
Posts: 18



View Profile
« Reply #8 on: December 14, 2009, 06:42:16 PM »

And for 256 nand? I try to open and the program refuse. (276.824.064 bytes)
Logged
vintage_guitar
Hacker
***
Posts: 55


View Profile
« Reply #9 on: December 15, 2009, 01:20:26 AM »

Thanks, I can confirm it works on 512MB NAND. Just tested it, no bad blocks found between the 2 dumps from lflash.c I verified as having none with hex workshop. Takes about 20seconds or so as you said, makes you think the app froze though. Maybe a loading bar of some sort could be implemented? People snagging this from other places probably wont read this thread about the delay and close the application thinking it froze.
Logged
rab
Hacker
***
Posts: 63


View Profile
« Reply #10 on: December 15, 2009, 01:22:29 AM »

I can add 256mb support & a progress bar. Also, from what I've been reading, are you sure these larger nands use the same block size?
Logged
vintage_guitar
Hacker
***
Posts: 55


View Profile
« Reply #11 on: December 15, 2009, 02:00:38 AM »

Hmm, after I did that comparison, the "last modified" date was cleared when viewing in windows. They still match with one another, but I didn't tell the program to make any changes, just compare.
[edit] ok, nevermind. apparently they never got a last modified date.
« Last Edit: December 15, 2009, 02:19:02 AM by vintage_guitar » Logged
rab
Hacker
***
Posts: 63


View Profile
« Reply #12 on: December 15, 2009, 03:24:45 AM »

Odd, but I can assure you that the tool does not change the modified date, it opens existing nand files in read only mode. The only file it opens for writing is the reconstructed nand file (if you choose to do this).
Logged
littlestevie360
Master Hacker
****
Posts: 313

past the point of caring


View Profile
« Reply #13 on: December 15, 2009, 04:52:09 AM »

are you sure these larger nands use the same block size?
im sure they do not use the same block size
Logged
rab
Hacker
***
Posts: 63


View Profile
« Reply #14 on: December 15, 2009, 02:35:48 PM »

Updated, see first post.
- 256mb nand support
- progress bar
- correct block size for 256/512mb nand (note: if you compare the output to a previous run for a 512mb nand you'll see different block numbers now that the size has been corrected)
Logged
zouzzz
Master Hacker
****
Posts: 326


View Profile
« Reply #15 on: December 15, 2009, 04:33:52 PM »

Good Job.
Logged

calimba
Newbie
*
Posts: 4


View Profile
« Reply #16 on: December 17, 2009, 10:58:59 AM »

excelent work
Logged
rab
Hacker
***
Posts: 63


View Profile
« Reply #17 on: December 17, 2009, 11:30:47 AM »

I'm still a bit unsure about the block size for the large nands though. I don't have access to any of them to test against.

Really this tool needs to match it's block numbering up against nandpro, which it does for 16mb nands. The questions is, even if the big nands really use larger blocks, does nandpro operate using larger blocks (hence do my numbers really match up). If anyone can give me a definitive answer I'll happily make sure the tool matches.

Can anyone with a large nand tell me how many blocks nandpro reads it in, and how large (in bytes) a read of a single block is.
Logged
funkyfish77
Member
**
Posts: 10


View Profile
« Reply #18 on: December 21, 2009, 12:49:56 PM »

I have a question I only have 2 nand dumps is there a way to reconstruct 2 nands instead of 3 ?
any help would be great thanks
Logged
rab
Hacker
***
Posts: 63


View Profile
« Reply #19 on: December 21, 2009, 12:54:36 PM »

I have a question I only have 2 nand dumps is there a way to reconstruct 2 nands instead of 3 ?
No. If you only have 2 dumps, when a block differs between the 2, how do you tell which is the good one and which is the bad one? Using 3 dumps, if a block matches in 2 out of 3 then that's probably the good one.
Logged
Pages: 1 2 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM