mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-08 22:38:01 -06:00
Work on custom binaries
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
# # -Cpanic=immediate-abort
|
||||
# RUSTFLAGS="-Zunstable-options -Zlocation-detail=none -Zfmt-debug=none" \
|
||||
# cargo +nightly build \
|
||||
# -Z build-std=std,panic_abort \
|
||||
# -Z build-std-features= \
|
||||
# --profile minimize -p unshell-payload -- $@
|
||||
|
||||
cargo build --profile minimize -p unshell-payload
|
||||
|
||||
export BINARY=./target/minimize/unshell-payload
|
||||
|
||||
declare -a headers=(
|
||||
".gnu_debuglink" # - Debug information link
|
||||
".comment" #- Compiler version info
|
||||
".shstrtab" #- Section header string table (only needed by tools like readelf)
|
||||
".note.gnu.bu" ".note.gnu.build-id" # - Build ID note
|
||||
".eh_frame" ".eh_frame_hdr" # Exception handling info (can break C++ exceptions if removed)
|
||||
#".gnu.version" ".gnu.version_r" # Symbol versioning (may be needed for some shared libraries)
|
||||
".gnu.hash" # Hash table for symbol lookup optimization
|
||||
|
||||
|
||||
|
||||
# .shstrtab
|
||||
# .interp
|
||||
# .note.ABI-tag
|
||||
# .dynsym
|
||||
# .dynstr
|
||||
# .rela.dyn
|
||||
# .rodata
|
||||
# .text
|
||||
# .init
|
||||
# .fini
|
||||
# .tbss
|
||||
# .fini_array
|
||||
# .init_array
|
||||
# .data.rel.ro
|
||||
# .dynamic
|
||||
# .got
|
||||
# .got.plt
|
||||
# .relro_padding
|
||||
# .tm_clone_table
|
||||
# .data
|
||||
# .bss
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
# TODO: Implement FAKE section header comments and information
|
||||
# Shuffle order of headers??
|
||||
|
||||
for section in "${headers[@]}"
|
||||
do
|
||||
strip --remove-section="$section" $BINARY
|
||||
echo "Removed section header $section"
|
||||
done
|
||||
Reference in New Issue
Block a user