Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
submodules: true

- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.0
with:
Expand All @@ -61,6 +62,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
submodules: true

- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.0
with:
Expand Down Expand Up @@ -89,6 +91,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
submodules: true

- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.0
with:
Expand Down Expand Up @@ -126,6 +129,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
submodules: true

- run: |
brew install rustup
Expand Down Expand Up @@ -161,6 +165,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
submodules: true

- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.0
with:
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/deny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ on:
pull_request:
types: [opened, synchronize]
paths:
- "Cargo.lock"
- "deny.toml"
- ".github/workflows/deny.yml"
- 'Cargo.lock'
- 'deny.toml'
- '.github/workflows/deny.yml'
push:
branches:
- main
paths:
- "Cargo.lock"
- "deny.toml"
- ".github/workflows/deny.yml"
- 'Cargo.lock'
- 'deny.toml'
- '.github/workflows/deny.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
Expand All @@ -30,6 +30,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
submodules: true

- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.0
with:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
submodules: true

- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.2
with:
Expand Down Expand Up @@ -93,6 +94,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
submodules: true

- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4

Expand Down Expand Up @@ -120,8 +122,8 @@ jobs:
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version-file: .node-version
registry-url: "https://npm.pkg.github.com"
scope: "@voidzero-dev"
registry-url: 'https://npm.pkg.github.com'
scope: '@voidzero-dev'
package-manager-cache: false

- run: npm install -g npm@latest # For trusted publishing support
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ on:
pull_request:
types: [opened, synchronize]
paths:
- ".github/workflows/**"
- '.github/workflows/**'
push:
branches:
- main
- "renovate/**"
- 'renovate/**'
paths:
- ".github/workflows/**"
- '.github/workflows/**'

jobs:
zizmor:
Expand All @@ -26,6 +26,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
submodules: true

- uses: taiki-e/install-action@ae97ff9daf1cd2e216671a047d80ff48461e30bb # v2.49.1
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "crates/fspy_detours_sys/detours"]
path = crates/fspy_detours_sys/detours
url = https://github.com/microsoft/Detours
2 changes: 2 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ PUNICODE = "PUNICODE"
[files]
extend-exclude = [
"**/snap-tests/**/snap.txt",
"crates/fspy_detours_sys/detours",
"crates/fspy_detours_sys/src/generated_bindings.rs",
]
37 changes: 17 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ backon = "1.3.0"
bincode = "2.0.1"
brush-parser = "0.2.18"
bstr = "1.12.0"
cc = "1.2.39"
clap = "4.5.40"
color-eyre = "0.6.5"
compact_str = "0.9.0"
Expand All @@ -48,6 +49,7 @@ directories = "6.0.0"
edit = "0.1.5"
flate2 = "1.0.35"
fspy = { path = "crates/fspy" }
fspy_detours_sys = { path = "crates/fspy_detours_sys" }
fspy_preload_unix = { path = "crates/fspy_preload_unix", artifact = "cdylib" }
fspy_preload_windows = { path = "crates/fspy_preload_windows", artifact = "cdylib" }
fspy_seccomp_unotify = { path = "crates/fspy_seccomp_unotify" }
Expand Down Expand Up @@ -102,6 +104,7 @@ vite_path = { path = "crates/vite_path" }
vite_str = { path = "crates/vite_str" }
vite_task = { path = "crates/vite_task" }
wax = "0.6.0"
winapi = "0.3.9"

napi = { version = "3.0.0", default-features = false, features = ["async", "error_anyhow"] }
napi-build = "2"
Expand Down
14 changes: 6 additions & 8 deletions crates/fspy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,17 @@ allocator-api2 = { version = "0.2.21", default-features = false, features = [
tokio-seqpacket = "0.8.0"
arrayvec = "0.7.6"
nix = { version = "0.30.1", features = ["uio"] }
fspy_seccomp_unotify = { workspace = true, features = ["supervisor"]}
blink-alloc = { version = "0.3.1", features = ["sync"]}
fspy_seccomp_unotify = { workspace = true, features = ["supervisor"] }
blink-alloc = { version = "0.3.1", features = ["sync"] }
thread_local = "1.1.9"
tokio = { version = "1.44.2", features = ["bytes"] }
syscalls = { version = "0.6.18", default-features = false, features = ["std"]}
syscalls = { version = "0.6.18", default-features = false, features = ["std"] }

[target.'cfg(unix)'.dependencies]
fspy_shared_unix = { workspace = true }
fspy_preload_unix = { workspace = true }
nix = { version = "0.30.1", features = ["fs", "process", "socket", "feature"] }
passfd = { git = "https://github.com/polachok/passfd", features = [
"async",
] }
passfd = { git = "https://github.com/polachok/passfd", features = ["async"] }
memmap2 = "0.9.7"
# asyncfd = "0.1.2"

Expand All @@ -53,14 +51,14 @@ const_format = { version = "0.2.34", features = ["fmt"] }


[target.'cfg(target_os = "windows")'.dependencies]
ms-detours = "4.0.5"
winsafe = { version = "0.0.24", features = ["kernel"] }
winapi = { version = "0.3.9", features = [
winapi = { workspace = true, features = [
"winbase",
"securitybaseapi",
"handleapi",
] }
fspy_preload_windows = { workspace = true }
fspy_detours_sys = { workspace = true }

[target.'cfg(target_os = "macos")'.dev-dependencies]
tempfile = "3.19.1"
Expand Down
2 changes: 1 addition & 1 deletion crates/fspy/src/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ use std::{

use bincode::borrow_decode_from_slice;
use const_format::formatcp;
use fspy_detours_sys::{DetourCopyPayloadToProcess, DetourUpdateProcessWithDll};
use fspy_shared::{
ipc::{BINCODE_CONFIG, PathAccess},
windows::{PAYLOAD_ID, Payload},
};
use futures_util::FutureExt;
use ms_detours::{DetourCopyPayloadToProcess, DetourUpdateProcessWithDll};
use tokio::{
io::AsyncReadExt,
net::windows::named_pipe::{PipeMode, ServerOptions},
Expand Down
19 changes: 19 additions & 0 deletions crates/fspy_detours_sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "fspy_detours_sys"
version = "0.0.0"
authors.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true

[build-dependencies]
cc = { workspace = true }

[dependencies]
winapi = { workspace = true, features = ["minwindef", "libloaderapi", "processthreadsapi", "windef"] }

[lints]
workspace = true

[dev-dependencies]
bindgen = "0.72.1"
3 changes: 3 additions & 0 deletions crates/fspy_detours_sys/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# fspy_detours_sys

Raw FFI bindings to [Detours](https://github.com/Microsoft/Detours)
18 changes: 18 additions & 0 deletions crates/fspy_detours_sys/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
fn main() {
if std::env::var_os("CARGO_CFG_TARGET_OS").unwrap() != "windows" {
return;
}
println!("cargo:rerun-if-changed=detours/src");
// https://github.com/Berrysoft/detours/blob/c9bc2ad6e9cd8f5f7b74cfa65365d61ecc45203f/detours-sys/build.rs
cc::Build::new()
.include("detours/src")
.define("WIN32_LEAN_AND_MEAN", "1")
.define("_WIN32_WINNT", "0x501")
.file("detours/src/detours.cpp")
.file("detours/src/modules.cpp")
.file("detours/src/disasm.cpp")
.file("detours/src/image.cpp")
.file("detours/src/creatwth.cpp")
.cpp(true)
.compile("detours");
}
1 change: 1 addition & 0 deletions crates/fspy_detours_sys/detours
Submodule detours added at 9764ce
Loading
Loading