Advertisement
CollectorTogami

VCConvert.py

Jan 27th, 2018
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.88 KB | None | 0 0
  1. import sys
  2. import os
  3. import binascii
  4.  
  5.  
  6. print("VCConvert by Collector Togami. Enter your save file as a parameter\n I am not responsible for damages to your files, do not use this with non save files, etc etc. You know the drill.")
  7.  
  8. file=open(sys.argv[1], 'rb+')
  9. filesize=os.path.getsize(file.name)
  10.  
  11.  
  12. # Defining the VC file size and and actually relevant save size
  13. VCSize=32784
  14. RegularSize=32768
  15.  
  16. file.read(RegularSize)
  17. directory=os.walk(file)
  18.  
  19. # Is this a VC sized save file?
  20.  
  21. # Yes it is. We'll truncate.
  22. if filesize == VCSize:
  23.     file.truncate()
  24.     file.close()
  25.     os.rename(os.path.basename(file.name), "converted.sav")
  26.  
  27. #No, it isn't. We'll add a 16 byte string, whose contents do not matter.    
  28. else:
  29.     file.close()
  30.     file=open(sys.argv[1],'a')
  31.     file.write("Hex agony b here")
  32.     file.close()
  33.     os.rename(os.path.basename(file.name), "sav.dat")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement