#!/bin/sh

echo "Bastard disassembler test script #1"
echo "   LibOpcodes Disassemble Text"
echo "Enter name of target:"
read name
echo "Assuming ELF i386..."
./bastard -lq >/dev/null<<-EOF 
LoadTarget( "$name" );
SetFileFormat( "ELF" );
DisassembleSection( ".text" );
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
