this post was submitted on 16 Jun 2024
26 points (93.3% liked)

Ask Lemmy

27258 readers
1819 users here now

A Fediverse community for open-ended, thought provoking questions


Rules: (interactive)


1) Be nice and; have funDoxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them


2) All posts must end with a '?'This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?


3) No spamPlease do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.


4) NSFW is okay, within reasonJust remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either [email protected] or [email protected]. NSFW comments should be restricted to posts tagged [NSFW].


5) This is not a support community.
It is not a place for 'how do I?', type questions. If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email [email protected]. For other questions check our partnered communities list, or use the search function.


6) No US Politics.
Please don't post about current US Politics. If you need to do this, try [email protected] or [email protected]


Reminder: The terms of service apply here too.

Partnered Communities:

Tech Support

No Stupid Questions

You Should Know

Reddit

Jokes

Ask Ouija


Logo design credit goes to: tubbadu


founded 2 years ago
MODERATORS
 

Solution: Indeed it was EncFs file level encryption.

Thanks a lot for everyone helping!

Original post below:

Hope it is ok to ask technical questions in this channel!

I found a folder of files on one of my back drives which was copied from a very old cell phone or a SAMSUNG Galaxy S2.

The folder is called DCIM and in a sub folder called Camera there are files with a .jpg extension.

This files are not standard JPG files. They start with the following header:

0000000 0000 0000 3900 c0d8 ac5f d196 2d63 2421
0000010 0003 0200 0000 0010 0200 2d8c 0904 0103
0000020 0000 0000 0000 0000 e960 2861 7025 ba0e
0000030 2424 dcfa 3e3b ee64 0800 c87b a43a a90d
0000040 7287 b815 7ca4 9680 ed65 6216 5f08 4f43
0000050 534e 4c4f 0045 0000 9000 b3e9 1333 92b9
0000060 0002 0000 0000 0000 0000 0000 0000 0000
0000070 0000 0000 0000 0000 0000 0000 0000 0000

(obtained via hexdump -n 1024 filename.jpg).

The file command just returns 'data'. The jpgrecovery command simply does not process this files. If I open the file in a file viewer (shotwell), I get the error that the file starts with 0 0, which is correct, as seen in the above hexdump.

All this commands were executed on Debian 12.

I have hundreds of files with this JPG extension and for each file the header isstarting with 0 0 in this folder, so I assume the problem is not corruption of one file.

My questions:

  1. What kind of file format is this?
  2. How can I convert the files to JPGs?
top 8 comments
sorted by: hot top controversial new old
[–] [email protected] 4 points 6 months ago* (last edited 6 months ago) (1 children)

So the header for a JPEG should start with FF D8 and end in FF D9

So maybe check if the files at least end correctly, if they do you could try adding the magic bytes back.

I'd secondly try opening the file in as many applications as possible, one might be a bit more lenient/smarter in pulling the image out of a not-quite-right file.

Finally you suggest they're all the same header, is everything else on the drive fine? Is there a chance some cryptolocker malware has had a chance to run over the drive? I'm suggesting as the files could have been encrypted in some way and this is what's preventing you from reading them

Edit: worth noting I used an S2 years ago and had no problems getting the images off back then

[–] wolf 1 points 6 months ago (1 children)

Thanks for your suggestions: Can confirm start/end bytes are wrong. Tried to open in Shotwell, GIMP, Firefox, Google Chrome w/o results.

I assume the hard drive is ok: I also have some git repositories on the drive and the checksums for git are correct. Every other file on the drive is ok, so cryptolocker malware could have only been on my phone at that time.

[–] [email protected] 2 points 6 months ago (1 children)

That's unfortunate to hear, I'm afraid that's me out of ideas then really. Very strange that they're all corrupted in the same way, I'll let you know if any other ideas pop into my head as to how this could have happened.

[–] wolf 1 points 6 months ago

No worries and thanks a lot for your suggestions/answers!

[–] [email protected] 2 points 6 months ago

Listen to the people who say it's probably encryption. I'd agree with that. And you can try all sorts of programs and ways to fix corrupted files... It won't help if it's encryption. You'd need to find out the specifics, see if there is a script floating around or some tutorial for your specific phone model that tells you how to decrypt them.

[–] [email protected] 0 points 6 months ago (2 children)

if you have access to a windows computer, or perhaps wine can work?, there might be a solution in the bottom of this thread where someone had a similar problem

https://superuser.com/questions/972013/how-to-repair-corrupt-jpeg-files

haven't tested it, so do some antivirus checks on the tool before you decide to test it just to be sure.

good luck, hope you get it sorted

[–] [email protected] 3 points 6 months ago

or, if it was a LG phone, could they be encrypted?

if so, perhaps this will help https://github.com/kamicater/LG-Gallery-Decryptor

[–] [email protected] 3 points 6 months ago

or you might be unable to decrypt them at all