2

I just happened to unwillingly delete an important, large, encrypted binary file on my NTFS device by calling C++ write functions with the w flag. All I have done so far is unmounting the device. The file has no structure, such as headers, footers, or magic bytes whatsoever. It's just nearly 116 GB of raw binary data. The file is listed in device directory as an empty file with 0 byte size.

Is there anything I can do besides crying?


UPDATE: The filesystem is on HDD, and the HDD is not encrypted. Here is what I tried:

  • I unmounted the device that contained the file (/dev/sda3).
  • I used TestDisk to scan the device.
  • I found an inode with a size matching my missing file (inode_381265 -> inode_382104 125245022698).
  • I copied the file (inode_381265) to another device.

However, the file seems to be altered since it's not getting decrypted.

PS: The missing file is an encrypted version of a large 7z file using a custom algorithm. The encryption process is not a standard procedure, but rather a (possibly unsafe) handmade combination of XORing with a key and shifting. There is no metadata embedded in the encrypted data, just raw binary.

Appendix: Screenshot for TestDisk result: TestDisk result

10
  • Is the filesystem on SSD or HDD? Commented Aug 25, 2024 at 14:55
  • 2
    @ChrisDavies It's HDD, I managed to recover the file using TestDisk, I'll post the answer. Commented Aug 25, 2024 at 15:13
  • @ChrisDavies I'd appreciate if you could explain the difference between recovering from SSD and HDD, btw the recovered file seems to be altered... Commented Aug 25, 2024 at 16:25
  • R-Studio Undelete r-studio.com/?GIMCX000 Commented Aug 25, 2024 at 17:08
  • 1
    "I'd appreciate if you could explain the difference between recovering from SSD and HDD" - if it's an SSD the likelihood of recovery after truncating a file is pretty much close to zero. With an HDD you do have a chance as the data is still accessible Commented Aug 25, 2024 at 22:04

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.