File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments