Skip to content

Commit 3e49cb6

Browse files
committed
Handle STATUS_PROCESS_IS_TERMINATING in EnumSections
VirtualQueryEx can return STATUS_PROCESS_IS_TERMINATING if the process was closed during manual map. Since this case is not handled, EnumSection enters an infinite loop.
1 parent 09294a0 commit 3e49cb6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/BlackBone/Subsystem/NativeSubsystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ size_t Native::EnumPEHeaders( listModules& result )
567567
{
568568
auto status = VirtualQueryExT( memptr, &mbi );
569569

570-
if (status == STATUS_INVALID_PARAMETER || status == STATUS_ACCESS_DENIED)
570+
if (status == STATUS_INVALID_PARAMETER || status == STATUS_ACCESS_DENIED || status == STATUS_PROCESS_IS_TERMINATING)
571571
break;
572572
else if (status != STATUS_SUCCESS)
573573
continue;

0 commit comments

Comments
 (0)