summaryrefslogtreecommitdiff
path: root/extract_decoded_executable/build.sh
diff options
context:
space:
mode:
authorstderr64 <stderr64@null.net>2026-08-02 23:25:46 +0300
committerstderr64 <stderr64@null.net>2026-08-02 23:25:46 +0300
commit93bf2805ba66b628d0187637c85f86f2ae7eb4a1 (patch)
treed33b2879182966a22f694532cf306ce7e3145b5e /extract_decoded_executable/build.sh
parent2e2d8c94e2355e6beae219cb3b7a0684ef1f1aa1 (diff)
downloadexperiments-93bf2805ba66b628d0187637c85f86f2ae7eb4a1.tar.gz
experiments-93bf2805ba66b628d0187637c85f86f2ae7eb4a1.tar.zst
Added RNG based encryption to the code to extract binary from define value
Diffstat (limited to 'extract_decoded_executable/build.sh')
-rwxr-xr-xextract_decoded_executable/build.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/extract_decoded_executable/build.sh b/extract_decoded_executable/build.sh
index 6af8971..7d0bc0d 100755
--- a/extract_decoded_executable/build.sh
+++ b/extract_decoded_executable/build.sh
@@ -1,7 +1,14 @@
#!/usr/bin/env bash
+SEED=$(seq 1 10 | shuf --random-source=/dev/urandom | sed -z 's/\n//g')
+
+echo "Encryption seed: ${SEED}"
+
gcc -Wall -Werror -pedantic -O2 -mavx2 -march=x86-64-v3 -std=gnu23 ./test_binary.c -o ./test_binary
+gcc -Wall -Werror -pedantic -O2 -mavx2 -march=x86-64-v3 -std=gnu23 -DSEED_VAL=${SEED} ./encrypter.c -o ./encrypter
+./encrypter
+rm ./encrypter
xxd -g1 -p ./test_binary | sed -z 's/\n$/\"/;s/^/\"/;s/\n//g' > ./test_binary_hex.dat
rm ./test_binary
-gcc -O2 -mavx2 -march=x86-64-v3 -std=gnu23 -DBIN_HEX=$(cat ./test_binary_hex.dat) ./extractor.c -o ./extractor
+gcc -O2 -mavx2 -march=x86-64-v3 -std=gnu23 -DSEED_VAL=${SEED} -DBIN_HEX=$(cat ./test_binary_hex.dat) ./extractor.c -o ./extractor
rm ./test_binary_hex.dat