Added challenge 163

This commit is contained in:
Michael Chen 2022-05-17 13:38:46 +02:00
parent 69ef593349
commit e3a1e9f757
No known key found for this signature in database
GPG Key ID: FD1BAF55F0CBDCF9
2 changed files with 32 additions and 0 deletions

32
163/ltdis.sh Normal file
View File

@ -0,0 +1,32 @@
#!/bin/bash
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

BIN
163/static Normal file

Binary file not shown.