================================================================================
B A S T A R D                                            disassembly environment

 
               Bastard   Front - end   Programming   Guide



================================================================================
 Contents

 Introduction
 Shell Here Docs
 Scripting Languages
 C, Popen, and Pipes
 The Bastard Shared Library
 Designing a Disassembler
 The CPU Modules as Independent Libraries
 Replacing EiC or Typhoon


 
================================================================================
 Introduction


The reference implementation for front-ends is the bastard program itself:
a command line interace to the bastard shared library

================================================================================
 Shell Here Docs


   ...non-interactive shell script front-ends
   #!/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


================================================================================
 Scripting Languages

   ...tcl, expect; perl...


================================================================================
 C, Popen, and Pipes



================================================================================
 The Bastard Shared Library


   #include <bastard.h>
   -lbastard

================================================================================
 Designing a Disassembler


   -file loading
   -preprocessing
   -disassembly strategies
   -post-processing
   -decompilation
   -displaying the disassembled file
   -user interaction
   -database interfaces


================================================================================
 The CPU Modules as Independent Libraries

   
   -operands, address expressions, register tables
   -code structures
   -wrappers


================================================================================
 Replacing EiC or Typhoon


   -uh....
