This commit is contained in:
dmex
2018-01-07 19:24:07 +11:00
parent 5add6b7968
commit a2842ae253
4 changed files with 30 additions and 24 deletions
+6
View File
@@ -810,4 +810,10 @@ HPROPSHEETPAGE PhCreateTokenPage(
_In_opt_ DLGPROC HookProc
);
// prpggen
PPH_STRING PhGetProcessItemProtectionText(
_In_ PPH_PROCESS_ITEM ProcessItem
);
#endif
+11 -12
View File
@@ -1454,22 +1454,21 @@ VOID PhpFillProcessItem(
}
// Protection
if (ProcessItem->QueryHandle)
if (WindowsVersion >= WINDOWS_8_1 && ProcessItem->QueryHandle)
{
if (WindowsVersion >= WINDOWS_8_1)
PS_PROTECTION protection;
if (NT_SUCCESS(NtQueryInformationProcess(
ProcessItem->QueryHandle,
ProcessProtectionInformation,
&protection,
sizeof(PS_PROTECTION),
NULL
)))
{
NtQueryInformationProcess(
ProcessItem->QueryHandle,
ProcessProtectionInformation,
&ProcessItem->Protection,
sizeof(ProcessItem->Protection),
NULL);
ProcessItem->Protection.Level = protection.Level;
}
}
else
{
ProcessItem->Protection.Level = (UCHAR)-1;
}
// On Windows 8.1 and above, processes without threads are reflected processes
// which will not terminate if we have a handle open.
+5 -4
View File
@@ -2801,10 +2801,11 @@ BOOLEAN NTAPI PhpProcessTreeNewCallback(
break;
case PHPRTLC_PROTECTION:
{
extern PPH_STRING PhpFormatProcessProtection(_In_ PPH_PROCESS_ITEM ProcessItem);
PhMoveReference(&node->ProtectionText, PhpFormatProcessProtection(processItem));
getCellText->Text = node->ProtectionText->sr;
if (processItem->Protection.Level != 0)
{
PhMoveReference(&node->ProtectionText, PhGetProcessItemProtectionText(processItem));
getCellText->Text = node->ProtectionText->sr;
}
}
break;
default:
+8 -8
View File
@@ -38,11 +38,13 @@
static PWSTR ProtectedSignerStrings[] =
{ L"", L" (Authenticode)", L" (CodeGen)", L" (Antimalware)", L" (Lsa)", L" (Windows)", L" (WinTcb)", L" (WinSystem)", L" (StoreApp)" };
PPH_STRING PhpFormatProcessProtection(_In_ PPH_PROCESS_ITEM ProcessItem)
PPH_STRING PhGetProcessItemProtectionText(
_In_ PPH_PROCESS_ITEM ProcessItem
)
{
if (ProcessItem->Protection.Level != (UCHAR)-1)
if (WindowsVersion >= WINDOWS_8_1)
{
if (WindowsVersion >= WINDOWS_8_1)
if (ProcessItem->Protection.Level != 0)
{
PWSTR type;
PWSTR signer;
@@ -350,13 +352,11 @@ INT_PTR CALLBACK PhpProcessGeneralDlgProc(
SetDlgItemText(hwndDlg, IDC_PEBADDRESS, L"N/A");
PhOpenProcess(
if (NT_SUCCESS(PhOpenProcess(
&processHandle,
ProcessQueryAccess,
processItem->ProcessId
);
if (processHandle)
)))
{
PhGetProcessBasicInformation(processHandle, &basicInfo);
#ifdef _WIN64
@@ -381,7 +381,7 @@ INT_PTR CALLBACK PhpProcessGeneralDlgProc(
// Protection
SetDlgItemText(hwndDlg, IDC_PROTECTION, PH_AUTO_T(PH_STRING, PhpFormatProcessProtection(processItem))->Buffer);
SetDlgItemText(hwndDlg, IDC_PROTECTION, PH_AUTO_T(PH_STRING, PhGetProcessItemProtectionText(processItem))->Buffer);
#ifdef _WIN64
if (processItem->IsWow64Valid)