Guest User

Stellaris Savegame Packer

a guest
Sep 25th, 2016
3,700
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2.  
  3. import sys
  4. import zipfile
  5.  
  6. gameFiles = ("meta", "gamestate")
  7. outFile = "game.sav"
  8. gfPath = "."
  9.  
  10. gameData = {}
  11. for gameFile in (gameFiles):
  12. with open(gfPath + "/" + gameFile, 'rb') as curFile:
  13. gameData[gameFile] = curFile.read()
  14.  
  15. zf = zipfile.ZipFile(outFile, mode='w')
  16.  
  17. try:
  18. for gameFile in gameFiles:
  19. info = zipfile.ZipInfo(gameFile, date_time=(1980, 0, 0, 0, 0, 0))
  20. info.compress_type=zipfile.ZIP_DEFLATED
  21. info.create_system=0
  22. info.create_version = 63
  23. info.extract_version = 20
  24. zf.writestr(info, gameData[gameFile])
  25. finally:
  26. zf.close()
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×