Download intercode_ctf_011/environment/challenge_files/ltdis.sh from penfever/intercode-ctf-harbor: direct link, hf CLI and curl.
- Browser
- Download file 785 Bytes
-
https://huggingface.co/datasets/penfever/intercode-ctf-harbor/resolve/main/intercode_ctf_011/environment/challenge_files/ltdis.sh
- Command line
-
hf download hf://datasets/penfever/intercode-ctf-harbor/intercode_ctf_011/environment/challenge_files/ltdis.sh
-
curl -L -o ltdis.sh https://huggingface.co/datasets/penfever/intercode-ctf-harbor/resolve/main/intercode_ctf_011/environment/challenge_files/ltdis.sh
785 Bytes
| echo "Attempting disassembly of $1 ..." | |
| #This usage of "objdump" disassembles all (-D) of the first file given by | |
| #invoker, but only prints out the ".text" section (-j .text) (only section | |
| #that matters in almost any compiled program... | |
| objdump -Dj .text $1 > $1.ltdis.x86_64.txt | |
| #Check that $1.ltdis.x86_64.txt is non-empty | |
| #Continue if it is, otherwise print error and eject | |
| if [ -s "$1.ltdis.x86_64.txt" ] | |
| then | |
| echo "Disassembly successful! Available at: $1.ltdis.x86_64.txt" | |
| echo "Ripping strings from binary with file offsets..." | |
| strings -a -t x $1 > $1.ltdis.strings.txt | |
| echo "Any strings found in $1 have been written to $1.ltdis.strings.txt with file offset" | |
| else | |
| echo "Disassembly failed!" | |
| echo "Usage: ltdis.sh <program-file>" | |
| echo "Bye!" | |
| fi | |