ROSE  0.9.9.168
Public Types | Public Member Functions | List of all members
Rose::BinaryAnalysis::MagicNumber Class Reference

Description

Definition at line 14 of file BinaryMagic.h.

Public Types

enum  Mechanism {
  FAST,
  SLOW,
  NONE
}
 

Public Member Functions

 MagicNumber ()
 Create a magic number analyzer. More...
 
Mechanism mechanism () const
 Property: The mechanism being used to find magic numbers. More...
 
std::string identify (const MemoryMap::Ptr &, rose_addr_t va) const
 Identify the magic number at the specified address. More...
 
size_t maxBytesToCheck () const
 Property: Max number of bytes to check at once. More...
 
void maxBytesToCheck (size_t n)
 Property: Max number of bytes to check at once. More...
 

Constructor & Destructor Documentation

Rose::BinaryAnalysis::MagicNumber::MagicNumber ( )
inline

Create a magic number analyzer.

Definition at line 25 of file BinaryMagic.h.

Member Function Documentation

Mechanism Rose::BinaryAnalysis::MagicNumber::mechanism ( ) const
inline

Property: The mechanism being used to find magic numbers.

Multiple machanisms are available:

  • If the libmagic library is available then that mechanism is used the the return value is FAST.
  • If libmagic is not available and this is a Unix machine, then the file(1) command is invoked on a temporary file. The return value in this case is SLOW.
  • If this is Windows and the libmagic library is not available then the return value is NONE. In this case, all calls to identify will throw a std::runtime_error.

This property is read-only.

Definition at line 44 of file BinaryMagic.h.

size_t Rose::BinaryAnalysis::MagicNumber::maxBytesToCheck ( ) const
inline

Property: Max number of bytes to check at once.

This property is the maximum number of bytes that should be passed at once to the magic-number checking funtions. The library imposes a hard-coded limit, but the user may set this to a lower value to gain speed. Trying to set this to a higher value than the hard-coded limit will result in using the hard-coded limit.

Definition at line 53 of file BinaryMagic.h.

void Rose::BinaryAnalysis::MagicNumber::maxBytesToCheck ( size_t  n)
inline

Property: Max number of bytes to check at once.

This property is the maximum number of bytes that should be passed at once to the magic-number checking funtions. The library imposes a hard-coded limit, but the user may set this to a lower value to gain speed. Trying to set this to a higher value than the hard-coded limit will result in using the hard-coded limit.

Definition at line 54 of file BinaryMagic.h.

std::string Rose::BinaryAnalysis::MagicNumber::identify ( const MemoryMap::Ptr ,
rose_addr_t  va 
) const

Identify the magic number at the specified address.


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