Added Windows support for the bind shell

Brings in support from winpcap as npcap has a restrictive license
This commit is contained in:
Andrew Rioux
2024-01-24 19:12:45 -05:00
parent 862dc3e743
commit af5ceb66ab
10 changed files with 97 additions and 26 deletions

View File

@@ -15,7 +15,7 @@ serde = { version = "1.0.188", features = ["derive"] }
sparse-05-common = { version = "0.1.0", path = "../sparse-05-common" }
structopt = { version = "0.3.26", features = ["paw"] }
tempfile = "3.8.0"
tokio = { version = "1.32.0", features = ["io-std", "net", "fs", "macros", "rt"] }
tokio = { version = "1.32.0", features = ["full"] }
[target.'cfg(unix)'.dependencies]
raw_tty = "0.1.0"

View File

@@ -11,13 +11,13 @@ pub const SPARSE_LINUX_SERVER_BINARY: &'static [u8] =
include_bytes!("../../../../target/debug/sparse-05-server");
#[cfg(not(debug_assertions))]
pub const SPARSE_LINUX_SERVER_BINARY: &'static [u8] =
include_bytes!("../../../../target/release/sparse-05-server");
include_bytes!(std::env!("SPARSE_LINUX_SERVER"));
#[cfg(debug_assertions)]
pub const SPARSE_WINDOWS_SERVER_BINARY: &'static [u8] =
include_bytes!("../../../../target/x86_64-pc-windows-gnu/debug/sparse-05-server.exe");
#[cfg(not(debug_assertions))]
pub const SPARSE_WINDOWS_SERVER_BINARY: &'static [u8] =
include_bytes!("../../../../target/x86_64-pc-windows-gnu/release/sparse-05-server.exe");
include_bytes!(std::env!("SPARSE_WINDOWS_SERVER"));
pub async fn generate(mut name: PathBuf, port: u16, target: TargetOs) -> anyhow::Result<()> {
let mut csprng = rand::thread_rng();