Open Archieeeeee opened 2 years ago
Hi @Archieeeeee - this library will likely not work on Windows as the underlying library (pnet) doesn't either last I knew.
Hey, just a heads up, you can (now) run this on Windows. All you have to do is:
Packet.lib
to the root of your project (next to your Cargo.toml
file)build.rs
where you set manifest for your app, to always require admin privileges on startup, like this:Cargo.toml
[target.'cfg(windows)'.build-dependencies]
winres = "0.1.12" # or whatever is the latest version
build.rs
fn main() {
// Tell windows that executable requires admin privileges.
#[cfg(target_os = "windows")]
{
let mut res = winres::WindowsResource::new();
res.set_manifest(
r#"
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
"#,
);
if let Err(error) = res.compile() {
eprint!("{}", error);
std::process::exit(1);
}
}
}
PS: Make sure that you're running cargo run
from terminal with escalated (admin) privileges
sorry , I find this by searching maybe that is the cause, so I have to provide pcap library?