Skip to content

Instantly share code, notes, and snippets.

@lokkju
Created November 6, 2014 09:46
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save lokkju/533b9c0a0783287d9168 to your computer and use it in GitHub Desktop.
Save lokkju/533b9c0a0783287d9168 to your computer and use it in GitHub Desktop.
Decode Vaulty protected .vdata files
#!/usr/bin/python
# This program will copy, rename and decode Vaulty .vdata files back to images and videos for viewing in normal applications.
# Usage: python vaulty-decode.py <directory with .vdata files>
import sys
import os
import glob
import io
def usage():
print "Usage: %s <path to directory with vdata files>" % sys.argv[0]
print ""
sys.exit()
def main(args):
if len(args) != 2 or not os.path.isdir(args[1]):
print "Error: Invalid Argument, please provide a valid directory name"
usage()
vdata_dir = args[1]
vdata_files = glob.glob(os.path.join(vdata_dir,'*.vdata'))
print "Found %s .vdata encoded files" % len(vdata_files)
for vdata_file in vdata_files:
with io.open(vdata_file,'rb') as vfdf:
bn = os.path.basename(vdata_file)
if vfdf.read(8) == 'obscured':
nfn = 'decrypted_' + bn + '.jpg'
with io.open(os.path.join(vdata_dir,nfn),'wb') as idf:
idf.write(vfdf.read())
print "processed %s" % nfn
else:
nfn = 'decrypted_' + bn + '.3gp'
vfdf.seek(0)
with io.open(os.path.join(vdata_dir,nfn),'wb') as idf:
idf.write(vfdf.read())
print "processed %s" % nfn
print "Done!"
if __name__ == '__main__':
main(sys.argv)
@pjstella
Copy link

pjstella commented Jun 6, 2017

hi please help me i have a lot of vdata files in my drive,how can i convert them what should i do ?

@ctc22
Copy link

ctc22 commented Sep 9, 2017

I also need help with understanding the process of running this code or simply converting the data files.

@Reiq
Copy link

Reiq commented Sep 25, 2018

Recently attempted to use this tool to recover my vaulty files.

Advice for future users:

As stated in the above comment there are syntax errors that have to be fixed for it to run
It appears to only support .jpg and .3gp
If the file was originally a .png etc it will automatically export the file as a .3gp
All of my files were png so none of them were properly "decoded" and I haven't tested the seemingly supported formats.

I found a way easier method if you are having issues and don't want to customize this script:

Open up the .vdata file in your hex editor of choice (I use HxD)
On the first line will be "obscured" followed by "%PNG" or "%JPG" depending on the file type.
All you have to do now is delete the word "obscured" which will put "%PNG" to the beginning of the file.
Save and then just rename the extension of the file to whatever was after the %

Profit. Hope this helps out.

@opsoyo
Copy link

opsoyo commented May 30, 2019

If anybody need this, here's a 3.7.1 compatible update to this script. Only tested on JPGs.

#!/usr/bin/python

# This program will copy, rename and decode Vaulty .vdata files back to images and videos for viewing in normal applications.
# Usage: python vaulty-decode.py <directory with .vdata files>

import sys
import os
import glob
import io

def usage():
  print("Usage: {} <path to directory with vdata files>".format(sys.argv[0]))
  print("")
  sys.exit()

def main(args):
  if len(args) != 2 or not os.path.isdir(args[1]):
    print("Error: Invalid Argument, please provide a valid directory name")
    usage()
  vdata_dir = args[1]
  vdata_files = glob.glob(os.path.join(vdata_dir,'*.vdata'))
  print("Found {} .vdata encoded files".format(len(vdata_files)))
  for vdata_file in vdata_files:
    with io.open(vdata_file,'rb') as vfdf:
      bn = os.path.basename(vdata_file)
      if vfdf.read(8) == b'obscured':
        nfn = 'decrypted_' + bn + '.jpg'
        with io.open(os.path.join(vdata_dir,nfn),'wb') as idf:
          idf.write(vfdf.read())
        print("processed {}".format(nfn))
      else:
        nfn = 'decrypted_' + bn + '.3gp'
        vfdf.seek(0)
        with io.open(os.path.join(vdata_dir,nfn),'wb') as idf:
          idf.write(vfdf.read())
        print("processed {}".format(nfn))
  print("Done!")

if __name__ == '__main__':
  main(sys.argv)

@Houser-Lab
Copy link

Recently attempted to use this tool to recover my vaulty files.

Advice for future users:

As stated in the above comment there are syntax errors that have to be fixed for it to run It appears to only support .jpg and .3gp If the file was originally a .png etc it will automatically export the file as a .3gp All of my files were png so none of them were properly "decoded" and I haven't tested the seemingly supported formats.

I found a way easier method if you are having issues and don't want to customize this script:

Open up the .vdata file in your hex editor of choice (I use HxD) On the first line will be "obscured" followed by "%PNG" or "%JPG" depending on the file type. All you have to do now is delete the word "obscured" which will put "%PNG" to the beginning of the file. Save and then just rename the extension of the file to whatever was after the %

Profit. Hope this helps out.

This definitely helped. Thanks for the info! FYI for others who had videos: it shows differently than a photo. It shows something like "ftypmp42", which means mp4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment