#!/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" );
SetTargetFormat( "ELF" );
SetTargetArch( "i386" );
SetTargetAsm( "intel" );
SetTargetLang( "C" );
DisassembleTarget( "full", NULL );
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
