ROSE  0.9.11.35
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)
 
SgAsmIntegerTypebuildTypeU4 ()
 4-bit unsigned
 
SgAsmIntegerTypebuildTypeU8 ()
 8-bit unsigned
 
SgAsmIntegerTypebuildTypeU16 ()
 16-bit unsigned
 
SgAsmIntegerTypebuildTypeU32 ()
 32-bit unsigned
 
SgAsmIntegerTypebuildTypeU64 ()
 64-bit unsigned
 
SgAsmIntegerTypebuildTypeI8 ()
 8-bit signed
 
SgAsmIntegerTypebuildTypeI16 ()
 16-bit signed
 
SgAsmIntegerTypebuildTypeI32 ()
 32-bit signed
 
SgAsmIntegerTypebuildTypeI64 ()
 64-bit signed
 
SgAsmFloatTypebuildIeee754Binary32 ()
 32-bit IEEE-754 floating-point
 
SgAsmFloatTypebuildIeee754Binary64 ()
 64-bit IEEE-754 floating-point
 
SgAsmFloatTypebuildIeee754Binary80 ()
 80-bit IEEE-754 floating-point (as in x86)
 
SgAsmVectorTypebuildTypeVector (size_t, SgAsmType *)
 Fixed-size, packed array.
 
SgAsmIntegerTypebuildTypeX86Byte ()
 8-bit unsigned
 
SgAsmIntegerTypebuildTypeX86Word ()
 16-bit unsigned
 
SgAsmIntegerTypebuildTypeX86DoubleWord ()
 32-bit unsigned
 
SgAsmIntegerTypebuildTypeX86QuadWord ()
 64-bit unsigned
 
SgAsmFloatTypebuildTypeX86Float32 ()
 32-bit IEEE-754 floating-point
 
SgAsmFloatTypebuildTypeX86Float64 ()
 64-bit IEEE-754 floating-point
 
SgAsmFloatTypebuildTypeX86Float80 ()
 80-bit IEEE-754 floating-point
 
SgAsmVectorTypebuildTypeX86DoubleQuadWord ()
 Vector of two 64-bit unsigned integers.
 
SgAsmFloatTypebuildTypeM68kFloat96 ()
 Motorola M68k 96-bit float (16-bits are always zero)
 
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.