#!/bin/sh

echo "Bastard disassembler test script #1"
echo "       Disassemble Full"
echo "Enter name of target:"
read name
echo "Assuming ELF i386. Disassembling..."
./bastard -q >/dev/null<<-EOF 
LoadTarget( "$name" );
SetFileFormat( "ELF" );
SetFileArch( "i386" );
DisassembleFull( );
SaveAsASM( "./.tmp.asm" );
q
EOF
if [ -f ./.tmp.asm ]
then
	cat ./.tmp.asm
	rm ./.tmp.asm
else
   echo "Something went wrong! Run the bastard manually..."
fi
