idb2reml (version 0.1)
index
/Users/ero/Desktop/Devel/idb2reml/idb2reml.py

IDA to REML export script.
 
Copyright (c) 2004 Ero Carrera <ero@dkbza.org>
 
All rights reserved.
 
For detailed copyright information see the file COPYING in
the root of the distribution archive.

 
Modules
       
os
re
string

 
Classes
       
FunctionDissect
XMLElement

 
class FunctionDissect
    Perform an analisys of a function and all its subelements.
 
FunctionDissect(start_address)
 
start_address:
        start address of the function to analyze
 
  Methods defined here:
__init__(self, start_address)
analyze_function_body(self)
Analize and compile all the function's information.
 
Goes though all the elements of the functions and
creates the corresponding XML representation for them.
collect_function_chunks(self, ea)
Collect all start and end addresses for the function chunks.
do_code_flow(self, ea)
Process all branching arriving or starting from this address.
do_data_references(self, ea)
Gather all data references starting or ending in this address.
do_instruction(self, ea)
do_operands(self, ea)
Process operands.
 
Processes the operands and returns the XML data describing them.
get_externs(self)
Returns thw compiled external branching list.
get_name(self)
Returns the function name.
get_xml(self)
Returns the XMLElement instance representing the function.
is_code_at_address(self, ea)
Weird, currently an almost useless function.
is_library_function(self)
Check whether the current function is a library function
is_thunk_function(self)
Check whether the current function is a thunk function

 
class XMLElement
    XML data class.
 
This class provides a container for XML elements and
subelements.
 
XMLElement(tag, [(attr1, val1), (attr2, val2), ...], {})
 
tag:
        the tag to use for this element.
        
[(attr1, val1), (attr2, val2), ...]:
        a list of attributes, each they should be a list of
        two elements, the attribute name and its value
        
{}:
        a dictionary containing different modifiers for the
        element. The only one currently supported is:
                empty = Ture/False
        for an empty XML element.
 
  Methods defined here:
__init__(self, tag, *attributes, **mod)
add_subelement(self, element)
Append an element to the element list.
add_subelements(self, elements)
Append a list of elements to the element list.
append_attribute(self, attribute)
Append an attribute to the attribute list.
append_attributes(self, *attributes)
Append a list of attributes to the attribute list.
to_string(self)
Return the textual representation of the XML instance.

 
Functions
       
get_comment(ea)
Get the comment at the given address, if any, and return the XML representation.
get_data_seq(ea, length, width)
get_string(ea)
Get the string at ea and return XML data representing it.
main()
write_reml(data)
Dump the XML date to the REML file

 
Data
        ASCSTR_C = 0
ASCSTR_LEN2 = 2
ASCSTR_LEN4 = 4
ASCSTR_PASCAL = 1
ASCSTR_ULEN2 = 5
ASCSTR_ULEN4 = 6
ASCSTR_UNICODE = 3
IDB2REML_OUTPUT = 'IDB2REML_OUTPUT'
OP_TYPE_386_CONTROL = 9
OP_TYPE_386_DEBUG = 10
OP_TYPE_386_TRACE = 11
OP_TYPE_8051_BIT = 13
OP_TYPE_8051_BITNOT = 14
OP_TYPE_BAD = -1
OP_TYPE_BASE_IDX = 3
OP_TYPE_BASE_IDX_DIS = 4
OP_TYPE_FPP_REG = 8
OP_TYPE_IMMEDIATE = 5
OP_TYPE_IMMEDIATE_FAR = 6
OP_TYPE_IMMEDIATE_NEAR = 7
OP_TYPE_MEM_REF = 2
OP_TYPE_NONE = 0
OP_TYPE_REGISTER = 1
OP_TYPE_Z80_CONDITION = 12
TAG_AT = 'at'
TAG_BRANCH = 'branch'
TAG_COMMENT = 'cmmt'
TAG_DATA = 'd'
TAG_DATA_REFERENCE = 'ref'
TAG_DISASSEMBLY = 'disassembly'
TAG_ENTRY_POINT = 'entry_point'
TAG_FROM = 'from'
TAG_FUNCTION = 'function'
TAG_INSTRUCTION = 'i'
TAG_IS_CODE = 'code'
TAG_IS_FLOW = 'flow'
TAG_IS_LIBRARY = 'library'
TAG_IS_THUNK = 'thunk'
TAG_LOC_NAME = 'loc_name'
TAG_MNEMONIC = 'mnem'
TAG_NAME = 'name'
TAG_OPERAND = 'o'
TAG_OPERAND_ORD = 'n'
TAG_OPERAND_TYPE = 't'
TAG_SOURCE = 'source'
TAG_STRING = 'string'
TAG_TO = 'to'
TAG_TYPE = 'type'
__author__ = 'Ero Carrera'
__version__ = '0.1'
e = <exceptions.ImportError instance at 0xe3f08>

 
Author
        Ero Carrera