From afe6b9a29b1f4b5f116a96fa42ee929e32e530e3 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 5 Feb 2026 00:37:59 +0400 Subject: feat: remove Rust project --- .devcontainer/devcontainer.json | 15 - .gitignore | 1 - Cargo.lock | 1710 ------------------------------------- Cargo.toml | 8 - libs/nres/Cargo.toml | 10 - libs/nres/src/converter.rs | 30 - libs/nres/src/error.rs | 45 - libs/nres/src/lib.rs | 24 - libs/nres/src/reader.rs | 227 ----- packer/Cargo.toml | 9 - packer/README.md | 27 - packer/src/main.rs | 175 ---- tools/nres-cli/Cargo.toml | 14 - tools/nres-cli/README.md | 6 - tools/nres-cli/src/main.rs | 198 ----- tools/texture-decoder/Cargo.toml | 8 - tools/texture-decoder/README.md | 13 - tools/texture-decoder/src/main.rs | 41 - tools/unpacker/Cargo.toml | 9 - tools/unpacker/README.md | 41 - tools/unpacker/src/main.rs | 124 --- 21 files changed, 2735 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 Cargo.lock delete mode 100644 Cargo.toml delete mode 100644 libs/nres/Cargo.toml delete mode 100644 libs/nres/src/converter.rs delete mode 100644 libs/nres/src/error.rs delete mode 100644 libs/nres/src/lib.rs delete mode 100644 libs/nres/src/reader.rs delete mode 100644 packer/Cargo.toml delete mode 100644 packer/README.md delete mode 100644 packer/src/main.rs delete mode 100644 tools/nres-cli/Cargo.toml delete mode 100644 tools/nres-cli/README.md delete mode 100644 tools/nres-cli/src/main.rs delete mode 100644 tools/texture-decoder/Cargo.toml delete mode 100644 tools/texture-decoder/README.md delete mode 100644 tools/texture-decoder/src/main.rs delete mode 100644 tools/unpacker/Cargo.toml delete mode 100644 tools/unpacker/README.md delete mode 100644 tools/unpacker/src/main.rs diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 6cef205..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "image": "mcr.microsoft.com/devcontainers/rust:latest", - "customizations": { - "vscode": { - "extensions": [ - "rust-lang.rust-analyzer" - ] - } - }, - "runArgs": [ - "--cap-add=SYS_PTRACE", - "--security-opt", - "seccomp=unconfined" - ] -} \ No newline at end of file diff --git a/.gitignore b/.gitignore index ea8c4bf..e69de29 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +0,0 @@ -/target diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 31dd62f..0000000 --- a/Cargo.lock +++ /dev/null @@ -1,1710 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "addr2line" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - -[[package]] -name = "aligned" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee4508988c62edf04abd8d92897fca0c2995d907ce1dfeaf369dac3716a40685" -dependencies = [ - "as-slice", -] - -[[package]] -name = "aligned-vec" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc890384c8602f339876ded803c97ad529f3842aba97f6392b3dba0dd171769b" -dependencies = [ - "equator", -] - -[[package]] -name = "anstream" -version = "0.6.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" - -[[package]] -name = "anstyle-parse" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" -dependencies = [ - "anstyle", - "once_cell_polyfill", - "windows-sys 0.61.2", -] - -[[package]] -name = "anyhow" -version = "1.0.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" - -[[package]] -name = "arbitrary" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" - -[[package]] -name = "arg_enum_proc_macro" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "arrayvec" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - -[[package]] -name = "as-slice" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" -dependencies = [ - "stable_deref_trait", -] - -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - -[[package]] -name = "av-scenechange" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f321d77c20e19b92c39e7471cf986812cbb46659d2af674adc4331ef3f18394" -dependencies = [ - "aligned", - "anyhow", - "arg_enum_proc_macro", - "arrayvec", - "log", - "num-rational", - "num-traits", - "pastey", - "rayon", - "thiserror", - "v_frame", - "y4m", -] - -[[package]] -name = "av1-grain" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfddb07216410377231960af4fcab838eaa12e013417781b78bd95ee22077f8" -dependencies = [ - "anyhow", - "arrayvec", - "log", - "nom", - "num-rational", - "v_frame", -] - -[[package]] -name = "avif-serialize" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47c8fbc0f831f4519fe8b810b6a7a91410ec83031b8233f730a0480029f6a23f" -dependencies = [ - "arrayvec", -] - -[[package]] -name = "backtrace" -version = "0.3.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-link", -] - -[[package]] -name = "backtrace-ext" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537beee3be4a18fb023b570f80e3ae28003db9167a751266b259926e25539d50" -dependencies = [ - "backtrace", -] - -[[package]] -name = "bit_field" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6" - -[[package]] -name = "bitflags" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" - -[[package]] -name = "bitstream-io" -version = "4.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60d4bd9d1db2c6bdf285e223a7fa369d5ce98ec767dec949c6ca62863ce61757" -dependencies = [ - "core2", -] - -[[package]] -name = "built" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ad8f11f288f48ca24471bbd51ac257aaeaaa07adae295591266b792902ae64" - -[[package]] -name = "bumpalo" -version = "3.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" - -[[package]] -name = "bytemuck" -version = "1.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "byteorder-lite" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" - -[[package]] -name = "cc" -version = "1.2.54" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6354c81bbfd62d9cfa9cb3c773c2b7b2a3a482d569de977fd0e961f6e7c00583" -dependencies = [ - "find-msvc-tools", - "jobserver", - "libc", - "shlex", -] - -[[package]] -name = "cfg-if" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" - -[[package]] -name = "clap" -version = "4.5.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75ca66430e33a14957acc24c5077b503e7d374151b2b4b3a10c83b4ceb4be0e" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793207c7fa6300a0608d1080b858e5fdbe713cdc1c8db9fb17777d8a13e63df0" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.5.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" - -[[package]] -name = "color_quant" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" - -[[package]] -name = "colorchoice" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" - -[[package]] -name = "console" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e45a4a8926227e4197636ba97a9fc9b00477e9f4bd711395687c5f0734bec4" -dependencies = [ - "encode_unicode", - "libc", - "once_cell", - "unicode-width 0.2.2", - "windows-sys 0.61.2", -] - -[[package]] -name = "core2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" -dependencies = [ - "memchr", -] - -[[package]] -name = "crc32fast" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crunchy" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" - -[[package]] -name = "dialoguer" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25f104b501bf2364e78d0d3974cbc774f738f5865306ed128e1e0d7499c0ad96" -dependencies = [ - "console", - "shell-words", - "tempfile", - "zeroize", -] - -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" - -[[package]] -name = "encode_unicode" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" - -[[package]] -name = "equator" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc" -dependencies = [ - "equator-macro", -] - -[[package]] -name = "equator-macro" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "errno" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "exr" -version = "1.74.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4300e043a56aa2cb633c01af81ca8f699a321879a7854d3896a0ba89056363be" -dependencies = [ - "bit_field", - "half", - "lebe", - "miniz_oxide", - "rayon-core", - "smallvec", - "zune-inflate", -] - -[[package]] -name = "fastrand" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" - -[[package]] -name = "fax" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05de7d48f37cd6730705cbca900770cab77a89f413d23e100ad7fad7795a0ab" -dependencies = [ - "fax_derive", -] - -[[package]] -name = "fax_derive" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0aca10fb742cb43f9e7bb8467c91aa9bcb8e3ffbc6a6f7389bb93ffc920577d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "fdeflate" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" -dependencies = [ - "simd-adler32", -] - -[[package]] -name = "find-msvc-tools" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db" - -[[package]] -name = "flate2" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b375d6465b98090a5f25b1c7703f3859783755aa9a80433b36e0379a3ec2f369" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - -[[package]] -name = "getrandom" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" -dependencies = [ - "cfg-if", - "libc", - "r-efi", - "wasip2", -] - -[[package]] -name = "gif" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5df2ba84018d80c213569363bdcd0c64e6933c67fe4c1d60ecf822971a3c35e" -dependencies = [ - "color_quant", - "weezl", -] - -[[package]] -name = "gimli" -version = "0.32.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" - -[[package]] -name = "half" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" -dependencies = [ - "cfg-if", - "crunchy", - "zerocopy", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "image" -version = "0.25.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6506c6c10786659413faa717ceebcb8f70731c0a60cbae39795fdf114519c1a" -dependencies = [ - "bytemuck", - "byteorder-lite", - "color_quant", - "exr", - "gif", - "image-webp", - "moxcms", - "num-traits", - "png", - "qoi", - "ravif", - "rayon", - "rgb", - "tiff", - "zune-core 0.5.1", - "zune-jpeg 0.5.12", -] - -[[package]] -name = "image-webp" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3" -dependencies = [ - "byteorder-lite", - "quick-error", -] - -[[package]] -name = "imgref" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c5cedc30da3a610cac6b4ba17597bdf7152cf974e8aab3afb3d54455e371c8" - -[[package]] -name = "indicatif" -version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9375e112e4b463ec1b1c6c011953545c65a30164fbab5b581df32b3abf0dcb88" -dependencies = [ - "console", - "portable-atomic", - "unicode-width 0.2.2", - "unit-prefix", - "web-time", -] - -[[package]] -name = "interpolate_name" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "is_ci" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" - -[[package]] -name = "itertools" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" - -[[package]] -name = "jobserver" -version = "0.1.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" -dependencies = [ - "getrandom", - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "lebe" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8" - -[[package]] -name = "libc" -version = "0.2.180" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" - -[[package]] -name = "libfuzzer-sys" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5037190e1f70cbeef565bd267599242926f724d3b8a9f510fd7e0b540cfa4404" -dependencies = [ - "arbitrary", - "cc", -] - -[[package]] -name = "libnres" -version = "0.1.4" -dependencies = [ - "byteorder", - "log", - "miette", - "thiserror", -] - -[[package]] -name = "linux-raw-sys" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" - -[[package]] -name = "log" -version = "0.4.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" - -[[package]] -name = "loop9" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" -dependencies = [ - "imgref", -] - -[[package]] -name = "maybe-rayon" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" -dependencies = [ - "cfg-if", - "rayon", -] - -[[package]] -name = "memchr" -version = "2.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" - -[[package]] -name = "miette" -version = "7.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" -dependencies = [ - "backtrace", - "backtrace-ext", - "cfg-if", - "miette-derive", - "owo-colors", - "supports-color", - "supports-hyperlinks", - "supports-unicode", - "terminal_size", - "textwrap", - "unicode-width 0.1.14", -] - -[[package]] -name = "miette-derive" -version = "7.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", - "simd-adler32", -] - -[[package]] -name = "moxcms" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac9557c559cd6fc9867e122e20d2cbefc9ca29d80d027a8e39310920ed2f0a97" -dependencies = [ - "num-traits", - "pxfm", -] - -[[package]] -name = "new_debug_unreachable" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" - -[[package]] -name = "nom" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" -dependencies = [ - "memchr", -] - -[[package]] -name = "noop_proc_macro" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" - -[[package]] -name = "nres-cli" -version = "0.2.3" -dependencies = [ - "byteorder", - "clap", - "console", - "dialoguer", - "indicatif", - "libnres", - "miette", - "tempdir", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "object" -version = "0.37.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" - -[[package]] -name = "once_cell_polyfill" -version = "1.70.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" - -[[package]] -name = "owo-colors" -version = "4.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c6901729fa79e91a0913333229e9ca5dc725089d1c363b2f4b4760709dc4a52" - -[[package]] -name = "packer" -version = "0.1.0" -dependencies = [ - "byteorder", - "serde", - "serde_json", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pastey" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec" - -[[package]] -name = "png" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97baced388464909d42d89643fe4361939af9b7ce7a31ee32a168f832a70f2a0" -dependencies = [ - "bitflags", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide", -] - -[[package]] -name = "portable-atomic" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950" - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "proc-macro2" -version = "1.0.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "profiling" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773" -dependencies = [ - "profiling-procmacros", -] - -[[package]] -name = "profiling-procmacros" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52717f9a02b6965224f95ca2a81e2e0c5c43baacd28ca057577988930b6c3d5b" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "pxfm" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7186d3822593aa4393561d186d1393b3923e9d6163d3fbfd6e825e3e6cf3e6a8" -dependencies = [ - "num-traits", -] - -[[package]] -name = "qoi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" -dependencies = [ - "bytemuck", -] - -[[package]] -name = "quick-error" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" - -[[package]] -name = "quote" -version = "1.0.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r-efi" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" - -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi", -] - -[[package]] -name = "rand" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" -dependencies = [ - "rand_chacha", - "rand_core 0.9.5", -] - -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core 0.9.5", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rand_core" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rav1e" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b6dd56e85d9483277cde964fd1bdb0428de4fec5ebba7540995639a21cb32b" -dependencies = [ - "aligned-vec", - "arbitrary", - "arg_enum_proc_macro", - "arrayvec", - "av-scenechange", - "av1-grain", - "bitstream-io", - "built", - "cfg-if", - "interpolate_name", - "itertools", - "libc", - "libfuzzer-sys", - "log", - "maybe-rayon", - "new_debug_unreachable", - "noop_proc_macro", - "num-derive", - "num-traits", - "paste", - "profiling", - "rand 0.9.2", - "rand_chacha", - "simd_helpers", - "thiserror", - "v_frame", - "wasm-bindgen", -] - -[[package]] -name = "ravif" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef69c1990ceef18a116855938e74793a5f7496ee907562bd0857b6ac734ab285" -dependencies = [ - "avif-serialize", - "imgref", - "loop9", - "quick-error", - "rav1e", - "rayon", - "rgb", -] - -[[package]] -name = "rayon" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - -[[package]] -name = "rgb" -version = "0.8.52" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c6a884d2998352bb4daf0183589aec883f16a6da1f4dde84d8e2e9a5409a1ce" - -[[package]] -name = "rustc-demangle" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" - -[[package]] -name = "rustix" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.61.2", -] - -[[package]] -name = "rustversion" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" - -[[package]] -name = "serde" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" -dependencies = [ - "serde_core", - "serde_derive", -] - -[[package]] -name = "serde_core" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.149" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" -dependencies = [ - "itoa", - "memchr", - "serde", - "serde_core", - "zmij", -] - -[[package]] -name = "shell-words" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77" - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "simd-adler32" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" - -[[package]] -name = "simd_helpers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" -dependencies = [ - "quote", -] - -[[package]] -name = "smallvec" -version = "1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" - -[[package]] -name = "stable_deref_trait" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "supports-color" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" -dependencies = [ - "is_ci", -] - -[[package]] -name = "supports-hyperlinks" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e396b6523b11ccb83120b115a0b7366de372751aa6edf19844dfb13a6af97e91" - -[[package]] -name = "supports-unicode" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" - -[[package]] -name = "syn" -version = "2.0.114" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempdir" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -dependencies = [ - "rand 0.4.6", - "remove_dir_all", -] - -[[package]] -name = "tempfile" -version = "3.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" -dependencies = [ - "fastrand", - "getrandom", - "once_cell", - "rustix", - "windows-sys 0.61.2", -] - -[[package]] -name = "terminal_size" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" -dependencies = [ - "rustix", - "windows-sys 0.60.2", -] - -[[package]] -name = "texture-decoder" -version = "0.1.0" -dependencies = [ - "byteorder", - "image", -] - -[[package]] -name = "textwrap" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" -dependencies = [ - "unicode-linebreak", - "unicode-width 0.2.2", -] - -[[package]] -name = "thiserror" -version = "2.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tiff" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af9605de7fee8d9551863fd692cce7637f548dbd9db9180fcc07ccc6d26c336f" -dependencies = [ - "fax", - "flate2", - "half", - "quick-error", - "weezl", - "zune-jpeg 0.4.21", -] - -[[package]] -name = "unicode-ident" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" - -[[package]] -name = "unicode-linebreak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" - -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "unicode-width" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" - -[[package]] -name = "unit-prefix" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3" - -[[package]] -name = "unpacker" -version = "0.1.1" -dependencies = [ - "byteorder", - "serde", - "serde_json", -] - -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "v_frame" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666b7727c8875d6ab5db9533418d7c764233ac9c0cff1d469aec8fa127597be2" -dependencies = [ - "aligned-vec", - "num-traits", - "wasm-bindgen", -] - -[[package]] -name = "wasip2" -version = "1.0.2+wasi-0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" -dependencies = [ - "wit-bindgen", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.108" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.108" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.108" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" -dependencies = [ - "bumpalo", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.108" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "web-time" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "weezl" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-link" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" - -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" -dependencies = [ - "windows-link", -] - -[[package]] -name = "windows-targets" -version = "0.53.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" -dependencies = [ - "windows-link", - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" - -[[package]] -name = "windows_i686_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" - -[[package]] -name = "windows_i686_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" - -[[package]] -name = "wit-bindgen" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" - -[[package]] -name = "y4m" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5a4b21e1a62b67a2970e6831bc091d7b87e119e7f9791aef9702e3bef04448" - -[[package]] -name = "zerocopy" -version = "0.8.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dafd85c832c1b68bbb4ec0c72c7f6f4fc5179627d2bc7c26b30e4c0cc11e76cc" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cb7e4e8436d9db52fbd6625dbf2f45243ab84994a72882ec8227b99e72b439a" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "zeroize" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" - -[[package]] -name = "zmij" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02aae0f83f69aafc94776e879363e9771d7ecbffe2c7fbb6c14c5e00dfe88439" - -[[package]] -name = "zune-core" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" - -[[package]] -name = "zune-core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb8a0807f7c01457d0379ba880ba6322660448ddebc890ce29bb64da71fb40f9" - -[[package]] -name = "zune-inflate" -version = "0.2.54" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" -dependencies = [ - "simd-adler32", -] - -[[package]] -name = "zune-jpeg" -version = "0.4.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ce2c8a9384ad323cf564b67da86e21d3cfdff87908bc1223ed5c99bc792713" -dependencies = [ - "zune-core 0.4.12", -] - -[[package]] -name = "zune-jpeg" -version = "0.5.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "410e9ecef634c709e3831c2cfdb8d9c32164fae1c67496d5b68fff728eec37fe" -dependencies = [ - "zune-core 0.5.1", -] diff --git a/Cargo.toml b/Cargo.toml deleted file mode 100644 index 27d437b..0000000 --- a/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[workspace] -resolver = "2" -members = ["libs/*", "tools/*", "packer"] - -[profile.release] -codegen-units = 1 -lto = true -strip = true diff --git a/libs/nres/Cargo.toml b/libs/nres/Cargo.toml deleted file mode 100644 index 804f5c0..0000000 --- a/libs/nres/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "libnres" -version = "0.1.4" -edition = "2021" - -[dependencies] -byteorder = "1.4" -log = "0.4" -miette = "7.0" -thiserror = "2.0" diff --git a/libs/nres/src/converter.rs b/libs/nres/src/converter.rs deleted file mode 100644 index c059fae..0000000 --- a/libs/nres/src/converter.rs +++ /dev/null @@ -1,30 +0,0 @@ -use crate::error::ConverterError; - -/// Method for converting u32 to u64. -pub fn u32_to_u64(value: u32) -> Result { - Ok(u64::from(value)) -} - -/// Method for converting u32 to usize. -pub fn u32_to_usize(value: u32) -> Result { - match usize::try_from(value) { - Err(error) => Err(ConverterError::TryFromIntError(error)), - Ok(result) => Ok(result), - } -} - -/// Method for converting u64 to u32. -pub fn u64_to_u32(value: u64) -> Result { - match u32::try_from(value) { - Err(error) => Err(ConverterError::TryFromIntError(error)), - Ok(result) => Ok(result), - } -} - -/// Method for converting usize to u32. -pub fn usize_to_u32(value: usize) -> Result { - match u32::try_from(value) { - Err(error) => Err(ConverterError::TryFromIntError(error)), - Ok(result) => Ok(result), - } -} diff --git a/libs/nres/src/error.rs b/libs/nres/src/error.rs deleted file mode 100644 index 440ab06..0000000 --- a/libs/nres/src/error.rs +++ /dev/null @@ -1,45 +0,0 @@ -extern crate miette; -extern crate thiserror; - -use miette::Diagnostic; -use thiserror::Error; - -#[derive(Error, Diagnostic, Debug)] -pub enum ConverterError { - #[error("error converting an value")] - #[diagnostic(code(libnres::infallible))] - Infallible(#[from] std::convert::Infallible), - - #[error("error converting an value")] - #[diagnostic(code(libnres::try_from_int_error))] - TryFromIntError(#[from] std::num::TryFromIntError), -} - -#[derive(Error, Diagnostic, Debug)] -pub enum ReaderError { - #[error(transparent)] - #[diagnostic(code(libnres::convert_error))] - ConvertValue(#[from] ConverterError), - - #[error("incorrect header format")] - #[diagnostic(code(libnres::list_type_error))] - IncorrectHeader, - - #[error("incorrect file size (expected {expected:?} bytes, received {received:?} bytes)")] - #[diagnostic(code(libnres::file_size_error))] - IncorrectSizeFile { expected: u32, received: u32 }, - - #[error( - "incorrect size of the file list (not a multiple of {expected:?}, received {received:?})" - )] - #[diagnostic(code(libnres::list_size_error))] - IncorrectSizeList { expected: u32, received: u32 }, - - #[error("resource file reading error")] - #[diagnostic(code(libnres::io_error))] - ReadFile(#[from] std::io::Error), - - #[error("file is too small (must be at least {expected:?} bytes, received {received:?} byte)")] - #[diagnostic(code(libnres::file_size_error))] - SmallFile { expected: u32, received: u32 }, -} diff --git a/libs/nres/src/lib.rs b/libs/nres/src/lib.rs deleted file mode 100644 index 40c0b32..0000000 --- a/libs/nres/src/lib.rs +++ /dev/null @@ -1,24 +0,0 @@ -/// First constant value of the NRes file ("NRes" characters in numeric) -pub const FILE_TYPE_1: u32 = 1936020046; -/// Second constant value of the NRes file -pub const FILE_TYPE_2: u32 = 256; -/// Size of the element item (in bytes) -pub const LIST_ELEMENT_SIZE: u32 = 64; -/// Minimum allowed file size (in bytes) -pub const MINIMUM_FILE_SIZE: u32 = 16; - -static DEBUG: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false); - -mod converter; -mod error; -pub mod reader; - -/// Get debug status value -pub fn get_debug() -> bool { - DEBUG.load(std::sync::atomic::Ordering::Relaxed) -} - -/// Change debug status value -pub fn set_debug(value: bool) { - DEBUG.store(value, std::sync::atomic::Ordering::Relaxed) -} diff --git a/libs/nres/src/reader.rs b/libs/nres/src/reader.rs deleted file mode 100644 index 2a450ee..0000000 --- a/libs/nres/src/reader.rs +++ /dev/null @@ -1,227 +0,0 @@ -use std::io::{Read, Seek}; - -use byteorder::ByteOrder; - -use crate::error::ReaderError; -use crate::{converter, FILE_TYPE_1, FILE_TYPE_2, LIST_ELEMENT_SIZE, MINIMUM_FILE_SIZE}; - -#[derive(Debug)] -pub struct ListElement { - /// Unknown parameter - _unknown0: i32, - /// Unknown parameter - _unknown1: i32, - /// Unknown parameter - _unknown2: i32, - /// File extension - pub extension: String, - /// Identifier or sequence number - pub index: u32, - /// File name - pub name: String, - /// Position in the file - pub position: u32, - /// File size (in bytes) - pub size: u32, -} - -impl ListElement { - /// Get full name of the file - pub fn get_filename(&self) -> String { - format!("{}.{}", self.name, self.extension) - } -} - -#[derive(Debug)] -pub struct FileHeader { - /// File size - size: u32, - /// Number of files - total: u32, - /// First constant value - type1: u32, - /// Second constant value - type2: u32, -} - -/// Get a packed file data -pub fn get_file(file: &std::fs::File, element: &ListElement) -> Result, ReaderError> { - let size = get_file_size(file)?; - check_file_size(size)?; - - let header = get_file_header(file)?; - check_file_header(&header, size)?; - - let data = get_element_data(file, element)?; - Ok(data) -} - -/// Get a list of packed files -pub fn get_list(file: &std::fs::File) -> Result, ReaderError> { - let mut list: Vec = Vec::new(); - - let size = get_file_size(file)?; - check_file_size(size)?; - - let header = get_file_header(file)?; - check_file_header(&header, size)?; - - get_file_list(file, &header, &mut list)?; - - Ok(list) -} - -fn check_file_header(header: &FileHeader, size: u32) -> Result<(), ReaderError> { - if header.type1 != FILE_TYPE_1 || header.type2 != FILE_TYPE_2 { - return Err(ReaderError::IncorrectHeader); - } - - if header.size != size { - return Err(ReaderError::IncorrectSizeFile { - expected: size, - received: header.size, - }); - } - - Ok(()) -} - -fn check_file_size(size: u32) -> Result<(), ReaderError> { - if size < MINIMUM_FILE_SIZE { - return Err(ReaderError::SmallFile { - expected: MINIMUM_FILE_SIZE, - received: size, - }); - } - - Ok(()) -} - -fn get_element_data(file: &std::fs::File, element: &ListElement) -> Result, ReaderError> { - let position = converter::u32_to_u64(element.position)?; - let size = converter::u32_to_usize(element.size)?; - - let mut reader = std::io::BufReader::new(file); - let mut buffer = vec![0u8; size]; - - if let Err(error) = reader.seek(std::io::SeekFrom::Start(position)) { - return Err(ReaderError::ReadFile(error)); - }; - - if let Err(error) = reader.read_exact(&mut buffer) { - return Err(ReaderError::ReadFile(error)); - }; - - Ok(buffer) -} - -fn get_element_position(index: u32) -> Result<(usize, usize), ReaderError> { - let from = converter::u32_to_usize(index * LIST_ELEMENT_SIZE)?; - let to = converter::u32_to_usize((index * LIST_ELEMENT_SIZE) + LIST_ELEMENT_SIZE)?; - Ok((from, to)) -} - -fn get_file_header(file: &std::fs::File) -> Result { - let mut reader = std::io::BufReader::new(file); - let mut buffer = vec![0u8; MINIMUM_FILE_SIZE as usize]; - - if let Err(error) = reader.seek(std::io::SeekFrom::Start(0)) { - return Err(ReaderError::ReadFile(error)); - }; - - if let Err(error) = reader.read_exact(&mut buffer) { - return Err(ReaderError::ReadFile(error)); - }; - - let header = FileHeader { - size: byteorder::LittleEndian::read_u32(&buffer[12..16]), - total: byteorder::LittleEndian::read_u32(&buffer[8..12]), - type1: byteorder::LittleEndian::read_u32(&buffer[0..4]), - type2: byteorder::LittleEndian::read_u32(&buffer[4..8]), - }; - - buffer.clear(); - Ok(header) -} - -fn get_file_list( - file: &std::fs::File, - header: &FileHeader, - list: &mut Vec, -) -> Result<(), ReaderError> { - let (start_position, list_size) = get_list_position(header)?; - let mut reader = std::io::BufReader::new(file); - let mut buffer = vec![0u8; list_size]; - - if let Err(error) = reader.seek(std::io::SeekFrom::Start(start_position)) { - return Err(ReaderError::ReadFile(error)); - }; - - if let Err(error) = reader.read_exact(&mut buffer) { - return Err(ReaderError::ReadFile(error)); - } - - let buffer_size = converter::usize_to_u32(buffer.len())?; - - if buffer_size % LIST_ELEMENT_SIZE != 0 { - return Err(ReaderError::IncorrectSizeList { - expected: LIST_ELEMENT_SIZE, - received: buffer_size, - }); - } - - for i in 0..(buffer_size / LIST_ELEMENT_SIZE) { - let (from, to) = get_element_position(i)?; - let chunk: &[u8] = &buffer[from..to]; - - let element = get_list_element(chunk)?; - list.push(element); - } - - buffer.clear(); - Ok(()) -} - -fn get_file_size(file: &std::fs::File) -> Result { - let metadata = match file.metadata() { - Err(error) => return Err(ReaderError::ReadFile(error)), - Ok(value) => value, - }; - - let result = converter::u64_to_u32(metadata.len())?; - Ok(result) -} - -fn get_list_element(buffer: &[u8]) -> Result { - let index = byteorder::LittleEndian::read_u32(&buffer[60..64]); - let position = byteorder::LittleEndian::read_u32(&buffer[56..60]); - let size = byteorder::LittleEndian::read_u32(&buffer[12..16]); - let unknown0 = byteorder::LittleEndian::read_i32(&buffer[4..8]); - let unknown1 = byteorder::LittleEndian::read_i32(&buffer[8..12]); - let unknown2 = byteorder::LittleEndian::read_i32(&buffer[16..20]); - - let extension = String::from_utf8_lossy(&buffer[0..4]) - .trim_matches(char::from(0)) - .to_string(); - - let name = String::from_utf8_lossy(&buffer[20..56]) - .trim_matches(char::from(0)) - .to_string(); - - Ok(ListElement { - _unknown0: unknown0, - _unknown1: unknown1, - _unknown2: unknown2, - extension, - index, - name, - position, - size, - }) -} - -fn get_list_position(header: &FileHeader) -> Result<(u64, usize), ReaderError> { - let position = converter::u32_to_u64(header.size - (header.total * LIST_ELEMENT_SIZE))?; - let size = converter::u32_to_usize(header.total * LIST_ELEMENT_SIZE)?; - Ok((position, size)) -} diff --git a/packer/Cargo.toml b/packer/Cargo.toml deleted file mode 100644 index cbf418c..0000000 --- a/packer/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "packer" -version = "0.1.0" -edition = "2021" - -[dependencies] -byteorder = "1.4.3" -serde = { version = "1.0.160", features = ["derive"] } -serde_json = "1.0.96" diff --git a/packer/README.md b/packer/README.md deleted file mode 100644 index 9edb048..0000000 --- a/packer/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# NRes Game Resource Packer - -At the moment, this is a demonstration of the NRes game resource packing algorithm in action. -It packs 100% of the NRes game resources for the game "Parkan: Iron Strategy". -The hash sums of the resulting files match the original game files. - -__Attention!__ -This is a test version of the utility. It overwrites the specified final file without asking. - -## Building - -To build the tools, you need to run the following command in the root directory: - -```bash -cargo build --release -``` - -## Running - -You can run the utility with the following command: - -```bash -./target/release/packer /path/to/unpack /path/to/file.ex -``` - -- `/path/to/unpack`: This is the directory with the resources unpacked by the [unpacker](../unpacker) utility. -- `/path/to/file.ex`: This is the final file that will be created. diff --git a/packer/src/main.rs b/packer/src/main.rs deleted file mode 100644 index 2224969..0000000 --- a/packer/src/main.rs +++ /dev/null @@ -1,175 +0,0 @@ -use std::env; -use std::{ - fs::{self, File}, - io::{BufReader, Read}, -}; - -use byteorder::{ByteOrder, LittleEndian}; -use serde::{Deserialize, Serialize}; - -#[derive(Serialize, Deserialize, Debug)] -pub struct ImportListElement { - pub extension: String, - pub index: u32, - pub name: String, - pub unknown0: u32, - pub unknown1: u32, - pub unknown2: u32, -} - -#[derive(Debug)] -pub struct ListElement { - pub extension: String, - pub index: u32, - pub name: String, - pub position: u32, - pub size: u32, - pub unknown0: u32, - pub unknown1: u32, - pub unknown2: u32, -} - -fn main() { - let args: Vec = env::args().collect(); - - let input = &args[1]; - let output = &args[2]; - - pack(String::from(input), String::from(output)); -} - -fn pack(input: String, output: String) { - // Загружаем индекс-файл - let index_file = format!("{}/{}", input, "index.json"); - let data = fs::read_to_string(index_file).unwrap(); - let list: Vec = serde_json::from_str(&data).unwrap(); - - // Общий буфер хранения файлов - let mut content_buffer: Vec = Vec::new(); - let mut list_buffer: Vec = Vec::new(); - - // Общее количество файлов - let total_files: u32 = list.len() as u32; - - for (index, item) in list.iter().enumerate() { - // Открываем дескриптор файла - let path = format!("{}/{}.{}", input, item.name, item.index); - let file = File::open(path).unwrap(); - let metadata = file.metadata().unwrap(); - - // Считываем файл в буфер - let mut reader = BufReader::new(file); - let mut file_buffer: Vec = Vec::new(); - reader.read_to_end(&mut file_buffer).unwrap(); - - // Выравнивание буфера - if index != 0 { - while !content_buffer.len().is_multiple_of(8) { - content_buffer.push(0); - } - } - - // Получение позиции файла - let position = content_buffer.len() + 16; - - // Записываем файл в буфер - content_buffer.extend(file_buffer); - - // Формируем элемент - let element = ListElement { - extension: item.extension.to_string(), - index: item.index, - name: item.name.to_string(), - position: position as u32, - size: metadata.len() as u32, - unknown0: item.unknown0, - unknown1: item.unknown1, - unknown2: item.unknown2, - }; - - // Создаем буфер из элемента - let mut element_buffer: Vec = Vec::new(); - - // Пишем тип файла - let mut extension_buffer: [u8; 4] = [0; 4]; - let mut file_extension_buffer = element.extension.into_bytes(); - file_extension_buffer.resize(4, 0); - extension_buffer.copy_from_slice(&file_extension_buffer); - element_buffer.extend(extension_buffer); - - // Пишем неизвестное значение #1 - let mut unknown0_buffer: [u8; 4] = [0; 4]; - LittleEndian::write_u32(&mut unknown0_buffer, element.unknown0); - element_buffer.extend(unknown0_buffer); - - // Пишем неизвестное значение #2 - let mut unknown1_buffer: [u8; 4] = [0; 4]; - LittleEndian::write_u32(&mut unknown1_buffer, element.unknown1); - element_buffer.extend(unknown1_buffer); - - // Пишем размер файла - let mut file_size_buffer: [u8; 4] = [0; 4]; - LittleEndian::write_u32(&mut file_size_buffer, element.size); - element_buffer.extend(file_size_buffer); - - // Пишем неизвестное значение #3 - let mut unknown2_buffer: [u8; 4] = [0; 4]; - LittleEndian::write_u32(&mut unknown2_buffer, element.unknown2); - element_buffer.extend(unknown2_buffer); - - // Пишем название файла - let mut name_buffer: [u8; 36] = [0; 36]; - let mut file_name_buffer = element.name.into_bytes(); - file_name_buffer.resize(36, 0); - name_buffer.copy_from_slice(&file_name_buffer); - element_buffer.extend(name_buffer); - - // Пишем позицию файла - let mut position_buffer: [u8; 4] = [0; 4]; - LittleEndian::write_u32(&mut position_buffer, element.position); - element_buffer.extend(position_buffer); - - // Пишем индекс файла - let mut index_buffer: [u8; 4] = [0; 4]; - LittleEndian::write_u32(&mut index_buffer, element.index); - element_buffer.extend(index_buffer); - - // Добавляем итоговый буфер в буфер элементов списка - list_buffer.extend(element_buffer); - } - - // Выравнивание буфера - while !content_buffer.len().is_multiple_of(8) { - content_buffer.push(0); - } - - let mut header_buffer: Vec = Vec::new(); - - // Пишем первый тип файла - let mut header_type_1 = [0; 4]; - LittleEndian::write_u32(&mut header_type_1, 1936020046_u32); - header_buffer.extend(header_type_1); - - // Пишем второй тип файла - let mut header_type_2 = [0; 4]; - LittleEndian::write_u32(&mut header_type_2, 256_u32); - header_buffer.extend(header_type_2); - - // Пишем количество файлов - let mut header_total_files = [0; 4]; - LittleEndian::write_u32(&mut header_total_files, total_files); - header_buffer.extend(header_total_files); - - // Пишем общий размер файла - let mut header_total_size = [0; 4]; - let total_size: u32 = ((content_buffer.len() + 16) as u32) + (total_files * 64); - LittleEndian::write_u32(&mut header_total_size, total_size); - header_buffer.extend(header_total_size); - - let mut result_buffer: Vec = Vec::new(); - result_buffer.extend(header_buffer); - result_buffer.extend(content_buffer); - result_buffer.extend(list_buffer); - - fs::write(output, result_buffer).unwrap(); -} diff --git a/tools/nres-cli/Cargo.toml b/tools/nres-cli/Cargo.toml deleted file mode 100644 index f2eedd0..0000000 --- a/tools/nres-cli/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "nres-cli" -version = "0.2.3" -edition = "2021" - -[dependencies] -byteorder = "1.4" -clap = { version = "4.2", features = ["derive"] } -console = "0.16" -dialoguer = { version = "0.12", features = ["completion"] } -indicatif = "0.18" -libnres = { version = "0.1", path = "../../libs/nres" } -miette = { version = "7.0", features = ["fancy"] } -tempdir = "0.3" diff --git a/tools/nres-cli/README.md b/tools/nres-cli/README.md deleted file mode 100644 index fee1420..0000000 --- a/tools/nres-cli/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Console tool for NRes files (Deprecated) - -## Commands - -- `extract` - Extract game resources from a "NRes" file. -- `ls` - Get a list of files in a "NRes" file. \ No newline at end of file diff --git a/tools/nres-cli/src/main.rs b/tools/nres-cli/src/main.rs deleted file mode 100644 index 85086cb..0000000 --- a/tools/nres-cli/src/main.rs +++ /dev/null @@ -1,198 +0,0 @@ -extern crate core; -extern crate libnres; - -use std::io::Write; - -use clap::{Parser, Subcommand}; -use miette::{IntoDiagnostic, Result}; - -#[derive(Parser, Debug)] -#[command(name = "NRes CLI")] -#[command(about, author, version, long_about = None)] -struct Cli { - #[command(subcommand)] - command: Commands, -} - -#[derive(Subcommand, Debug)] -enum Commands { - /// Check if the "NRes" file can be extract - Check { - /// "NRes" file - file: String, - }, - /// Print debugging information on the "NRes" file - #[command(arg_required_else_help = true)] - Debug { - /// "NRes" file - file: String, - /// Filter results by file name - #[arg(long)] - name: Option, - }, - /// Extract files or a file from the "NRes" file - #[command(arg_required_else_help = true)] - Extract { - /// "NRes" file - file: String, - /// Overwrite files - #[arg(short, long, default_value_t = false, value_name = "TRUE|FALSE")] - force: bool, - /// Outbound directory - #[arg(short, long, value_name = "DIR")] - out: String, - }, - /// Print a list of files in the "NRes" file - #[command(arg_required_else_help = true)] - Ls { - /// "NRes" file - file: String, - }, -} - -pub fn main() -> Result<()> { - let stdout = console::Term::stdout(); - let cli = Cli::parse(); - - match cli.command { - Commands::Check { file } => command_check(stdout, file)?, - Commands::Debug { file, name } => command_debug(stdout, file, name)?, - Commands::Extract { file, force, out } => command_extract(stdout, file, out, force)?, - Commands::Ls { file } => command_ls(stdout, file)?, - } - - Ok(()) -} - -fn command_check(_stdout: console::Term, file: String) -> Result<()> { - let file = std::fs::File::open(file).into_diagnostic()?; - let list = libnres::reader::get_list(&file).into_diagnostic()?; - let tmp = tempdir::TempDir::new("nres").into_diagnostic()?; - let bar = indicatif::ProgressBar::new(list.len() as u64); - - bar.set_style(get_bar_style()?); - - for element in list { - bar.set_message(element.get_filename()); - - let path = tmp.path().join(element.get_filename()); - let mut output = std::fs::File::create(path).into_diagnostic()?; - let mut buffer = libnres::reader::get_file(&file, &element).into_diagnostic()?; - - output.write_all(&buffer).into_diagnostic()?; - buffer.clear(); - bar.inc(1); - } - - bar.finish(); - - Ok(()) -} - -fn command_debug(stdout: console::Term, file: String, name: Option) -> Result<()> { - let file = std::fs::File::open(file).into_diagnostic()?; - let mut list = libnres::reader::get_list(&file).into_diagnostic()?; - - let mut total_files_size: u32 = 0; - let mut total_files_gap: u32 = 0; - let mut total_files: u32 = 0; - - for (index, item) in list.iter().enumerate() { - total_files_size += item.size; - total_files += 1; - let mut gap = 0; - - if index > 1 { - let previous_item = &list[index - 1]; - gap = item.position - (previous_item.position + previous_item.size); - } - - total_files_gap += gap; - } - - if let Some(name) = name { - list.retain(|item| item.name.contains(&name)); - }; - - for (index, item) in list.iter().enumerate() { - let mut gap = 0; - - if index > 1 { - let previous_item = &list[index - 1]; - gap = item.position - (previous_item.position + previous_item.size); - } - - let text = format!("Index: {};\nGap: {};\nItem: {:#?};\n", index, gap, item); - stdout.write_line(&text).into_diagnostic()?; - } - - let text = format!( - "Total files: {};\nTotal files gap: {} (bytes);\nTotal files size: {} (bytes);", - total_files, total_files_gap, total_files_size - ); - - stdout.write_line(&text).into_diagnostic()?; - - Ok(()) -} - -fn command_extract(_stdout: console::Term, file: String, out: String, force: bool) -> Result<()> { - let file = std::fs::File::open(file).into_diagnostic()?; - let list = libnres::reader::get_list(&file).into_diagnostic()?; - let bar = indicatif::ProgressBar::new(list.len() as u64); - - bar.set_style(get_bar_style()?); - - for element in list { - bar.set_message(element.get_filename()); - - let path = format!("{}/{}", out, element.get_filename()); - - if !force && is_exist_file(&path) { - let message = format!("File \"{}\" exists. Overwrite it?", path); - - if !dialoguer::Confirm::new() - .with_prompt(message) - .interact() - .into_diagnostic()? - { - continue; - } - } - - let mut output = std::fs::File::create(path).into_diagnostic()?; - let mut buffer = libnres::reader::get_file(&file, &element).into_diagnostic()?; - - output.write_all(&buffer).into_diagnostic()?; - buffer.clear(); - bar.inc(1); - } - - bar.finish(); - - Ok(()) -} - -fn command_ls(stdout: console::Term, file: String) -> Result<()> { - let file = std::fs::File::open(file).into_diagnostic()?; - let list = libnres::reader::get_list(&file).into_diagnostic()?; - - for element in list { - stdout.write_line(&element.name).into_diagnostic()?; - } - - Ok(()) -} - -fn get_bar_style() -> Result { - Ok( - indicatif::ProgressStyle::with_template("[{bar:32}] {pos:>7}/{len:7} {msg}") - .into_diagnostic()? - .progress_chars("=>-"), - ) -} - -fn is_exist_file(path: &String) -> bool { - let metadata = std::path::Path::new(path); - metadata.exists() -} diff --git a/tools/texture-decoder/Cargo.toml b/tools/texture-decoder/Cargo.toml deleted file mode 100644 index 0d11da6..0000000 --- a/tools/texture-decoder/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "texture-decoder" -version = "0.1.0" -edition = "2021" - -[dependencies] -byteorder = "1.4.3" -image = "0.25.0" diff --git a/tools/texture-decoder/README.md b/tools/texture-decoder/README.md deleted file mode 100644 index 8fca059..0000000 --- a/tools/texture-decoder/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Декодировщик текстур - -Сборка: - -```bash -cargo build --release -``` - -Запуск: - -```bash -./target/release/texture-decoder ./out/AIM_02.0 ./out/AIM_02.0.png -``` \ No newline at end of file diff --git a/tools/texture-decoder/src/main.rs b/tools/texture-decoder/src/main.rs deleted file mode 100644 index 26c7edd..0000000 --- a/tools/texture-decoder/src/main.rs +++ /dev/null @@ -1,41 +0,0 @@ -use std::io::Read; - -use byteorder::ReadBytesExt; -use image::Rgba; - -fn decode_texture(file_path: &str, output_path: &str) -> Result<(), std::io::Error> { - // Читаем файл - let mut file = std::fs::File::open(file_path)?; - let mut buffer: Vec = Vec::new(); - file.read_to_end(&mut buffer)?; - - // Декодируем метаданные - let mut cursor = std::io::Cursor::new(&buffer[4..]); - let img_width = cursor.read_u32::()?; - let img_height = cursor.read_u32::()?; - - // Пропустить оставшиеся байты метаданных - cursor.set_position(20); - - // Извлекаем данные изображения - let image_data = buffer[cursor.position() as usize..].to_vec(); - let img = - image::ImageBuffer::, _>::from_raw(img_width, img_height, image_data.to_vec()) - .expect("Failed to decode image"); - - // Сохраняем изображение - img.save(output_path).unwrap(); - - Ok(()) -} - -fn main() { - let args: Vec = std::env::args().collect(); - - let input = &args[1]; - let output = &args[2]; - - if let Err(err) = decode_texture(input, output) { - eprintln!("Error: {}", err) - } -} diff --git a/tools/unpacker/Cargo.toml b/tools/unpacker/Cargo.toml deleted file mode 100644 index adb64ec..0000000 --- a/tools/unpacker/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "unpacker" -version = "0.1.1" -edition = "2021" - -[dependencies] -byteorder = "1.4.3" -serde = { version = "1.0.160", features = ["derive"] } -serde_json = "1.0.96" diff --git a/tools/unpacker/README.md b/tools/unpacker/README.md deleted file mode 100644 index 311e0eb..0000000 --- a/tools/unpacker/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# NRes Game Resource Unpacker - -At the moment, this is a demonstration of the NRes game resource unpacking algorithm in action. -It unpacks 100% of the NRes game resources for the game "Parkan: Iron Strategy". -The unpacked resources can be packed again using the [packer](../packer) utility and replace the original game files. - -__Attention!__ -This is a test version of the utility. -It overwrites existing files without asking. - -## Building - -To build the tools, you need to run the following command in the root directory: - -```bash -cargo build --release -``` - -## Running - -You can run the utility with the following command: - -```bash -./target/release/unpacker /path/to/file.ex /path/to/output -``` - -- `/path/to/file.ex`: This is the file containing the game resources that will be unpacked. -- `/path/to/output`: This is the directory where the unpacked files will be placed. - -## How it Works - -The structure describing the packed game resources is not fully understood yet. -Therefore, the utility saves unpacked files in the format `file_name.file_index` because some files have the same name. - -Additionally, an `index.json` file is created, which is important for re-packing the files. -This file lists all the fields that game resources have in their packed form. -It is essential to preserve the file index for the game to function correctly, as the game engine looks for the necessary files by index. - -Files can be replaced and packed back using the [packer](../packer). -The newly obtained game resource files are correctly processed by the game engine. -For example, sounds and 3D models of warbots' weapons were successfully replaced. \ No newline at end of file diff --git a/tools/unpacker/src/main.rs b/tools/unpacker/src/main.rs deleted file mode 100644 index 36a48c7..0000000 --- a/tools/unpacker/src/main.rs +++ /dev/null @@ -1,124 +0,0 @@ -use std::env; -use std::fs::File; -use std::io::{BufReader, BufWriter, Read, Seek, SeekFrom, Write}; - -use byteorder::{ByteOrder, LittleEndian}; -use serde::{Deserialize, Serialize}; - -#[derive(Serialize, Deserialize, Debug)] -pub struct FileHeader { - pub size: u32, - pub total: u32, - pub type1: u32, - pub type2: u32, -} - -#[derive(Serialize, Deserialize, Debug)] -pub struct ListElement { - pub extension: String, - pub index: u32, - pub name: String, - #[serde(skip_serializing)] - pub position: u32, - #[serde(skip_serializing)] - pub size: u32, - pub unknown0: u32, - pub unknown1: u32, - pub unknown2: u32, -} - -fn main() { - let args: Vec = env::args().collect(); - - let input = &args[1]; - let output = &args[2]; - - unpack(String::from(input), String::from(output)); -} - -fn unpack(input: String, output: String) { - let file = File::open(input).unwrap(); - let metadata = file.metadata().unwrap(); - - let mut reader = BufReader::new(file); - let mut list: Vec = Vec::new(); - - // Считываем заголовок файла - let mut header_buffer = [0u8; 16]; - reader.seek(SeekFrom::Start(0)).unwrap(); - reader.read_exact(&mut header_buffer).unwrap(); - - let file_header = FileHeader { - size: LittleEndian::read_u32(&header_buffer[12..16]), - total: LittleEndian::read_u32(&header_buffer[8..12]), - type1: LittleEndian::read_u32(&header_buffer[0..4]), - type2: LittleEndian::read_u32(&header_buffer[4..8]), - }; - - if file_header.type1 != 1936020046 || file_header.type2 != 256 { - panic!("this isn't NRes file"); - } - - if metadata.len() != file_header.size as u64 { - panic!("incorrect size") - } - - // Считываем список файлов - let list_files_start_position = file_header.size - (file_header.total * 64); - let list_files_size = file_header.total * 64; - - let mut list_buffer = vec![0u8; list_files_size as usize]; - reader - .seek(SeekFrom::Start(list_files_start_position as u64)) - .unwrap(); - reader.read_exact(&mut list_buffer).unwrap(); - - if !list_buffer.len().is_multiple_of(64) { - panic!("invalid files list") - } - - for i in 0..(list_buffer.len() / 64) { - let from = i * 64; - let to = (i * 64) + 64; - let chunk: &[u8] = &list_buffer[from..to]; - - let element_list = ListElement { - extension: String::from_utf8_lossy(&chunk[0..4]) - .trim_matches(char::from(0)) - .to_string(), - index: LittleEndian::read_u32(&chunk[60..64]), - name: String::from_utf8_lossy(&chunk[20..56]) - .trim_matches(char::from(0)) - .to_string(), - position: LittleEndian::read_u32(&chunk[56..60]), - size: LittleEndian::read_u32(&chunk[12..16]), - unknown0: LittleEndian::read_u32(&chunk[4..8]), - unknown1: LittleEndian::read_u32(&chunk[8..12]), - unknown2: LittleEndian::read_u32(&chunk[16..20]), - }; - - list.push(element_list) - } - - // Распаковываем файлы в директорию - for element in &list { - let path = format!("{}/{}.{}", output, element.name, element.index); - let mut file = File::create(path).unwrap(); - - let mut file_buffer = vec![0u8; element.size as usize]; - reader - .seek(SeekFrom::Start(element.position as u64)) - .unwrap(); - reader.read_exact(&mut file_buffer).unwrap(); - - file.write_all(&file_buffer).unwrap(); - file_buffer.clear(); - } - - // Выгрузка списка файлов в JSON - let path = format!("{}/{}", output, "index.json"); - let file = File::create(path).unwrap(); - let mut writer = BufWriter::new(file); - serde_json::to_writer_pretty(&mut writer, &list).unwrap(); - writer.flush().unwrap(); -} -- cgit v1.2.3