MCPcopy Create free account
hub / github.com/NtQuery/Scylla / getMemoryProtectionString

Method getMemoryProtectionString

Scylla/DumpMemoryGui.cpp:156–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156WCHAR * DumpMemoryGui::getMemoryProtectionString(DWORD value)
157{
158 protectionString[0] = 0;
159
160 if (value & PAGE_GUARD)
161 {
162 wcscpy_s(protectionString, MemoryProtectionValues[PROT_GUARD]);
163 wcscat_s(protectionString, L" | ");
164 value ^= PAGE_GUARD;
165 }
166 if (value & PAGE_NOCACHE)
167 {
168 wcscpy_s(protectionString, MemoryProtectionValues[PROT_NOCACHE]);
169 wcscat_s(protectionString, L" | ");
170 value ^= PAGE_NOCACHE;
171 }
172 if (value & PAGE_WRITECOMBINE)
173 {
174 wcscpy_s(protectionString, MemoryProtectionValues[PROT_WRITECOMBINE]);
175 wcscat_s(protectionString, L" | ");
176 value ^= PAGE_WRITECOMBINE;
177 }
178
179 switch(value)
180 {
181 case PAGE_EXECUTE:
182 {
183 wcscat_s(protectionString, MemoryProtectionValues[PROT_EXECUTE]);
184 break;
185 }
186 case PAGE_EXECUTE_READ:
187 {
188 wcscat_s(protectionString, MemoryProtectionValues[PROT_EXECUTE_READ]);
189 break;
190 }
191 case PAGE_EXECUTE_READWRITE:
192 {
193 wcscat_s(protectionString, MemoryProtectionValues[PROT_EXECUTE_READWRITE]);
194 break;
195 }
196 case PAGE_EXECUTE_WRITECOPY:
197 {
198 wcscat_s(protectionString, MemoryProtectionValues[PROT_EXECUTE_WRITECOPY]);
199 break;
200 }
201 case PAGE_NOACCESS:
202 {
203 wcscat_s(protectionString, MemoryProtectionValues[PROT_NOACCESS]);
204 break;
205 }
206 case PAGE_READONLY:
207 {
208 wcscat_s(protectionString, MemoryProtectionValues[PROT_READONLY]);
209 break;
210 }
211 case PAGE_READWRITE:
212 {
213 wcscat_s(protectionString, MemoryProtectionValues[PROT_READWRITE]);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected