ROSE  0.9.12.28
Public Types | Public Member Functions | List of all members
Rose::BinaryAnalysis::Concolic::Specimen Class Reference

Description

Binary specimen.

The speciment represents the thing that is to be tested, but not how to test it. In other words, a specimen might be an executable, but not any specifics about how to run the executable such as which arguments to give it.

Definition at line 123 of file BinaryConcolic.h.

#include <BinaryConcolic.h>

Inheritance diagram for Rose::BinaryAnalysis::Concolic::Specimen:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::Concolic::Specimen:
Collaboration graph
[legend]

Public Types

typedef Sawyer::SharedPointer< SpecimenPtr
 Referenc-counting pointer to a Specimen. More...
 

Public Member Functions

void open (const boost::filesystem::path &executableName)
 Open an executable file. More...
 
void close ()
 Close the executable file. More...
 
bool isEmpty () const
 Test whether this object is empty. More...
 
std::string printableName (const DatabasePtr &db=DatabasePtr())
 Returns printable name of specimen for diagnostic output. More...
 
const std::vector< uint8_t > & content () const
 Property: Specimen content. More...
 
void content (std::vector< uint8_t > binary_data)
 The setter helps to conveniently populate a Specimen's properties from a database query. More...
 
std::string name () const
 Property: Specimen name. More...
 
void name (const std::string &)
 Property: Specimen name. More...
 
- Public Member Functions inherited from Sawyer::SharedObject
 SharedObject ()
 Default constructor. More...
 
 SharedObject (const SharedObject &)
 Copy constructor. More...
 
virtual ~SharedObject ()
 Virtual destructor. More...
 
SharedObjectoperator= (const SharedObject &)
 Assignment. More...
 
- Public Member Functions inherited from Sawyer::SharedFromThis< Specimen >
SharedPointer< Specimen > sharedFromThis ()
 Create a shared pointer from this. More...
 
SharedPointer< const Specimen > sharedFromThis () const
 Create a shared pointer from this. More...
 

Static Public Member Functions

static Ptr instance (const boost::filesystem::path &executableName)
 Allocating constructor.
 
static Ptr instance ()
 Allocating constructor.
 

Member Typedef Documentation

Referenc-counting pointer to a Specimen.

Definition at line 126 of file BinaryConcolic.h.

Member Function Documentation

void Rose::BinaryAnalysis::Concolic::Specimen::open ( const boost::filesystem::path &  executableName)

Open an executable file.

The contents of the executable file are copied into this object when the file is opened. After the file is opened successfully, the isEmpty predicate returns false. Throws an Exception if the file cannot be opened.

Thread safety: This method is thread-safe.

void Rose::BinaryAnalysis::Concolic::Specimen::close ( )

Close the executable file.

Removes all content from this object, or does nothing if isEmpty returns true. After this call, isEmpty returns true.

Thread safety: This method is thread-safe.

bool Rose::BinaryAnalysis::Concolic::Specimen::isEmpty ( ) const

Test whether this object is empty.

Returns true if a binary executable is associated with this specimen, false otherwise. See also, open and close.

Thread safety: This method is thread-safe.

std::string Rose::BinaryAnalysis::Concolic::Specimen::name ( ) const

Property: Specimen name.

This should be a printable name, such as a file name. It's used mostly for informational purposes such as debugging. There is no requirement that names be unique or non-empty or contain only printable characters.

Thread safety: This methods is thread-safe.

void Rose::BinaryAnalysis::Concolic::Specimen::name ( const std::string &  )

Property: Specimen name.

This should be a printable name, such as a file name. It's used mostly for informational purposes such as debugging. There is no requirement that names be unique or non-empty or contain only printable characters.

Thread safety: This methods is thread-safe.

std::string Rose::BinaryAnalysis::Concolic::Specimen::printableName ( const DatabasePtr db = DatabasePtr())

Returns printable name of specimen for diagnostic output.

Returns a string suitable for printing to a terminal, containing the word "specimen", the database ID if appropriate, and the specimen name using C-style double-quoted string literal syntax if not empty. The database ID is shown if a non-null database is specified and this specimen exists in that database.

const std::vector<uint8_t>& Rose::BinaryAnalysis::Concolic::Specimen::content ( ) const

Property: Specimen content.

This property contains the bytes that compose a specimen. For instance, for an ELF executable, the content is the bytes that compose the executable file. This property is read-only, initialized when the Specimen is created.

Thread safety: This method is thread safe.

void Rose::BinaryAnalysis::Concolic::Specimen::content ( std::vector< uint8_t >  binary_data)

The setter helps to conveniently populate a Specimen's properties from a database query.


The documentation for this class was generated from the following file: