mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-09 06:47:59 -06:00
Add back minimize profile
This commit is contained in:
+12
@@ -1,3 +1,5 @@
|
|||||||
|
cargo-features = ["trim-paths", "panic-immediate-abort"]
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
"ush-obfuscate",
|
"ush-obfuscate",
|
||||||
@@ -45,6 +47,16 @@ chrono = { workspace = true, optional = true }
|
|||||||
# ush-obfuscate = { workspace = true }
|
# ush-obfuscate = { workspace = true }
|
||||||
static_init = { workspace = true }
|
static_init = { workspace = true }
|
||||||
|
|
||||||
|
[profile.minimize]
|
||||||
|
inherits = "release"
|
||||||
|
strip = true # Strip symbols from the binary
|
||||||
|
opt-level = "z" # Optimize for size
|
||||||
|
lto = true # Link tree optimization
|
||||||
|
codegen-units = 1
|
||||||
|
panic = "immediate-abort"
|
||||||
|
debug = false # Remove debug
|
||||||
|
trim-paths="all"
|
||||||
|
|
||||||
[lints.rust]
|
[lints.rust]
|
||||||
elided_lifetimes_in_paths = "warn"
|
elided_lifetimes_in_paths = "warn"
|
||||||
future_incompatible = { level = "warn", priority = -1 }
|
future_incompatible = { level = "warn", priority = -1 }
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
OBFUSCATION_KEY=kjwerkwerkjbwejehrwhje \
|
OBFUSCATION_KEY=kjwerkwerkjbwejehrwhje \
|
||||||
cargo build --profile minimize -p ush-payload $@
|
cargo build --profile minimize -p treetest $@
|
||||||
|
|
||||||
export BINARY=./target/minimize/ush-payload
|
export BINARY=./target/minimize/treetest
|
||||||
|
|
||||||
declare -a headers=(
|
declare -a headers=(
|
||||||
".gnu_debuglink" # - Debug information link
|
".gnu_debuglink" # - Debug information link
|
||||||
@@ -28,9 +28,9 @@ declare -a headers=(
|
|||||||
for section in "${headers[@]}"
|
for section in "${headers[@]}"
|
||||||
do
|
do
|
||||||
strip --remove-section="$section" $BINARY
|
strip --remove-section="$section" $BINARY
|
||||||
echo "Removed section header $section"
|
# echo "Removed section header $section"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "## STARTING "
|
echo "Binary size: $(wc -c $BINARY)"
|
||||||
|
|
||||||
$BINARY
|
# $BINARY
|
||||||
|
|||||||
Reference in New Issue
Block a user