* @brief InvestigateProcessWindow::UpdateNewProcess - Set the investigator to display another process. * @param detailedProcessInformation - The new process to display. */
| 125 | * @param detailedProcessInformation - The new process to display. |
| 126 | */ |
| 127 | void InvestigateProcessWindow::UpdateNewProcess(PROCESS_DETAILED_REQUEST detailedProcessInformation) |
| 128 | { |
| 129 | std::time_t processExecutionDate; |
| 130 | std::string dateString; |
| 131 | ULONG i; |
| 132 | CHAR tempBuffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME]; |
| 133 | PSYMBOL_INFO currentSymbolInformation; |
| 134 | ULONG64 offset; |
| 135 | QString stackHistoryString; |
| 136 | QString tooltip; |
| 137 | QTableWidgetItem* newWidget; |
| 138 | bool stackHistoryViolation; |
| 139 | |
| 140 | memset(tempBuffer, 0, sizeof(tempBuffer)); |
| 141 | currentSymbolInformation = RCAST<PSYMBOL_INFO>(tempBuffer); |
| 142 | currentSymbolInformation->SizeOfStruct = sizeof(SYMBOL_INFO); |
| 143 | currentSymbolInformation->MaxNameLen = MAX_SYM_NAME; |
| 144 | |
| 145 | // |
| 146 | // First, we need to convert the epoch time to a date. |
| 147 | // |
| 148 | processExecutionDate = detailedProcessInformation.EpochExecutionTime; |
| 149 | dateString = std::ctime(&processExecutionDate); |
| 150 | dateString[dateString.length()-1] = '\0'; // Remove the newline. |
| 151 | |
| 152 | this->ProcessId = detailedProcessInformation.ProcessId; |
| 153 | this->EpochExecutionTime = detailedProcessInformation.EpochExecutionTime; |
| 154 | |
| 155 | // |
| 156 | // Copy basic process information. |
| 157 | // |
| 158 | this->ui->ProcessInformationTable->setItem(0, 1, new QTableWidgetItem(QString::number(RCAST<ULONG64>(detailedProcessInformation.ProcessId)))); |
| 159 | |
| 160 | newWidget = new QTableWidgetItem(QString::fromWCharArray(detailedProcessInformation.ProcessPath)); |
| 161 | newWidget->setToolTip(QString::fromWCharArray(detailedProcessInformation.ProcessPath)); |
| 162 | this->ui->ProcessInformationTable->setItem(1, 1, newWidget); |
| 163 | |
| 164 | newWidget = new QTableWidgetItem(QString::fromWCharArray(detailedProcessInformation.ProcessCommandLine)); |
| 165 | newWidget->setToolTip(QString::fromWCharArray(detailedProcessInformation.ProcessCommandLine)); |
| 166 | this->ui->ProcessInformationTable->setItem(2, 1, newWidget); |
| 167 | |
| 168 | this->ui->ProcessInformationTable->setItem(3, 1, new QTableWidgetItem(QString::fromStdString(dateString))); |
| 169 | this->ui->ProcessInformationTable->resizeRowsToContents(); |
| 170 | |
| 171 | this->ui->ProcessInformationTable->setItem(4, 1, new QTableWidgetItem(QString::number(RCAST<ULONG64>(detailedProcessInformation.CallerProcessId)))); |
| 172 | |
| 173 | //newWidget = new QTableWidgetItem(QString::fromWCharArray(detailedProcessInformation.CallerProcessPath)); |
| 174 | //newWidget->setToolTip(QString::fromWCharArray(detailedProcessInformation.CallerProcessPath)); |
| 175 | //this->ui->ProcessInformationTable->setItem(5, 1, new QTableWidgetItem(QString::fromWCharArray(detailedProcessInformation.CallerProcessPath))); |
| 176 | |
| 177 | this->ui->ProcessInformationTable->setItem(5, 1, new QTableWidgetItem(QString::number(RCAST<ULONG64>(detailedProcessInformation.ParentProcessId)))); |
| 178 | |
| 179 | newWidget = new QTableWidgetItem(QString::fromWCharArray(detailedProcessInformation.ParentProcessPath)); |
| 180 | newWidget->setToolTip(QString::fromWCharArray(detailedProcessInformation.ParentProcessPath)); |
| 181 | this->ui->ProcessInformationTable->setItem(6, 1, new QTableWidgetItem(QString::fromWCharArray(detailedProcessInformation.ParentProcessPath))); |
| 182 | |
| 183 | this->ui->ProcessInformationTable->resizeRowsToContents(); |
| 184 |
no test coverage detected