postrequest / link

link is a command and control framework written in rust
GNU Affero General Public License v3.0
559 stars 88 forks source link

Help me how to fix this error. Thx. #17

Open opensesamedoors opened 1 year ago

opensesamedoors commented 1 year ago

virtual-machine:~/link$ ./link

                                .-') _       .-. .-')   
                               ( OO ) )      \  ( OO )  

,--. ,-.-') ,--./ ,--,' ,--. ,--.
| |.-') | |OO) | \ | |\ | .' /
| | OO ) | | \ | | | ) | /,
| |-' | | |(_/ | . |/ | ' _) (| '---.' ,| |_.' | |\ | | . \ | | (_| | | | \ | | |\ \ ------' --'--' --'--' '--'
Start web server (Y/n)? Y starting server Please provide bind address (eg: 0.0.0.0:443): 0.0.0.0:8443 🔗 > generate 0.0.0.0:8443 please wait... link successfully built No such file or directory (os error 2) No such file or directory (os error 2) Could not find DLL

================================================================= virtual-machine:~/link$ cargo build --release --target x86_64-pc-windows-gnu Compiling openssl-sys v0.9.80 Compiling serde v1.0.154 error: failed to run custom build command for openssl-sys v0.9.80

Caused by: process didn't exit successfully: /link/target/release/build/openssl-sys-f925c2be46c076e2/build-script-main (exit status: 101) --- stdout cargo:rustc-cfg=const_fn cargo:rustc-cfg=openssl cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_GNU_OPENSSL_LIB_DIR X86_64_PC_WINDOWS_GNU_OPENSSL_LIB_DIR unset cargo:rerun-if-env-changed=OPENSSL_LIB_DIR OPENSSL_LIB_DIR unset cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_GNU_OPENSSL_INCLUDE_DIR X86_64_PC_WINDOWS_GNU_OPENSSL_INCLUDE_DIR unset cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR OPENSSL_INCLUDE_DIR unset cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_GNU_OPENSSL_DIR X86_64_PC_WINDOWS_GNU_OPENSSL_DIR unset cargo:rerun-if-env-changed=OPENSSL_DIR OPENSSL_DIR unset

--- stderr thread 'main' panicked at '

Could not find directory of OpenSSL installation, and this -sys crate cannot proceed without this knowledge. If OpenSSL is installed and this crate had trouble finding it, you can set the OPENSSL_DIR environment variable for the compilation process.

Make sure you also have the development packages of openssl installed. For example, libssl-dev on Ubuntu or openssl-devel on Fedora.

If you're in a situation where you think the directory should be found automatically, please open a bug at https://github.com/sfackler/rust-openssl and include information about your system as well as this message.

$HOST = x86_64-unknown-linux-gnu $TARGET = x86_64-pc-windows-gnu openssl-sys = 0.9.80

', /.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.80/build/find_normal.rs:191:5 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace warning: build failed, waiting for other jobs to finish...

studyNowHa commented 1 year ago

I fix this problem to add.

Cargo.toml

[dependencies] openssl = { version = "0.10", features = ["vendored"] }

studyNowHa commented 1 year ago
RUSTFLAGS='-C link-arg=-s' cargo build --release --target x86_64-pc-windows-gnu warning: unused manifest key: package.doc Compiling tokio-util v0.3.1 Compiling tokio-tls v0.3.1 Compiling ifcfg v0.1.1 (https://github.com/postrequest/ifcfg-rs?branch=cross-compilation-windows-dynamic#b68bafb4) Compiling ntapi v0.3.7 Compiling safetydump v0.1.0 (https://github.com/postrequest/safetydump?branch=main#109e041e) Compiling h2 v0.2.7 error[E0793]: reference to packed field is unaligned --> /home/kali/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ntapi-0.3.7/src/ntexapi.rs:2783:52 2783 tick_count.QuadPart_mut() = read_volatile(&(USER_SHARED_DATA).u.TickCountQuad); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
 = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
error[E0793]: reference to packed field is unaligned --> /home/kali/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ntapi-0.3.7/src/ntexapi.rs:2807:25 2807 ((read_volatile(&(*USER_SHARED_DATA).u.TickCountQuad) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
 = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)

For more information about this error, try rustc --explain E0793. error: could not compile ntapi (lib) due to 2 previous errors warning: build failed, waiting for other jobs to finish...

studyNowHa commented 1 year ago

fix: src/links/windows/Cargo.toml sysinfo = "0.17"==>sysinfo = "0.29"