{"id":45483546,"url":"https://github.com/wows-tools/wows-depack","last_synced_at":"2026-02-22T16:37:01.018Z","repository":{"id":129450646,"uuid":"596779048","full_name":"wows-tools/wows-depack","owner":"wows-tools","description":"WoWs resource unpack tool \u0026 lib","archived":false,"fork":false,"pushed_at":"2025-04-25T21:47:01.000Z","size":714,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-25T22:25:19.062Z","etag":null,"topics":["reverse-engineering","worldofwarships","wows"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wows-tools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-02T22:49:05.000Z","updated_at":"2025-04-25T21:46:23.000Z","dependencies_parsed_at":"2024-02-01T10:27:56.873Z","dependency_job_id":"c3c23394-a7b1-4f0e-9d54-d023316d72f9","html_url":"https://github.com/wows-tools/wows-depack","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/wows-tools/wows-depack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wows-tools%2Fwows-depack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wows-tools%2Fwows-depack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wows-tools%2Fwows-depack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wows-tools%2Fwows-depack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wows-tools","download_url":"https://codeload.github.com/wows-tools/wows-depack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wows-tools%2Fwows-depack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29718483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T15:10:41.462Z","status":"ssl_error","status_checked_at":"2026-02-22T15:10:04.636Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["reverse-engineering","worldofwarships","wows"],"created_at":"2026-02-22T16:37:00.171Z","updated_at":"2026-02-22T16:37:01.006Z","avatar_url":"https://github.com/wows-tools.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WoWs depack\n\n[![Ubuntu-x86_64](https://github.com/kakwa/wows-depack/actions/workflows/ubuntu-x86_64.yml/badge.svg)](https://github.com/kakwa/wows-depack/actions/workflows/ubuntu-x86_64.yml)\n[![codecov](https://codecov.io/gh/wows-tools/wows-depack/graph/badge.svg?token=GU98T1VKIH)](https://codecov.io/gh/wows-tools/wows-depack)\n\nOpen-Source World of Warships resource files unpacker.\n\n# Links\n\nInteresting links:\n\n* Git repository: [github.com/wows-tools/wows-depack](https://github.com/wows-tools/wows-depack)\n* Format specification: [FORMAT.md](https://github.com/kakwa/wows-depack/blob/main/FORMAT.md).\n* Reverse Engineering process: [REVERSING_STORY.md](https://github.com/kakwa/wows-depack/blob/main/REVERSING_STORY.md)\n* Library API: [C API documentation](https://wows-tools.github.io/wows-depack/wows-depack_8h.html)\n\n# Usage\n\n## Install\n\nPackages are available for most major distributions in [this repository](https://github.com/kakwa/kakwalab-pkg/blob/main/README.md).\n\nFollow the instructions to setup the repository and install the following packages:\n\n```bash\n# Switch to dnf on RHEL\n\n# CLI Tool\napt install wows-depack-cli\n\n# Library\napt install libwows-depack0\n\n# Development Header (for RHEL libwows-depack-devel)\napt install libwows-depack-dev\n````\n\n## Build\n\n```shell\n# Install deps Debian/Ubuntu\napt install git cmake zlib1g-dev libpcre2-dev clang\n\n# git clone + go in project dir\ngit clone https://github.com/kakwa/wows-depack.git\ncd wows-depack/\n\n# build\ncmake .\nmake\n```\n\n## CLI tool\n\n### Help\n\n```shell\n./wows-depack-cli --help\n\nUsage: wows-depack-cli [OPTION...] -W WOWS_BASE_DIR\n\nWorld of Warships resource extractor tool.\n[...]\n```\n\n### Print all files\n\nTo print all the files present:\n```shell\n./wows-depack-cli -W ~/Games/World\\ of\\ Warships/ -p\n\n/gui/modernization_icons/icon_modernization_PCM020_DamageControl_Mod_I.png\n/gui/modernization_icons/icon_modernization_PCM047_Special_Mod_I_Montana.png\n[...]\n/clanbase/headquarters_2/6/29/31.png\n/server_stats.xml\n\n```\n### Search\n\nSearch files by name pattern (perl compatible regular expression):\n\n```shell\n./wows-depack-cli -W ~/Games/World\\ of\\ Warships/ -s '.*[Pp]arams.*'\n\nFound 3 matching files:\nshipyardParams.xml\ncontent/GameParams.data\ncontent/UIParams.data\n```\n\n### Extract a single file\n\nTo Extract a Single file, do:\n\n```shell\n./wows-depack-cli -W ~/Games/World\\ of\\ Warships/ \\\n\t-e 'content/GameParams.data' -o GameParams.data\n```\n\n### Extract a whole directory\n\nTo extract a whole sub directory, do:\n\n```shell\n./wows-depack-cli -W ~/Games/World\\ of\\ Warships/ \\\n\t-e 'content/' -O out/\n```\n\n### Extract every World of Warships resource files\n\nTo extract everything (rip your free disk space), run:\n\n```shell\n./wows-depack-cli -W ~/Games/World\\ of\\ Warships/ \\\n\t-e '/' -O out/\n```\n\n### Parse Specific index file(s)\n\nInstead of `-W/--wows-dir`, a specific index file or directory can be specified through the `-i` or `-I` options.\n\nParse a single index file:\n\n```shell\n./wows-depack-cli -i ~/Games/World\\ of\\ Warships/bin/6831266/idx/system_data.idx -p\n```\n\nParse all the indexes in an index directory:\n\n```shell\n./wows-depack-cli -I ~/Games/World\\ of\\ Warships/bin/6831266/idx/ -p\n```\n\nNote, the other examples are using `-W \u003cWOWS DIR\u003e` , but it could be faster to specify one index file directly through `-i \u003cFILE\u003e`.\nSpecifically, `GameParams,data` is referenced in the `system_data.idx` index.\n\nAlso, please note that you will need to adapt the path to your WoWs install and the parent of `idx/` (the `6831266` part changes with every update).\n\n## Library\n\n### API documentation\n\nThe API documentation [is available here](https://wows-tools.github.io/wows-depack/wows-depack_8h.html).\n\n### Usage examples\n\n#### Initialize Context \u0026 Parse Index Files\n\nTo start searching/extracting file, you first need to init \u0026 fill the context.\n\nWith a single index file:\n\n```C\n#include \"wows-depack.h\"\n\n\n/* Other debug categories */\n// WOWS_DEBUG_RAW_RECORD\n// WOWS_DEBUG_FILE_LISTING\n/* several debug categories can be enabled like so: */\n// WOWS_DEBUG_FILE_LISTING | WOWS_DEBUG_RAW_RECORD;\n\n\nWOWS_CONTEXT *context = wows_init_context(WOWS_NO_DEBUG);\n\n/* Parse the index file */\nint ret = wows_parse_index(index_file_path, context);\n```\n\nTo parse the indexes, you can either specify a specific index file:\n\n```C\nchar *index_file_path = \"Games/World of Warships/bin/6831266/idx/system_data.idx\"\n\n/* Parse the index file */\nint ret = wows_parse_index(index_file_path, context);\n```\n\nAlternatively, you can parse all the index files in a given directory:\n\n```C\n// Note: the '6831266' directory changes every updates\nchar *index_dir_path = \"Games/World of Warships/bin/6831266/idx\"\n\n/* Parse the index file */\nint ret = wows_parse_index_dir(index_dir_path, context);\n```\n\nWows depack also provides a small helper to detect the latest idx directory.\n```C\nchar *index_dir_path;\n\nget_latest_idx_dir(\"Games/World of Warships/\", index_dir_path);\n\n/* Parse the index file */\nint ret = wows_parse_index_dir(index_dir_path, context);\n\n// [...] do stuff\n\n// You need to free index_dir_path after\nfree(index_dir_path);\n```\n\n\n\nThese operations will parse one or several index files, and construct a pseudo-filesystem tree which can be then explored.\n\n#### Searching files/directories\n\nIt's possible to search for matching files inside the indexes:\n\n```C\n// Init output variables\nint resc;\nchar **res_files;\n\n\n/* Supported search modes:\nWOWS_SEARCH_FILE_ONLY     \u003c Search only on file names.\nWOWS_SEARCH_DIR_ONLY      \u003c Search only on directory names.\nWOWS_SEARCH_FILE_PLUS_DIR \u003c Search on directory and file names.\nWOWS_SEARCH_FULL_PATH     \u003c Search on the full path of files.\n*/\n\n// PCRE search pattern, please note that the final regex is \"^\u003csearch_pattern\u003e$\"\nchar *search_pattern = \".*Params.*\";\n\n// Search the files\nwows_search(context, search_pattern, WOWS_SEARCH_FILE_ONLY, \u0026resc, \u0026res_files);\n\n// Print and free the result\nprintf(\"Found %d matching files:\\n\", resc);\nfor (int i = 0; i \u003c resc; i++) {\n    printf(\"%s\\n\", res_files[i]);\n    // Free Each file path must be freed\n    free(res_files[i]);\n}\n// Free the array containing these paths\nfree(res_files);\n```\n\n#### Extracting Files\n\nTo extract files, you can do the following:\n\n```C\nchar *output = \"path/output.xml\"\n\n// Extract to output file\nret = wows_extract_file(context, \"stuff.xml\", output);\n```\n\nIf you want to control the underlying File Pointer (for example, to write in a memstream), extract functions also provide an `_fp` version whenever possible:\n\n```C\nchar *buf = NULL;\nsize_t buf_size = 0;\n\n// Open the file\nFILE *f = open_memstream(\u0026buf, \u0026buf_size);\n\n// Extract to File *\nret = wows_extract_file_fp(context, \"stuff.xml\", f);\n\n// Close the file\nfclose(f);\n\nfree(buff);\n```\n\nYou can also extract files recursively under a given directory:\n\n```C\nchar *output_dir = \"./out/\"\n\nret = wows_extract_dir(context, \"/wows-resources/dockyard/\", output_dir);\n```\n\nNote that with this extract, wows-depack will reproduce the pseudo-filesystem in the archive with `output_dir` as its root.\n\n#### Clean-up\n\nOnce done, you need to release the context memory:\n\n```C\nwows_free_context(context);\n```\n\n#### Error Handling \u0026 Debugging\n\nMost `wows_*` returns 0 on success or error codes on failure.\nTo convert it to an error message, you can do the following:\n\n```C\n// wows_* function call example\nint ret = wows_parse_index(index_file_path, context);\n\n/* Error handling */\nif (ret != 0) {\n    /* get an error message + additional info from context + return code */\n    char *err_msg = wows_error_string(ret, context);\n    printf(\"Error: %s\\n\", err_msg);\n    // the message must be freed\n    free(err_msg);\n}\n```\n\nTo print the whole pseudo-filesystem tree to `stdout`, you can use the following functions:\n\n```C\n// Print a tree like layout\nwows_print_tree(context);\n\n// Print the full path of each file, one per line\nwows_print_flat(context);\n```\n\n#### Write support\n\nwows-depack provides experimental write support for creating index and pkg files:\n\n```C\nchar *input_dir = \"./tests\";\nFILE *nfd_pkg = fopen(\"stuff.pkg\", \"w+\");\nFILE *nfd_idx = fopen(\"stuff.idx\", \"w+\");\nwows_write_pkg(context, input_dir, \"stuff.pkg\", nfd_pkg, nfd_idx);\nfclose(nfd_idx);\nfclose(nfd_pkg);\n```\n\nPlease note that the write support is limited, and was created mainly to generate test data.\n\n# Build \u0026 development\n\n## Dependencies\n\nInstalling the dependencies on Debian:\n\n```shell\napt install cmake zlib1g-dev libpcre3-dev clang\n```\n\nInstalling the test/coverage/doc dependencies:\n\n```shell\napt install lcov libcunit1-dev doxygen\n```\n\n## Build\n\n```shell\ncmake .\nmake\n```\n\n## Install\n\n```shell\n# Remove DESTDIR for system installation\nmake install DESTDIR=fakeroot\n```\nFiles installed:\n```shell\ntree fakeroot\nfakeroot\n└── usr\n    └── local\n        ├── bin\n        │   └── wows-depack-cli\n        ├── include\n        │   └── wows-depack.h\n        └── lib\n            ├── libwows-depack.so -\u003e libwows-depack.so.0\n            ├── libwows-depack.so.0 -\u003e libwows-depack.so.0.1.0\n            └── libwows-depack.so.0.1.0\n```\n\n## Tests\n\nTo run the unit tests, do the following:\n\n```shell\n# cmake run (on time)\ncmake -DCOVERAGE=ON -DBUILD_TESTS=ON .\n# run just the unit tests\nmake tests\n# run also the coverage tests\nmake coverage\n```\n\nin case of issues, you can directly launch the test binary alone:\n```shell\n# directly:\n./wows-depack-test\n\n# or with gdb:\ngdb --args ./wows-depack-test\n```\n\n## Documentation\n\nTo build the doxygen documentation:\n\n```shell\ncmake -DBUILD_DOC=ON .\n\nmake doc_doxygen\n```\n\nOptionally, get a nicer doxygen theme:\n\n```shell\n./misc/setup_doxycss.sh\n\nmake doc_doxygen\n```\n\n\n## Fuzzing\n\nThis tool/lib parses binary data, consequently checking for overflow might be a good idea.\n\nTo do so, install [american fuzzy lop++ (afl++)](https://aflplus.plus/):\n\n```shell\n# Debian/Ubuntu\napt install afl-clang\n\n# Mac OS\nbrew install afl-fuzz\n```\n\nCompile with afl support:\n```shell\ncmake -DCMAKE_CXX_COMPILER=afl-clang++ -DCMAKE_C_COMPILER=afl-clang .\nmake\n```\n\nRun the fuzzing\n```shell\n# Replace with your WoWs install directory\nINDEX_DIR=\"~/Games/World\\ of\\ Warships/bin/6775398/idx/\"\n\nafl-fuzz -i \"$INDEX_DIR\" -o ./out -t 10000 -- ./wows-depack-cli -i '@@'\n```\n\nThen wait for crashes to occur (hopefully this will be in vain).\n\n# Versions\n\n## 0.3.0\n\n* switch to libpcre2\n\n## 0.2.0\n\n* fix endianess \u0026 alignement issues when unpacking\n\n## 0.1.0\n\n* initial version\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwows-tools%2Fwows-depack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwows-tools%2Fwows-depack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwows-tools%2Fwows-depack/lists"}