ROSE  0.9.9.109
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...
 
SgAsmIntegerTypebuildTypeU1 ()
 1-bit unsigned (Boolean)
 
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)
 
SgAsmIntegerTypebuildAsmTypeByte () ROSE_DEPRECATED("use buildTypeX86Byte")
 
SgAsmIntegerTypebuildAsmTypeWord () ROSE_DEPRECATED("use buildTypeX86Word")
 
SgAsmIntegerTypebuildAsmTypeDoubleWord () ROSE_DEPRECATED("use buildTypeX86DoubleWord")
 
SgAsmIntegerTypebuildAsmTypeQuadWord () ROSE_DEPRECATED("use buildTypeX86QuadWord")
 
SgAsmFloatTypebuildAsmTypeSingleFloat () ROSE_DEPRECATED("use buildTypeX86Float32")
 
SgAsmFloatTypebuildAsmTypeDoubleFloat () ROSE_DEPRECATED("use buildTypeX86Float64")
 
SgAsmFloatTypebuildAsmType128bitFloat () ROSE_DEPRECATED("use architecture specific type")
 
SgAsmFloatTypebuildAsmType80bitFloat () ROSE_DEPRECATED("use buildTypeX86Float80")
 
SgAsmVectorTypebuildAsmTypeDoubleQuadWord () ROSE_DEPRECATED("use buildTypeX86DoubleQuadWord")
 
SgAsmDirectRegisterExpressionbuildSgAsmx86RegisterReferenceExpression (RegisterDescriptor) ROSE_DEPRECATED("use SgAsmDirectRegisterExpression const ructor")
 
SgAsmDirectRegisterExpressionbuildSgAsmArmRegisterReferenceExpression (RegisterDescriptor) ROSE_DEPRECATED("use SgAsmDirectRegisterExpression const ructor")
 
SgAsmDirectRegisterExpressionbuildSgAsmMipsRegisterReferenceExpression (RegisterDescriptor) ROSE_DEPRECATED("use SgAsmDirectRegisterExpression const ructor")
 
SgAsmDirectRegisterExpressionbuildSgAsmPowerpcRegisterReferenceExpression (RegisterDescriptor) ROSE_DEPRECATED("use SgAsmDirectRegisterExpression const ructor")
 
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)
 
SgAsmIntegerValueExpressionbuildAsmByteValue (uint8_t) ROSE_DEPRECATED("use buildValueX86Byte")
 
SgAsmIntegerValueExpressionbuildAsmWordValue (uint16_t) ROSE_DEPRECATED("use buildValueX86Word")
 
SgAsmIntegerValueExpressionbuildAsmDWordValue (uint32_t) ROSE_DEPRECATED("use buildValueX86DWord")
 
SgAsmIntegerValueExpressionbuildAsmQWordValue (uint64_t) ROSE_DEPRECATED("use buildValueX86QWord")
 
SgAsmIntegerValueExpressionmakeByteValue (uint8_t) ROSE_DEPRECATED("use buildValueX86Byte")
 
SgAsmIntegerValueExpressionmakeWordValue (uint16_t) ROSE_DEPRECATED("use buildValueX86Word")
 
SgAsmIntegerValueExpressionmakeDWordValue (uint32_t) ROSE_DEPRECATED("use buildValueX86DWord")
 
SgAsmIntegerValueExpressionmakeQWordValue (uint64_t) ROSE_DEPRECATED("use buildValueX86QWord")
 
SgAsmBinaryAddbuildAddExpression (SgAsmExpression *lhs, SgAsmExpression *rhs)
 
SgAsmBinarySubtractbuildSubtractExpression (SgAsmExpression *lhs, SgAsmExpression *rhs)
 
SgAsmBinaryAddPreupdatebuildAddPreupdateExpression (SgAsmExpression *lhs, SgAsmExpression *rhs)
 
SgAsmBinarySubtractPreupdatebuildSubtractPreupdateExpression (SgAsmExpression *lhs, SgAsmExpression *rhs)
 
SgAsmBinaryAddPostupdatebuildAddPostupdateExpression (SgAsmExpression *lhs, SgAsmExpression *rhs)
 
SgAsmBinarySubtractPostupdatebuildSubtractPostupdateExpression (SgAsmExpression *lhs, SgAsmExpression *rhs)
 
SgAsmBinaryMultiplybuildMultiplyExpression (SgAsmExpression *lhs, SgAsmExpression *rhs)
 
SgAsmBinaryLslbuildLslExpression (SgAsmExpression *lhs, SgAsmExpression *rhs)
 
SgAsmBinaryLsrbuildLsrExpression (SgAsmExpression *lhs, SgAsmExpression *rhs)
 
SgAsmBinaryAsrbuildAsrExpression (SgAsmExpression *lhs, SgAsmExpression *rhs)
 
SgAsmBinaryRorbuildRorExpression (SgAsmExpression *lhs, SgAsmExpression *rhs)
 
SgAsmUnaryRrxbuildRrxExpression (SgAsmExpression *lhs)
 
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 *)
 
SgAsmBinaryAddmakeAdd (SgAsmExpression *lhs, SgAsmExpression *rhs) ROSE_DEPRECATED("use buildAddExpression")
 
SgAsmBinarySubtractmakeSubtract (SgAsmExpression *lhs, SgAsmExpression *rhs) ROSE_DEPRECATED("use buildSubtractExpression")
 
SgAsmBinaryAddPreupdatemakeAddPreupdate (SgAsmExpression *lhs, SgAsmExpression *rhs) ROSE_DEPRECATED("use buildAddPreupdateExpression")
 
SgAsmBinarySubtractPreupdatemakeSubtractPreupdate (SgAsmExpression *lhs, SgAsmExpression *rhs) ROSE_DEPRECATED("use buildSubtractPreupdateExpression")
 
SgAsmBinaryAddPostupdatemakeAddPostupdate (SgAsmExpression *lhs, SgAsmExpression *rhs) ROSE_DEPRECATED("use buildAddPostupdateExpression")
 
SgAsmBinarySubtractPostupdatemakeSubtractPostupdate (SgAsmExpression *lhs, SgAsmExpression *rhs) ROSE_DEPRECATED("use buildSubtractPostupdateExpression")
 
SgAsmBinaryMultiplymakeMul (SgAsmExpression *lhs, SgAsmExpression *rhs) ROSE_DEPRECATED("use buildMultiplyExpression")
 
SgAsmBinaryLslmakeLsl (SgAsmExpression *lhs, SgAsmExpression *rhs) ROSE_DEPRECATED("use buildLslExpression")
 
SgAsmBinaryLsrmakeLsr (SgAsmExpression *lhs, SgAsmExpression *rhs) ROSE_DEPRECATED("use buildLsrExpression")
 
SgAsmBinaryAsrmakeAsr (SgAsmExpression *lhs, SgAsmExpression *rhs) ROSE_DEPRECATED("use buildAsrExpression")
 
SgAsmBinaryRormakeRor (SgAsmExpression *lhs, SgAsmExpression *rhs) ROSE_DEPRECATED("use buildRorExpression")
 
SgAsmUnaryRrxmakeRrx (SgAsmExpression *lhs) ROSE_DEPRECATED("use buildRrxExpression")
 
SgAsmUnaryArmSpecialRegisterListmakeArmSpecialRegisterList (SgAsmExpression *lhs) ROSE_DEPRECATED("use buildArmSpecialRegisterList")
 
SgAsmExprListExpmakeExprListExp () ROSE_DEPRECATED("use buildExprListExpression")
 
SgAsmMemoryReferenceExpressionmakeMemoryReference (SgAsmExpression *addr, SgAsmExpression *segment=NULL, SgAsmType *type=NULL) ROSE_DEPRECATED("use buildMemoryReferenceExpression")
 
template<typename Insn >
Insn * appendOperand (Insn *insn, SgAsmExpression *op)
 
SgAsmX86Instructionbuildx86Instruction (X86InstructionKind) ROSE_DEPRECATED("use buildX86Instruction")
 
SgAsmX86InstructionbuildX86Instruction (X86InstructionKind)
 
SgAsmX86Instructionbuildx86Instruction (X86InstructionKind, SgAsmExpression *operand) ROSE_DEPRECATED("use buildX86Instruction")
 
SgAsmX86InstructionbuildX86Instruction (X86InstructionKind, SgAsmExpression *operand)
 
SgAsmX86Instructionbuildx86Instruction (X86InstructionKind, SgAsmExpression *lhs, SgAsmExpression *rhs) ROSE_DEPRECATED("use buildX86Instruction")
 
SgAsmX86InstructionbuildX86Instruction (X86InstructionKind, SgAsmExpression *lhs, SgAsmExpression *rhs)
 
SgAsmX86Instructionbuildx86Instruction (X86InstructionKind, SgAsmOperandList *operands) ROSE_DEPRECATED("use buildX86Instruction")
 
SgAsmInstructionbuildMultibyteNopInstruction (int n) ROSE_DEPRECATED("use buildX86MultibyteNopInstruction")
 
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.