This repository has been archived by the owner on May 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCPE_Minimal.hxx
76 lines (63 loc) · 1.89 KB
/
CPE_Minimal.hxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef _CPEMINIMAL
#define _CPEMINIMAL
#pragma once
#include "CPE_Shared.hxx"
#include "Compressor.hxx"
class C_CSectionMinimal
{
public:
C_CSectionMinimal( uHEX32 hRVA , uHEX32 VirtualSize , SocketBuffer &Buffer , uHEX32 hFlags )
{
m_hRVA = hRVA;
m_VirtualSize = VirtualSize;
m_Buffer = Buffer;
m_hFlags = hFlags;
}
uHEX32 GetVirtualFlags();
uHEX32 m_hFlags;
uHEX32 m_hRVA;
uHEX32 m_VirtualSize;
SocketBuffer m_Buffer;
};
class C_CPEMinimal
{
public:
C_CPEMinimal()
{
Reset();
}
~C_CPEMinimal()
{
Reset();
}
void Reset()
{
m_Sections.clear();
m_TlsCBs.clear();
m_RoutineArgs.Free();
bDLL_Main_Start.Free();
pVRemotedArguments = nullptr;
pVRoutine = nullptr;
pMainThread = nullptr;
iMachineType = iArchitecture = -1;
m_ImageSize = m_hEntryPoint = 0;
}
bool InitStaticTls( N_VirtualMemory::VirtualBuffer &VirtualBuffer , N_Process::Process *Process );
bool CopySections( N_VirtualMemory::VirtualBuffer &VirtualBuffer );
bool CallTlsCBs( N_VirtualMemory::VirtualBuffer &VirtualBuffer , N_Process::Process *pProcess );
bool CallRoutine( N_VirtualMemory::VirtualBuffer &VirtualBuffer , N_Process::Process *pProcess );
bool EndTlsCBs( N_VirtualMemory::VirtualBuffer &VirtualBuffer , N_Process::Process *pProcess );
bool FreeRoutine( N_VirtualMemory::VirtualBuffer &VirtualBuffer , N_Process::Process *pProcess );
std::vector<C_CSectionMinimal> m_Sections;
std::vector<C_CTlsCB> m_TlsCBs;
C_CStaticTls m_StaticTls;
int iMachineType , iArchitecture;
uHEX32 m_hEntryPoint;
Pointer pMainThread;
N_VirtualMemory::VirtualBuffer *pVRoutine;
N_VirtualMemory::VirtualBuffer *pVRemotedArguments;
SocketBuffer bDLL_Main_Start;
SocketBuffer m_RoutineArgs;
uHEX32 m_ImageSize;
};
#endif