@@ -25,33 +25,15 @@ void __stdcall EnumerateRemoteSectionsAndModules(RC_Pointer process, EnumerateRe
2525 section.BaseAddress = memInfo.BaseAddress ;
2626 section.Size = memInfo.RegionSize ;
2727
28- switch (memInfo.Protect & 0xFF )
29- {
30- case PAGE_EXECUTE:
31- section.Protection = SectionProtection::Execute;
32- break ;
33- case PAGE_EXECUTE_READ:
34- section.Protection = SectionProtection::Execute | SectionProtection::Read;
35- break ;
36- case PAGE_EXECUTE_READWRITE:
37- case PAGE_EXECUTE_WRITECOPY:
38- section.Protection = SectionProtection::Execute | SectionProtection::Read | SectionProtection::Write;
39- break ;
40- case PAGE_NOACCESS:
41- section.Protection = SectionProtection::NoAccess;
42- break ;
43- case PAGE_READONLY:
44- section.Protection = SectionProtection::Read;
45- break ;
46- case PAGE_READWRITE:
47- case PAGE_WRITECOPY:
48- section.Protection = SectionProtection::Read | SectionProtection::Write;
49- break ;
50- }
51- if ((memInfo.Protect & PAGE_GUARD) == PAGE_GUARD)
52- {
53- section.Protection |= SectionProtection::Guard;
54- }
28+ section.Protection = SectionProtection::NoAccess;
29+ if ((memInfo.Protect & PAGE_EXECUTE) == PAGE_EXECUTE) section.Protection |= SectionProtection::Execute;
30+ if ((memInfo.Protect & PAGE_EXECUTE_READ) == PAGE_EXECUTE_READ) section.Protection |= SectionProtection::Execute | SectionProtection::Read;
31+ if ((memInfo.Protect & PAGE_EXECUTE_READWRITE) == PAGE_EXECUTE_READWRITE) section.Protection |= SectionProtection::Execute | SectionProtection::Read | SectionProtection::Write;
32+ if ((memInfo.Protect & PAGE_EXECUTE_WRITECOPY) == PAGE_EXECUTE_READWRITE) section.Protection |= SectionProtection::Execute | SectionProtection::Read | SectionProtection::CopyOnWrite;
33+ if ((memInfo.Protect & PAGE_READONLY) == PAGE_READONLY) section.Protection |= SectionProtection::Read;
34+ if ((memInfo.Protect & PAGE_READWRITE) == PAGE_READWRITE) section.Protection |= SectionProtection::Read | SectionProtection::Write;
35+ if ((memInfo.Protect & PAGE_WRITECOPY) == PAGE_WRITECOPY) section.Protection |= SectionProtection::Read | SectionProtection::CopyOnWrite;
36+ if ((memInfo.Protect & PAGE_GUARD) == PAGE_GUARD) section.Protection |= SectionProtection::Guard;
5537
5638 switch (memInfo.Type )
5739 {
0 commit comments