Jump to content



Photo
canon cr2 corrupted cr2 hex editor exiftool

  • Please log in to reply
29 replies to this topic

#16 OP RobertBetz

RobertBetz

    Neowinian

  • Joined: 25-November 13

Posted 26 November 2013 - 00:39

This is greek to me. Any help in salvaging these images would be so appreciated. Let me look over the post, get the program and take a stab. Worst case scenario I get nowhere and hire you :-)

There are 800 images. Need to salvage as many as I can. 
 




#17 vcfan

vcfan

    Straight Ballin'

  • Tech Issues Solved: 3
  • Joined: 12-June 11

Posted 26 November 2013 - 00:41

turns out, this is just the lossless jpeg image that is stored as grayscale. there is still plenty of info in the file such as color that needs to be parsed. i'll definitely parse the file further hoping to demangle it so it displays correctly.



#18 vcfan

vcfan

    Straight Ballin'

  • Tech Issues Solved: 3
  • Joined: 12-June 11

Posted 26 November 2013 - 00:54

getting there

 

TQPLrXf.png



#19 vcfan

vcfan

    Straight Ballin'

  • Tech Issues Solved: 3
  • Joined: 12-June 11

Posted 26 November 2013 - 01:35

ok heres the deal. it looks like in each of the 2 files you provided, there is the complete grayscale image, and some color data, about 1/4 color of the image. there is other data in the file, but this looks like color data of a different file. i tried replacing the 3/4 color data in one file from the other one you gave me, but it isnt the right one. the problem is that parts of different files are mangled in between and they may not be in order.

 

you provided image files 8767,and 8768. if you could upload 5 images before 8767 and 5 images after 8768, i could then try using the color information from those files into the 2 images i currently have. if the correct color exists in these for the 2 files i have, then hopefully there is a pattern where we could see for example 3 filename numbers back has the correct color information for us to complete the current numbered image.



#20 +theblazingangel

theblazingangel

    Software Engineer

  • Tech Issues Solved: 6
  • Joined: 25-March 04
  • Location: England, UK

Posted 26 November 2013 - 01:49

If you want to get a raw byte-by-byte image of the entire memory card to me, perhaps from that I could attempt to repair the filesystem and see if we can get the entire set of files restored.



#21 +theblazingangel

theblazingangel

    Software Engineer

  • Tech Issues Solved: 6
  • Joined: 25-March 04
  • Location: England, UK

Posted 26 November 2013 - 03:08

Instructions for doing the above (so you can get on with some of it if I've gone to bed):

 

Capturing the device image:

 

We're going to use the Linux dd command with a 'Live' Linux CD. (I'm presuming you're not using Linux as your main operating system right now, else some of this is redundant).

 

Note, in regards to storage space for saving this device image; The image file is going to be slightly larger than the total volume size of the memory card you're copying. Whether though you actually need this amount of space to store it depends on whether the file system of the device you're storing it on uses compression and if so how much space can be saved. FAT does not use compression, but NTFS does. If you're going to save it to a hard drive, it's perhaps unecessary to point this out, but if you're saving to a pen drive or another memory card, this fact may be important!

 

Also note, I'm generally presuming you're using a Windows computer and therefore NTFS; Ubuntu may 'mount' your NTFS partitions automatically, if not, the following instructions may help: http://superuser.com...-ubuntu-live-cd

 

1) Download a Linux live CD (E.g the standard desktop Ubuntu install disk)

2) Burn it to disk

3) Reboot your computer and boot this (I presume you need no instructions here, ask if you do). At some point during booting it, it'll give you an option to "try ubuntu without making changes to your computer", that's the one you want.

4) Connect the memory card if you haven't already

5) Connect the device/card you're going to save the image file to, if necessary

6) Load a terminal (command prompt)

7) Enter the following, modifying the references to the devices as necessary:

sudo dd if=/dev/hda of=/dev/hdb/image.dd bs=512 conv=noerror,sync

Where /dev/hda is the device to copy from and /dev/hdb is the device to save the file to.

8) When it's completed, you can shutdown and boot your normal OS

 

Getting it to me:

 

We'll use torrents as an efficient mechanism if you're happy with that.

 

1) Download and install utorrent (or other client of choice)

2) File > create new torrent

3) Point it to the image file (image.dd) created above

4) Leave all other options as defaults, i.e. leave the public trackers, leave 'start seeding' checked, leave 'private torrent' UNchecked

5) Click 'create' and save the small torrent file somewhere

6) Email me that little torrent file (I can give you my email via PM)

7) I'll open the torrent file in my torrent client which will start copying the file over to my computer, we just need to leave our computers on until I've got it, then I can start to work on it



#22 OP RobertBetz

RobertBetz

    Neowinian

  • Joined: 25-November 13

Posted 26 November 2013 - 17:33

Ok I am out most of the day but will do this tonight. Thanks for the help!!! 



#23 +theblazingangel

theblazingangel

    Software Engineer

  • Tech Issues Solved: 6
  • Joined: 25-March 04
  • Location: England, UK

Posted 26 November 2013 - 17:49

Oh, something I forgot when writing the above instructions, when sending it to me, stick the image file in a zip file to compress it, then make the torrent with the zip file. That may reduce the size of the file to be transfered. I presume you need no instructions for this, but just ask if you do.

#24 +FiB3R

FiB3R

    "the sun is definitely rising on a new dawn!"

  • Tech Issues Solved: 6
  • Joined: 06-November 02
  • Location: SE London
  • OS: Windows 8.1 Enterprise
  • Phone: Lumia 930

Posted 29 November 2013 - 17:07

How large is this file going to be? Just thinking that using a service like http://ge.tt might be easier, if you are not a torrent user already.

 

 

What is the maximum/largest file size?

We do not limit the file size you can upload, but your account may not have enough storage space for the file. If that's the case you can upgrade your account to get more space.

Some browsers may limit you to 2GB per file. If this is a problem, then you can use a newer browser. Chrome is always a good choice.

 

What is the storage limit without an account?
You have 250MB of storage space without creating an account. If you create a free account you will receive 2GB space.
 


#25 OP RobertBetz

RobertBetz

    Neowinian

  • Joined: 25-November 13

Posted 12 December 2013 - 12:21

Tried this, can't find that address or sequence,,,



#26 +theblazingangel

theblazingangel

    Software Engineer

  • Tech Issues Solved: 6
  • Joined: 25-March 04
  • Location: England, UK

Posted 12 December 2013 - 16:03

Tried this, can't find that address or sequence,,,


I presume that you're getting this error when running the dd command as per my instructions above? Note that in the command, the "if=" bit refers to the input file/device and the "of=" bit refers to the output file/device. In the command I pasted I simply used examples, you need to use the file manager to see what the actual names are for your devices, much like specifying the correct drive letter in Windows! I assume that's where you're going wrong.

Specifically, in the command I wrote, /dev/hda is kind of the equivalent of specifying c:\ in Windows. You need to change this to point to the memory card. Whatever you do don't mess things up and overwrite things on the card else you'll never get the pics back. /dev/hdb refers to the drive on which to store the image file you're creating. image.dd is the name of this image file we're creating.

#27 +theblazingangel

theblazingangel

    Software Engineer

  • Tech Issues Solved: 6
  • Joined: 25-March 04
  • Location: England, UK

Posted 12 December 2013 - 19:25

Actually, I made a mistake, here's the correct command:
sudo dd if=/dev/hda of=/dev/hdb1/image.dd bs=512 conv=noerror,sync
Note, you still need to replace the example references with the correct ones as I just described above. If not done correctly, you could end up overwriting data and screwing things up, so be careful!
 
To help you with getting the correct references:

Understanding device/partition references

A physical storage device (disk/drive/memory-card) will contain one or more "partitions". A partition is simply a portion of the device's storage space which will contain a file system. A device could have just one or could have multiple. Each drive letter in Windows (like C:\) is linked to a specific "partition" and therefore its file system. References to the physical drive itself in Windows are a little more obscure and I won;t go into. In Linux, /dev/hda (hard disk/drive A) is an example reference to a physical device. The 'hd' bit can change; 'hd' is for "IDE" connected disks (considered old now) and 'sd' is for SATA/SCSI connected disks. (USB connected devices you may find referenced with 'sd' also). The letter 'a' on the end means this is the first such device, and with additional devices you'll find 'b', 'c', etc. References to partitions and the file system they contain, in Linux, start with the device reference and simply add a number on the end to reference the specific partition. For example /dev/hda1 refers to the first partition of the first 'hd' connected disk.

(The above isn't strictly a completely perfect and accurate description, but good enough for this).

Note that in the dd command I gave you a couple weeks ago, I made a mistake when specifying the output file; I used a device reference instead of a partition reference (forgot the '1'). (A file needs to be stored within a filesystem of a partition). This is fixed above.

Finding the correct references

The file manager might not actually be the best solution for finding the references you need for the command, as I had suggested above.

In the terminal, try the command:

lsblk
This will list devices and their partitions. Hopefully you'll have no trouble identifying the device reference for the memory card (disk/device reference not partition reference please).

You should hopefully have no trouble also identifying the partition reference for the file system in which you need to save the drive image that needs to be created. This partition needs to be "mounted" though (opened for reading/writing). See below!

Mounting

Note, the memory card does NOT need to be mounted, we're going to be reading from the raw device, we don't need to interact with the filesystem it contains as you normally would!

If there's already a "mount point" specified under the respective column in the output of the above command (lsblk) for the partition on which you want to save the disk image we're creating, then it's already mounted. If it's mounted you can browse to that location with the file manager to confirm it's the partition you think it is if you need to.

If it's not mounted, do the following:
sudo mkdir /tmp_mount_1
sudo mount /dev/sdb1 /tmp_mount_1
Replacing the partition reference here with the one for the partition needing to be mounted. This will mount the partition and therefore allow files to be written to it.

--

Note, 'sudo' at the start of a command essentially means run the following command as root (i.e. essentially with admin prvileges).

#28 Constantin Mindru

Constantin Mindru

    Neowinian

  • Joined: 05-June 14

Posted 05 June 2014 - 09:06

getting there

 

TQPLrXf.png

vcfan, have you managed to get a full color JPEG or CR2 image? I have the same problem.... I only manage to get a black&white Jpeg image from my cr2 files with Photomechanics or other convert software. When load the cr2 in Camera Raw appear in color but corrupted like this image. I am curious if there is something that can be done in a HEX editor to obtain a color Jpeg image.

 

Thanks! 



#29 Constantin Mindru

Constantin Mindru

    Neowinian

  • Joined: 05-June 14

Posted 05 June 2014 - 09:23

I'm using XVI32 to view the files, find the second instance of FF E0 in each one, and delete up to that point.

http://www.chmaas.ha...xvi32/xvi32.htm
http://www.mikekunz....ile_header.html

XVI32 is scriptable, so check out the documentation on their site.

Hi, zhangm. What is the second instance? I opened the cr2 in HEX editor XVI32 and searched for FF E0 but nothing appears.



#30 Constantin Mindru

Constantin Mindru

    Neowinian

  • Joined: 05-June 14

Posted 05 June 2014 - 09:28

If you want to get a raw byte-by-byte image of the entire memory card to me, perhaps from that I could attempt to repair the filesystem and see if we can get the entire set of files restored.

Hi, theblazingangel.

Can you tell me please, is there any possibility to recover overwritten cr2 files from a 32Gb Compact Flash memory card? If no, then is there any possibility to repair a corrupted cr2 file?

Thank you!