diff --git a/Cargo.lock b/Cargo.lock
index 4329777..136976b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -187,11 +187,11 @@ dependencies = [
"indexmap",
"log",
"mlua",
+ "ntapi",
"retour",
"semver",
"serde",
"serde_plain",
- "tempfile",
"thiserror",
"toml",
"winapi",
@@ -407,15 +407,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "fastrand"
-version = "1.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be"
-dependencies = [
- "instant",
-]
-
[[package]]
name = "flate2"
version = "1.0.25"
@@ -499,15 +490,6 @@ dependencies = [
"hashbrown",
]
-[[package]]
-name = "instant"
-version = "0.1.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
-dependencies = [
- "cfg-if",
-]
-
[[package]]
name = "io-lifetimes"
version = "1.0.10"
@@ -656,6 +638,15 @@ version = "1.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5b8c256fd9471521bcb84c3cdba98921497f1a331cbc15b8030fc63b82050ce"
+[[package]]
+name = "ntapi"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4"
+dependencies = [
+ "winapi",
+]
+
[[package]]
name = "num-traits"
version = "0.2.15"
@@ -789,15 +780,6 @@ dependencies = [
"bitflags",
]
-[[package]]
-name = "redox_syscall"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
-dependencies = [
- "bitflags",
-]
-
[[package]]
name = "redox_users"
version = "0.4.3"
@@ -805,7 +787,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b"
dependencies = [
"getrandom",
- "redox_syscall 0.2.16",
+ "redox_syscall",
"thiserror",
]
@@ -986,19 +968,6 @@ dependencies = [
"unicode-ident",
]
-[[package]]
-name = "tempfile"
-version = "3.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998"
-dependencies = [
- "cfg-if",
- "fastrand",
- "redox_syscall 0.3.5",
- "rustix",
- "windows-sys 0.45.0",
-]
-
[[package]]
name = "termcolor"
version = "1.2.0"
diff --git a/chaudloader/Cargo.toml b/chaudloader/Cargo.toml
index 96930bd..db374f5 100644
--- a/chaudloader/Cargo.toml
+++ b/chaudloader/Cargo.toml
@@ -9,12 +9,11 @@ crate-type = ["cdylib"]
[dependencies]
retour = "0.1"
anyhow = "1"
-winapi = { version = "0.3.9", features = ["dxgi"] }
+winapi = "0.3.9"
log = "0.4"
env_logger = "0.9.0"
thiserror = "1"
zip = "0.6"
-tempfile = "3"
clean-path = "0.2"
windows-libloader = { path = "../windows-libloader" }
const_format = "0.2"
@@ -26,3 +25,4 @@ indexmap = "1"
semver = { version = "1", features = ["serde"] }
serde_plain = "1"
crc32fast = "1"
+ntapi = "0.4"
diff --git a/chaudloader/src/assets.rs b/chaudloader/src/assets.rs
index 5321ae6..c764cda 100644
--- a/chaudloader/src/assets.rs
+++ b/chaudloader/src/assets.rs
@@ -1,5 +1,3 @@
-use crate::hooks;
-
pub mod exedat;
pub mod mpak;
pub mod msg;
@@ -55,42 +53,52 @@ impl Replacer {
self.replacers.insert(path.to_path_buf(), Box::new(pack_cb));
}
+ pub fn purge(
+ &mut self,
+ path: &std::path::Path,
+ ) -> Result