Bug with heap ?

This commit is contained in:
Adrien Bourmault 2020-01-10 13:50:29 +01:00
parent 38c0f14332
commit c6efa5c9a4
1 changed files with 5 additions and 5 deletions

View File

@ -124,27 +124,27 @@ void MmInitPaging(void)
if ((ulong)curAddrPT == (ulong)BtLoaderInfo.stackEndAddr) { if ((ulong)curAddrPT == (ulong)BtLoaderInfo.stackEndAddr) {
MmPT[index] = (ulong)curAddrPT | PRESENT; MmPT[index] = (ulong)curAddrPT | PRESENT;
MmStackGuards[0] = (ulong)curAddrPT; MmStackGuards[0] = (ulong)curAddrPT;
//DebugLog("\tStack Guard at %p\n", curAddrPT); DebugLog("\tStack Guard at %p\n", curAddrPT);
} }
else if ((ulong)curAddrPT == (ulong)BtLoaderInfo.kernelEndAddr) { else if ((ulong)curAddrPT == (ulong)BtLoaderInfo.kernelEndAddr) {
MmPT[index] = (ulong)curAddrPT | PRESENT; MmPT[index] = (ulong)curAddrPT | PRESENT;
MmStackGuards[1] = (ulong)curAddrPT; MmStackGuards[1] = (ulong)curAddrPT;
//DebugLog("\tStack Guard at %p\n", curAddrPT); DebugLog("\tStack Guard at %p\n", curAddrPT);
} }
// SECTION .TEXT PROTECTION // SECTION .TEXT PROTECTION
else if ((ulong)curAddrPT >= (ulong)&_text && (ulong)curAddrPT <= (ulong)&_text_end) { else if ((ulong)curAddrPT >= (ulong)&_text && (ulong)curAddrPT <= (ulong)&_text_end) {
MmPT[index] = (ulong)curAddrPT | PRESENT; MmPT[index] = (ulong)curAddrPT | PRESENT;
//DebugLog("\tSection .text at %p\n", curAddrPT); DebugLog("\tSection .text at %p\n", curAddrPT);
} }
// SECTION .DATA PROTECTION // SECTION .DATA PROTECTION
else if ((ulong)curAddrPT >= (ulong)&_data && (ulong)curAddrPT <= (ulong)&_data_end) { else if ((ulong)curAddrPT >= (ulong)&_data && (ulong)curAddrPT <= (ulong)&_data_end) {
MmPT[index] = (ulong)curAddrPT | PRESENT | WRITETHR | READWRITE | NX; MmPT[index] = (ulong)curAddrPT | PRESENT | WRITETHR | READWRITE | NX;
//DebugLog("\tSection .data at %p\n", curAddrPT); DebugLog("\tSection .data at %p\n", curAddrPT);
} }
// SECTION .RODATA PROTECTION // SECTION .RODATA PROTECTION
else if ((ulong)curAddrPT >= (ulong)&_rodata && (ulong)curAddrPT <= (ulong)&_rodata_end) { else if ((ulong)curAddrPT >= (ulong)&_rodata && (ulong)curAddrPT <= (ulong)&_rodata_end) {
MmPT[index] = (ulong)curAddrPT | PRESENT | WRITETHR | NX; MmPT[index] = (ulong)curAddrPT | PRESENT | WRITETHR | NX;
//DebugLog("\tSection .rodata at %p\n", curAddrPT); DebugLog("\tSection .rodata at %p\n", curAddrPT);
} }
// While we're inside the kernel pages // While we're inside the kernel pages
else if ((ulong)curAddrPT <= lastKernelAddr) { else if ((ulong)curAddrPT <= lastKernelAddr) {