Files
hasherezade-bearparser/parser/MappedExe.h
T
2014-08-23 18:18:11 +02:00

42 lines
944 B
C++

#pragma once
#include <map>
#include "Executable.h"
#include "ExeElementWrapper.h"
class ExeWrappersContainer
{
public:
enum WRAPPERS {
WR_NONE = (-1),
COUNT_WRAPPERS
};
ExeWrappersContainer() { }
virtual ~ExeWrappersContainer(void) { clearWrappers(); }
virtual ExeElementWrapper* getWrapper(int wrapperId);
size_t wrappersCount() { return wrappers.size(); }
QString getWrapperName(int id);
protected:
virtual void wrap(AbstractByteBuffer *v_buf) = 0;
void clearWrappers();
std::map<int, ExeElementWrapper*> wrappers;
};
class MappedExe : public Executable, public ExeWrappersContainer {
public:
virtual void wrap() { return wrap(this->buf); }
protected:
MappedExe(AbstractByteBuffer *v_buf, exe_bits v_bitMode)
: Executable(v_buf, v_bitMode), ExeWrappersContainer() { }
virtual ~MappedExe(void) { }
virtual void wrap(AbstractByteBuffer *v_buf) = 0;
};