ROSE  0.10.0.0
Functions
Rose::SageBuilderAsm Namespace Reference

Description

Functions to build binary analysis ASTs.

Functions

SgBinaryCompositebuildBinaryComposite (const std::string &fileName)
 Build a new binary composite object. More...
 
SgAsmIntegerTypebuildTypeU (size_t nBits)
 Unsigned type of specified size. More...
 
SgAsmIntegerTypebuildTypeI (size_t nBits)
 Signed type of specified size. More...
 
SgAsmIntegerTypebuildTypeU1 ()
 1-bit unsigned (Boolean). More...
 
SgAsmIntegerTypebuildTypeU4 ()
 4-bit unsigned. More...
 
SgAsmIntegerTypebuildTypeU8 ()
 8-bit unsigned. More...
 
SgAsmIntegerTypebuildTypeU16 ()
 16-bit unsigned. More...
 
SgAsmIntegerTypebuildTypeU32 ()
 32-bit unsigned. More...
 
SgAsmIntegerTypebuildTypeU64 ()
 64-bit unsigned. More...
 
SgAsmIntegerTypebuildTypeI8 ()
 8-bit signed. More...
 
SgAsmIntegerTypebuildTypeI16 ()
 16-bit signed. More...
 
SgAsmIntegerTypebuildTypeI32 ()
 32-bit signed. More...
 
SgAsmIntegerTypebuildTypeI64 ()
 64-bit signed. More...
 
SgAsmFloatTypebuildIeee754Binary32 ()
 32-bit IEEE-754 floating-point. More...
 
SgAsmFloatTypebuildIeee754Binary64 ()
 64-bit IEEE-754 floating-point. More...
 
SgAsmFloatTypebuildIeee754Binary80 ()
 80-bit IEEE-754 floating-point (as in x86). More...
 
SgAsmVectorTypebuildTypeVector (size_t, SgAsmType *)
 Fixed-size, packed array. More...
 
SgAsmIntegerTypebuildTypeX86Byte ()
 8-bit unsigned. More...
 
SgAsmIntegerTypebuildTypeX86Word ()
 16-bit unsigned. More...
 
SgAsmIntegerTypebuildTypeX86DoubleWord ()
 32-bit unsigned. More...
 
SgAsmIntegerTypebuildTypeX86QuadWord ()
 64-bit unsigned. More...
 
SgAsmFloatTypebuildTypeX86Float32 ()
 32-bit IEEE-754 floating-point. More...
 
SgAsmFloatTypebuildTypeX86Float64 ()
 64-bit IEEE-754 floating-point. More...
 
SgAsmFloatTypebuildTypeX86Float80 ()
 80-bit IEEE-754 floating-point. More...
 
SgAsmVectorTypebuildTypeX86DoubleQuadWord ()
 Vector of two 64-bit unsigned integers. More...
 
SgAsmFloatTypebuildTypeM68kFloat96 ()
 Motorola M68k 96-bit float (16-bits are always zero). More...
 
SgAsmFloatTypebuildTypeM68kFloat80 ()
 Motorola M68k 96-bit float w/out 16-bit constant zero field. More...
 
SgAsmIntegerValueExpressionbuildValueInteger (uint64_t value, SgAsmType *)
 
SgAsmIntegerValueExpressionbuildValueInteger (const Sawyer::Container::BitVector &, SgAsmType *)
 
SgAsmFloatValueExpressionbuildValueFloat (double value, SgAsmType *)
 
SgAsmFloatValueExpressionbuildValueFloat (const Sawyer::Container::BitVector &, SgAsmType *)
 
SgAsmIntegerValueExpressionbuildValueU1 (bool)
 
SgAsmIntegerValueExpressionbuildValueU8 (uint8_t)
 
SgAsmIntegerValueExpressionbuildValueU16 (uint16_t)
 
SgAsmIntegerValueExpressionbuildValueU32 (uint32_t)
 
SgAsmIntegerValueExpressionbuildValueU64 (uint64_t)
 
SgAsmIntegerValueExpressionbuildValueI8 (int8_t)
 
SgAsmIntegerValueExpressionbuildValueI16 (int16_t)
 
SgAsmIntegerValueExpressionbuildValueI32 (int32_t)
 
SgAsmIntegerValueExpressionbuildValueI64 (int64_t)
 
SgAsmFloatValueExpressionbuildValueIeee754Binary32 (double)
 
SgAsmFloatValueExpressionbuildValueIeee754Binary64 (double)
 
SgAsmIntegerValueExpressionbuildValueX86Byte (uint8_t)
 
SgAsmIntegerValueExpressionbuildValueX86Word (uint16_t)
 
SgAsmIntegerValueExpressionbuildValueX86DWord (uint32_t)
 
SgAsmIntegerValueExpressionbuildValueX86QWord (uint64_t)
 
SgAsmFloatValueExpressionbuildValueX86Float32 (double)
 
SgAsmFloatValueExpressionbuildValueX86Float64 (double)
 
SgAsmFloatValueExpressionbuildValueX86Float80 (double)
 
SgAsmBinaryAddbuildAddExpression (SgAsmExpression *lhs, SgAsmExpression *rhs, SgAsmType *type=NULL)
 
SgAsmBinarySubtractbuildSubtractExpression (SgAsmExpression *lhs, SgAsmExpression *rhs, SgAsmType *type=NULL)
 
SgAsmBinaryAddPreupdatebuildAddPreupdateExpression (SgAsmExpression *lhs, SgAsmExpression *rhs, SgAsmType *type=NULL)
 
SgAsmBinarySubtractPreupdatebuildSubtractPreupdateExpression (SgAsmExpression *lhs, SgAsmExpression *rhs, SgAsmType *type=NULL)
 
SgAsmBinaryAddPostupdatebuildAddPostupdateExpression (SgAsmExpression *lhs, SgAsmExpression *rhs, SgAsmType *type=NULL)
 
SgAsmBinarySubtractPostupdatebuildSubtractPostupdateExpression (SgAsmExpression *lhs, SgAsmExpression *rhs, SgAsmType *type=NULL)
 
SgAsmBinaryMultiplybuildMultiplyExpression (SgAsmExpression *lhs, SgAsmExpression *rhs, SgAsmType *type=NULL)
 
SgAsmBinaryLslbuildLslExpression (SgAsmExpression *lhs, SgAsmExpression *rhs, SgAsmType *type=NULL)
 
SgAsmBinaryLsrbuildLsrExpression (SgAsmExpression *lhs, SgAsmExpression *rhs, SgAsmType *type=NULL)
 
SgAsmBinaryAsrbuildAsrExpression (SgAsmExpression *lhs, SgAsmExpression *rhs, SgAsmType *type=NULL)
 
SgAsmBinaryRorbuildRorExpression (SgAsmExpression *lhs, SgAsmExpression *rhs, SgAsmType *type=NULL)
 
SgAsmUnaryRrxbuildRrxExpression (SgAsmExpression *lhs, SgAsmType *type=NULL)
 
SgAsmUnaryArmSpecialRegisterListbuildArmSpecialRegisterList (SgAsmExpression *lhs)
 
SgAsmExprListExpbuildExprListExpression ()
 
void appendExpression (SgAsmExprListExp *, SgAsmExpression *)
 
SgAsmMemoryReferenceExpressionbuildMemoryReferenceExpression (SgAsmExpression *addr, SgAsmExpression *segment=NULL, SgAsmType *type=NULL)
 
SgAsmRiscOperationbuildRiscOperation (SgAsmRiscOperation::RiscOperator)
 
SgAsmRiscOperationbuildRiscOperation (SgAsmRiscOperation::RiscOperator, SgAsmExpression *)
 
SgAsmRiscOperationbuildRiscOperation (SgAsmRiscOperation::RiscOperator, SgAsmExpression *, SgAsmExpression *)
 
SgAsmRiscOperationbuildRiscOperation (SgAsmRiscOperation::RiscOperator, SgAsmExpression *, SgAsmExpression *, SgAsmExpression *)
 
SgAsmRiscOperationbuildRiscOperation (SgAsmRiscOperation::RiscOperator, SgAsmExpression *, SgAsmExpression *, SgAsmExpression *, SgAsmExpression *)
 
template<typename Insn >
Insn * appendOperand (Insn *insn, SgAsmExpression *op)
 
SgAsmX86InstructionbuildX86Instruction (Rose::BinaryAnalysis::X86InstructionKind)
 
SgAsmX86InstructionbuildX86Instruction (Rose::BinaryAnalysis::X86InstructionKind, SgAsmExpression *operand)
 
SgAsmX86InstructionbuildX86Instruction (Rose::BinaryAnalysis::X86InstructionKind, SgAsmExpression *lhs, SgAsmExpression *rhs)
 
SgAsmX86InstructionbuildX86MultibyteNopInstruction (size_t nBytes)
 
SgAsmBlockbuildBasicBlock (const std::vector< SgAsmInstruction * > &)
 
SgAsmFunctionbuildFunction (rose_addr_t entryVa, const std::vector< SgAsmBlock * > &)
 
SgAsmStaticDatabuildStaticData (rose_addr_t startVa, const SgUnsignedCharList &rawData)
 
SgAsmBlockbuildDataBlock (SgAsmStaticData *)
 

Function Documentation

SgBinaryComposite* Rose::SageBuilderAsm::buildBinaryComposite ( const std::string &  fileName)

Build a new binary composite object.

A SgBinaryComposite is the top-level node for binary analysis and holds two lists: a list of file headers representing the various executable containers that have been parsed, and a list of interpretations that organize thos headers into compatible units. For instance, a Microsoft Windows executable file will have two headers (DOS and PE) and two interpretations (one for the DOS code and data and another for the PE code and data). If dynamic linking is performed, then even more headers will be present, but their code and data will likely be inserted into one of the existing interpretations. An interpretation (SgAsmInterpretation) is analogous to a process.

ASTs normally have only one SgBinaryComposite, but an AST can have more than one if the AST is used to analyze two or more binaries. For instance, if we have two related versions of the i586 ELF "login" program and we want to run some analysis that compares the two programs, then we probably want two SgBinaryComposite nodes in the AST. Each SgBinaryComposite will have a SgAsmInterpretation to represent the i586 "login" process. Doing it this way will prevent headers and code from one version to be confused with headers and code from the other version.

A SgProject node will be created if one has not been created already. The segments/sections from the file are mapped into process virtual memory in the SgAsmInterpretation but are not disassembled.

SgAsmIntegerType* Rose::SageBuilderAsm::buildTypeU ( size_t  nBits)

Unsigned type of specified size.

SgAsmIntegerType* Rose::SageBuilderAsm::buildTypeI ( size_t  nBits)

Signed type of specified size.

SgAsmIntegerType* Rose::SageBuilderAsm::buildTypeU1 ( )

1-bit unsigned (Boolean).

SgAsmIntegerType* Rose::SageBuilderAsm::buildTypeU4 ( )

4-bit unsigned.

SgAsmIntegerType* Rose::SageBuilderAsm::buildTypeU8 ( )

8-bit unsigned.

SgAsmIntegerType* Rose::SageBuilderAsm::buildTypeU16 ( )

16-bit unsigned.

SgAsmIntegerType* Rose::SageBuilderAsm::buildTypeU32 ( )

32-bit unsigned.

SgAsmIntegerType* Rose::SageBuilderAsm::buildTypeU64 ( )

64-bit unsigned.

SgAsmIntegerType* Rose::SageBuilderAsm::buildTypeI8 ( )

8-bit signed.

SgAsmIntegerType* Rose::SageBuilderAsm::buildTypeI16 ( )

16-bit signed.

SgAsmIntegerType* Rose::SageBuilderAsm::buildTypeI32 ( )

32-bit signed.

SgAsmIntegerType* Rose::SageBuilderAsm::buildTypeI64 ( )

64-bit signed.

SgAsmFloatType* Rose::SageBuilderAsm::buildIeee754Binary32 ( )

32-bit IEEE-754 floating-point.

SgAsmFloatType* Rose::SageBuilderAsm::buildIeee754Binary64 ( )

64-bit IEEE-754 floating-point.

SgAsmFloatType* Rose::SageBuilderAsm::buildIeee754Binary80 ( )

80-bit IEEE-754 floating-point (as in x86).

SgAsmVectorType* Rose::SageBuilderAsm::buildTypeVector ( size_t  ,
SgAsmType  
)

Fixed-size, packed array.

SgAsmIntegerType* Rose::SageBuilderAsm::buildTypeX86Byte ( )

8-bit unsigned.

SgAsmIntegerType* Rose::SageBuilderAsm::buildTypeX86Word ( )

16-bit unsigned.

SgAsmIntegerType* Rose::SageBuilderAsm::buildTypeX86DoubleWord ( )

32-bit unsigned.

SgAsmIntegerType* Rose::SageBuilderAsm::buildTypeX86QuadWord ( )

64-bit unsigned.

SgAsmFloatType* Rose::SageBuilderAsm::buildTypeX86Float32 ( )

32-bit IEEE-754 floating-point.

SgAsmFloatType* Rose::SageBuilderAsm::buildTypeX86Float64 ( )

64-bit IEEE-754 floating-point.

SgAsmFloatType* Rose::SageBuilderAsm::buildTypeX86Float80 ( )

80-bit IEEE-754 floating-point.

SgAsmVectorType* Rose::SageBuilderAsm::buildTypeX86DoubleQuadWord ( )

Vector of two 64-bit unsigned integers.

SgAsmFloatType* Rose::SageBuilderAsm::buildTypeM68kFloat96 ( )

Motorola M68k 96-bit float (16-bits are always zero).

SgAsmFloatType* Rose::SageBuilderAsm::buildTypeM68kFloat80 ( )

Motorola M68k 96-bit float w/out 16-bit constant zero field.