Entry 6383

CPlugin

   

Submitted by anonymous on Aug. 28, 2010 at 3:42 p.m.
Language: C++. Code size: 1.1 KB.

#ifndef INCLUDE_PLUGIN_HPP
#define INCLUDE_PLUGIN_HPP

#include <hem.h>  /* HIEW SDK */

#include <memory>
#include <vector>
#include <map>

namespace pembd {
/*----------------------------------------------------------------------------*/
class CPlugin {
public:
  CPlugin();

  bool  isInit() const;
  void  initialize();
  bool  isEmbeddedExist() const;

  HEM_QWORD getEmbeddedOffs(HEM_QWORD CurOffs, HEM_QWORD OffsMark, HEM_QWORD SizeMark);
  HEM_QWORD getEmbeddedSize(HEM_QWORD itsOffs);

private:
  bool  isPE32(HEM_BYTE * p) const;
  bool  isPE64(HEM_BYTE * p) const;
  bool  readPEHeader();
  bool  analyze();

  typedef std::vector<HEM_BYTE>         VecHemByte_t;
  typedef std::map<HEM_QWORD,HEM_QWORD> MapQwQw_t;

  VecHemByte_t  m_PEheader;
  MapQwQw_t     m_EmbMap;
  HEM_UINT      m_Filelen;
  HEM_QWORD     m_HdrEndOffs;
  bool          m_IsMode32;
};

typedef std::auto_ptr<CPlugin> PluginPtr_t;

/*----------------------------------------------------------------------------*/
} /*namespace pembd {*/
#endif /*INCLUDE_PLUGIN_HPP*/

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).