I tried to do an extraction of the VPK file and repackaged it.
defextract():
pak1=vpk.open("E:/Program Files (x86)/Steam/steamapps/workshop/content/570/2967026351/2967026351.vpk")
forfilepathinpak1:
print(filepath)
file=pak1.get_file(filepath)
path=os.path.join("./Lost_Temple", filepath)
directory=os.path.dirname(path)
ifnotos.path.exists(directory):
os.makedirs(directory, exist_ok=True)
file.save(path)
defpack_vpk():
pak=vpk.new("./Lost_Temple")
pak.save("E:/Program Files (x86)/Steam/steamapps/workshop/content/570/2967026351/2967026352.vpk")But when I open 2967026352.vpk using GCFSpace, I get an error: Could not open 2967026352.vpk. Invalid file: The file map is not within mapping bounds.
Then I realized that the repackaged VPK tree_length didn't match the source file.
defprint_vpk():
pak1=vpk.open("E:/Program Files (x86)/Steam/steamapps/workshop/content/570/2967026351/2967026351.vpk")
# 242158print(pak1.tree_length)
pak2=vpk.open("E:/Program Files (x86)/Steam/steamapps/workshop/content/570/2967026351/2967026352.vpk")
# 242114print(pak2.tree_length)Did I do something wrong?
I tried to do an extraction of the VPK file and repackaged it.
But when I open
2967026352.vpkusing GCFSpace, I get an error:Could not open 2967026352.vpk. Invalid file: The file map is not within mapping bounds.Then I realized that the repackaged VPK tree_length didn't match the source file.
Did I do something wrong?