Skip to content

Instantly share code, notes, and snippets.

@Tarliton
Created November 2, 2017 13:46
Show Gist options
  • Save Tarliton/32a709034c107298468f081efc0f9f44 to your computer and use it in GitHub Desktop.
Save Tarliton/32a709034c107298468f081efc0f9f44 to your computer and use it in GitHub Desktop.
import vpk
def build_cache(path, map_name):
pak1 = vpk.open(path)
total = 0
for i, f in enumerate(pak1):
if map_name in f:
print(f'reading {i}', f, pak1[f].file_length)
pak1[f].read()
total += pak1[f].file_length
print('read:', total)
if __name__ == '__main__':
path = '/home/<USER>/.local/share/Steam/steamapps/common/Counter-Strike Global Offensive/csgo/pak01_dir.vpk'
build_cache(path, 'mirage')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment