opdis/opdis.c File Reference

Disassembler front-end for libopcodes. More...

#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <opdis/opdis.h>
#include <opdis/x86_decoder.h>

Functions

void opdis_debug (opdis_t o, int min_level, const char *format,...)
 Print debug message to STDERR.
int opdis_default_handler (const opdis_insn_t *insn, void *arg)
 The built-in opdis handler callback. The default handler returns true unless the instruction is invalid or if the address has already been visited.
void opdis_default_display (const opdis_insn_t *i, void *arg)
 The built-in opdis display callback This callback writes the instruction ascii field to STDOUT.
opdis_vma_t opdis_default_resolver (const opdis_insn_t *insn, void *arg)
 The built-in opdis resolver callback. This callback returns the immediate value of the taregt operand for the instruction (if set) or OPDIS_INVALID_ADDR.
void opdis_default_error_reporter (enum opdis_error_t error, const char *msg, void *arg)
 The built-in error reporter.
int opdis_default_decoder (const opdis_insn_buf_t in, opdis_insn_t *out, const opdis_byte_t *buf, opdis_off_t offset, opdis_vma_t vma, opdis_off_t length, void *arg)
 The built-in opdis instruction decoder This callback fills the ascii, offset, vma, bytes, and size fields of the output instruction object. It is recommended that all other decoders invoke this callback directly to fill these fields.
opdis_t LIBCALL opdis_init (void)
 Initialize an opdis disassembler.
void LIBCALL opdis_term (opdis_t o)
 Cleanup an opdis disassembler.
opdis_t LIBCALL opdis_init_from_bfd (bfd *abfd)
 Initialize an opdis disassembler based on a BFD object.
void LIBCALL opdis_set_defaults (opdis_t o)
 Initializes an opdis object to default, sane values.
void LIBCALL opdis_set_disassembler_options (opdis_t o, const char *options)
 Set libopcodes disassembler options.
void LIBCALL opdis_set_x86_syntax (opdis_t o, enum opdis_x86_syntax_t syntax)
 Configure the disassembler to use Intel or AT&T syntax.
void LIBCALL opdis_set_arch (opdis_t o, enum bfd_architecture arch, unsigned long mach, disassembler_ftype fn)
 Set the architecture and disassembler routine for libopcodes.
void LIBCALL opdis_set_display (opdis_t o, OPDIS_DISPLAY fn, void *arg)
 Set the callback used to display or store disassembled instructions.
void LIBCALL opdis_set_handler (opdis_t o, OPDIS_HANDLER fn, void *arg)
 Set the callback used to determine whether to continue disassembly.
void LIBCALL opdis_set_decoder (opdis_t o, OPDIS_DECODER fn, void *arg)
 Set the callback used to build an opdis_insn_t from libopcodes data.
void LIBCALL opdis_set_resolver (opdis_t o, OPDIS_RESOLVER fn, void *arg)
 Set the callback used to obtain the buffer offset of a branch target.
void LIBCALL opdis_set_error_reporter (opdis_t o, OPDIS_ERROR fn, void *arg)
 Set the callback used to report errors.
unsigned int LIBCALL opdis_disasm_insn_size (opdis_t o, opdis_buf_t buf, opdis_vma_t vma)
 Return the size of the instruction at an offset in the buffer.
unsigned int LIBCALL opdis_disasm_insn (opdis_t o, opdis_buf_t buf, opdis_vma_t vma, opdis_insn_t *insn)
 Disassemble a single instruction in the buffer.
int LIBCALL opdis_disasm_linear (opdis_t o, opdis_buf_t buf, opdis_vma_t vma, opdis_off_t length)
 Disassemble a sequence of instructions in order.
int LIBCALL opdis_disasm_cflow (opdis_t o, opdis_buf_t buf, opdis_vma_t vma)
 Disassemble a buffer following flow of control.
int LIBCALL opdis_disasm_bfd_linear (opdis_t o, bfd *abfd, opdis_vma_t vma, opdis_off_t length)
 Disassemble a sequence of instructions in a BFD.
int LIBCALL opdis_disasm_bfd_cflow (opdis_t o, bfd *abfd, opdis_vma_t vma)
 Disassemble a contents of a BFD following flow of control.
int LIBCALL opdis_disasm_bfd_section (opdis_t o, asection *sec)
 Disassemble a the contents of a BFD section using linear disassembly.
int LIBCALL opdis_disasm_bfd_symbol (opdis_t o, asymbol *sym)
 Disassemble a BFD following flow of control from a symbol.
int LIBCALL opdis_disasm_bfd_entry (opdis_t o, bfd *abfd)
 Disassemble a BFD following flow of control from entry point (_start).
void LIBCALL opdis_error (opdis_t o, enum opdis_error_t error, const char *msg)
 Send an error message to the error reporter/.

Detailed Description

Disassembler front-end for libopcodes.

Author:
TG Community Developers <community@thoughtgang.org>
Note:
Copyright (c) 2010 ThoughtGang. Released under the GNU Public License, version 3. See http://www.gnu.org/licenses/gpl.txt for details.

Generated on Wed Mar 10 14:30:45 2010 for Opdis Disassembly Library by  doxygen 1.6.1