================================================================================
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 
   target_load( "$name" );
   target_set_format( "ELF" );
   target_set_arch( "i386" );
   SetTargetAsm( "intel" );
   SetTargetLang( "C" );
   disasm_target( "full", NULL );
   target_save_asm( "./.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....
