Skip to content

egely1337/source2-vpk-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Source 2 VPK Extractor 🤔 (based on)

A small C-written tool designed to extract files from .vpk archives, specifically supporting Source 2. This program efficiently opens VPK files, allowing easy access and extraction of their contents.

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>

#include <vpk.h>

const char* game_base_dir = "source2 game path";
const char* extract_path = "extract directory";

int main(int argc, char** argv) {
    vpk_data_t vpk_file = read_vpk(game_base_dir);

    for(int i = 2; i < vpk_file.file_count; i++) {
        fprintf(stdout, 
            "Filename: %s | "
            "Offset: %d | "
            "Lenght: %d | "
            "Archive: %d\n", vpk_file.files[i].path, vpk_file.files[i].cur, vpk_file.files[i].lenght, vpk_file.files[i].archive_index
        );

        extract_vpk(&vpk_file.files[i], extract_path, game_base_dir);
    }
    
    printf("Total Files: %d\n", vpk_file.file_count);

    return 0;
}

About

you will extract .vpk files much easier!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages