Skip to content

Commit 59e06ca

Browse files
committed
Fixed some code formatting
1 parent 9e9fd2a commit 59e06ca

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

MemoryModule/MemoryModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ NTSTATUS MemoryLoadLibrary(
248248
nullptr,
249249
old_header->OptionalHeader.SizeOfImage,
250250
MEM_RESERVE,
251-
PAGE_READWRITE
251+
PAGE_EXECUTE_READWRITE
252252
);
253253
if (!base) status = STATUS_NO_MEMORY;
254254
}

MemoryModule/MmpTls.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -540,13 +540,14 @@ NTSTATUS NTAPI HookNtSetInformationProcess(
540540
TlsLength
541541
);
542542

543+
if (!NT_SUCCESS(status))break;
544+
543545
//
544546
// Modify our mapping
545547
//
546548
EnterCriticalSection(&MmpGlobalDataPtr->MmpTls->MmpTlspLock);
547549
for (ULONG i = 0; i < Tls->ThreadDataCount; ++i) {
548-
549-
bool found = false;
550+
BOOL found = FALSE;
550551
PLIST_ENTRY entry = MmpGlobalDataPtr->MmpTls->MmpThreadLocalStoragePointer.Flink;
551552

552553
// Find thread-spec tlsp
@@ -556,10 +557,7 @@ NTSTATUS NTAPI HookNtSetInformationProcess(
556557

557558
if (ProcessTlsInformation->OperationType == ProcessTlsReplaceVector) {
558559
if (j->TlspMmpBlock[ProcessTlsInformation->TlsVectorLength] == ProcessTlsInformation->ThreadData[i].TlsVector[ProcessTlsInformation->TlsVectorLength]) {
559-
found = true;
560-
561-
//auto tlsp = CONTAINING_RECORD(ProcessTlsInformation->ThreadData[i].TlsVector, TLS_VECTOR, TLS_VECTOR::ModuleTlsData);
562-
//assert(tlsp->Length >= ProcessTlsInformation->TlsVectorLength);
560+
found = TRUE;
563561

564562
// Copy old data to new pointer
565563
RtlCopyMemory(
@@ -577,7 +575,7 @@ NTSTATUS NTAPI HookNtSetInformationProcess(
577575
}
578576
else {
579577
if (j->TlspMmpBlock[ProcessTlsInformation->TlsIndex] == ProcessTlsInformation->ThreadData[i].TlsModulePointer) {
580-
found = true;
578+
found = TRUE;
581579

582580
if (ProcessHandle) {
583581
j->TlspLdrBlock[ProcessTlsInformation->TlsIndex] = ProcessTlsInformation->ThreadData[i].TlsModulePointer;

0 commit comments

Comments
 (0)