⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sectionimport.h

📁 一个用BCB写的壳!
💻 H
字号:
#ifndef sectionimport_h
#define sectionimport_h

#include "stdafx.h"
#include "section.h"
#include "PortableExecutable.h"

namespace PE {

class CSectionImport
{
public: // Definitions
    // For DLL names list
    typedef std::list<LPSTR> strList;
    typedef std::list<LPSTR>::iterator strIterator;

    typedef struct _IMPORT_ENTRY {
        union {
            char *pName;
            WORD wOrdinal;
        } Type;
        WORD wHint;
        strIterator dll;
        BOOL flIsOrdinal; // Needed because we don't know Ordinal base
    } IMPORT_ENTRY;

    typedef std::list<IMPORT_ENTRY> impList;
    typedef std::list<IMPORT_ENTRY>::iterator impIterator;

    typedef std::list<IMAGE_IMPORT_DESCRIPTOR> impDescList;
    typedef std::list<IMAGE_IMPORT_DESCRIPTOR>::iterator impDescIterator;
    
public:
    CSectionImport(void);
    virtual ~CSectionImport(void);

    // CSection delegates
    void SetHeader(IMAGE_SECTION_HEADER &hdrNew);
    BOOL WithinRVA(DWORD dwRVA) const;
    BOOL WithinFO(DWORD dwFO) const;
    void GetHeader(IMAGE_SECTION_HEADER &hdr) const;
    DWORD GetData(LPBYTE pData) const;

    void Copy(void);
    void Attach(CPortableExecutable *ppe, LPSTR pSectionName);
    void Update(void);
    void Add(LPSTR pDLLName, LPSTR pFuncName, WORD wHint = 0);
    void Add(LPSTR pDLLName, WORD wOrdinal, WORD wHint = 0);

protected:
    // Cleanup
    void Cleanup(void);
    // Insert a DLL to the list
    strIterator InsertDLL(LPSTR pDLLName);
    // Get total DLL names length
    DWORD GetTotalDLLNamesLength(void);
    // Get number of functions for a specific DLL
    DWORD GetNumFuncs(strIterator si);

    // Attached section
    CSection *m_pAttached;
    // Attached PE
    CPortableExecutable *m_ppe;
    // Existing import descriptors list
    impDescList m_lstExisting;
    // Added DLL names list
    strList m_lstDLLs;
    // Imports list (added)
    impList m_lstImports;
};

}
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -