ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DataConverter Class Referenceabstract

Encodes and decodes a buffer using an algorithm defined in subclasses. More...

#include <DataConversion.h>

Inheritance diagram for DataConverter:

Public Member Functions

virtual ~DataConverter ()
 
virtual std::string name () const =0
 Name of the converter, mostly for debugging purposes. More...
 
virtual uint8_t * encode (uint8_t *buffer, size_t *nbytes)=0
 Encodes a buffer. More...
 
virtual uint8_t * decode (uint8_t *buffer, size_t *nbytes)=0
 Decodes a buffer. More...
 

Detailed Description

Encodes and decodes a buffer using an algorithm defined in subclasses.

These objects are used by such things as SgAsmGenericFile::parse(), where an encoded file is read into a buffer from disk and then decoded in memory. This allows ROSE to operate on malicious software while hiding the software from the operating system while it sits on disk.

Definition at line 9 of file DataConversion.h.

Constructor & Destructor Documentation

virtual DataConverter::~DataConverter ( )
inlinevirtual

Definition at line 11 of file DataConversion.h.

Member Function Documentation

virtual std::string DataConverter::name ( ) const
pure virtual

Name of the converter, mostly for debugging purposes.

Implemented in Rot13.

virtual uint8_t* DataConverter::encode ( uint8_t *  buffer,
size_t *  nbytes 
)
pure virtual

Encodes a buffer.

Encodes the supplied buffer either in place or into a newly allocated buffer. The return value is the location of the encoded data and the nbytes argument should be updated to reflect the size of the encoded data. The original buffer should not be deleted by this method.

Implemented in Rot13.

virtual uint8_t* DataConverter::decode ( uint8_t *  buffer,
size_t *  nbytes 
)
pure virtual

Decodes a buffer.

Decodes the supplied buffer either in place or into a newly allocated buffer. The return value is the location of the decoded data and the nbytes argument should be updated to reflect the size of the decoded data. The original buffer should not be deleted by this method.

Implemented in Rot13.

Referenced by SgAsmGenericFile::parse().


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