| 1 | #cxx . . $ `<file>/ProcessList.cpp`/include "ProcessList.h"cxx . . $ `<file>/ProcessList.h`/ |
| 2 | |
| 3 | #include <QMessageBox> |
| 4 | #include <QSettings> |
| 5 | #include <QDir> |
| 6 | #include <QStandardPaths> |
| 7 | |
| 8 | #include <stdlib.h> |
| 9 | #include <stdio.h> |
| 10 | #include <unistd.h> |
| 11 | |
| 12 | #if defined(Q_OS_LINUXcxx . . $ `<external>/5130987379601705141/qsystemdetection.h:150:11`!) || defined(Q_OS_UNIXcxx . . $ `<external>/5130987379601705141/qsystemdetection.h:201:11`!) |
| 13 | #include <signal.h> |
| 14 | #include <sys/wait.h> |
| 15 | #endif |
| 16 | |
| 17 | #if defined(Q_OS_WIN) |
| 18 | #include <windows.h> |
| 19 | #include <psapi.h> |
| 20 | #endif |
| 21 | |
| 22 | #include <QDebug> |
| 23 | |
| 24 | ProcessListcxx . . $ ProcessList#::ProcessListcxx . . $ ProcessList#ProcessList(49f6e7a06ebc5aa8).(){ |
| 25 | |
| 26 | } |
| 27 | |
| 28 | void ProcessListcxx . . $ ProcessList#::killProcesscxx . . $ ProcessList#killProcess(7df51288a9ebd664).(QStringcxx . . $ QString# pid){ |
| 29 | |
| 30 | if (pid==cxx . . $ QString#`operator==`(7d4bdb1abc417636)."" or pid.toIntcxx . . $ QString#toInt(d7972accae11ee1f).()==0){ |
| 31 | QMessageBoxcxx . . $ QMessageBox#::criticalcxx . . $ QMessageBox#critical(a9e3742e6f7b4147).(nullptr,"KillProcess"cxx . . $ QString#QString(85c52e162fed56f9).,QObjectcxx . . $ QObject#::trcxx . . $ QObject#tr(75d9f1c324b4579d).("You cannot kill this process")); |
| 32 | return; |
| 33 | } |
| 34 | |
| 35 | #if defined(Q_OS_LINUXcxx . . $ `<external>/5130987379601705141/qsystemdetection.h:150:11`!) || defined(Q_OS_UNIXcxx . . $ `<external>/5130987379601705141/qsystemdetection.h:201:11`!) |
| 36 | if (kill(pid.toIntcxx . . $ QString#toInt(d7972accae11ee1f).(),SIGTERMcxx . . $ `<external>/11773118241360591791/signum-generic.h:53:9`!)){ |
| 37 | QMessageBoxcxx . . $ QMessageBox#::criticalcxx . . $ QMessageBox#critical(a9e3742e6f7b4147).(nullptr,"KillProcess"cxx . . $ QString#QString(85c52e162fed56f9).,QObjectcxx . . $ QObject#::trcxx . . $ QObject#tr(75d9f1c324b4579d).("Killing of process was not successful")); |
| 38 | } |
| 39 | #elif defined(Q_OS_WIN) |
| 40 | HANDLE tmpHandle = OpenProcess(PROCESS_ALL_ACCESS, TRUE, pid.toInt()); |
| 41 | if (NULL != tmpHandle){ |
| 42 | TerminateProcess(tmpHandle, 0); |
| 43 | } |
| 44 | #else |
| 45 | QMessageBox::critical(nullptr,"KillProcess",QObject::tr("Your OS does not support killProcess")); |
| 46 | #endif |
| 47 | |
| 48 | } |
| 49 | |
| 50 | |
| 51 | void ProcessListcxx . . $ ProcessList#::closeConnectioncxx . . $ ProcessList#closeConnection(3458fe3960d5051).(QStringcxx . . $ QString# from, QStringcxx . . $ QString# to){ |
| 52 | QSettingscxx . . $ QSettings# confcxx . . $ QSettings#QSettings(3a5f799f337fd20b).(QStandardPathscxx . . $ QStandardPaths#::writableLocationcxx . . $ QStandardPaths#writableLocation(7d8b34fbb6a9c1bf).(QStandardPathscxx . . $ QStandardPaths#::AppConfigLocationcxx . . $ QStandardPaths#AppConfigLocation.)+cxx . . $ operator+(3d22f08efddf8107)."/qnetstatview.ini", QSettingscxx . . $ QSettings#::IniFormatcxx . . $ QSettings#IniFormat.); |
| 53 | conf.setPathcxx . . $ QSettings#setPath(72db19683e712bc4).(QSettingscxx . . $ QSettings#::IniFormatcxx . . $ QSettings#IniFormat., QSettingscxx . . $ QSettings#::UserScopecxx . . $ QSettings#UserScope., QDircxx . . $ QDir#::currentPathcxx . . $ QDir#currentPath(4365c3963150523e).()); |
| 54 | |
| 55 | QStringcxx . . $ QString# utiliteProcKill=conf.valuecxx . . $ QSettings#value(12a1b1749da49362).("setup/prockill"cxx . . $ QString#QString(85c52e162fed56f9).,""cxx . . $ QVariant#QVariant(85c52e162fed56f9).).toStringcxx . . $ QVariant#toString(6ef7b6c27b00b43d).(); |
| 56 | |
| 57 | if (utiliteProcKill==cxx . . $ QString#`operator==`(7d4bdb1abc417636).""){ |
| 58 | QMessageBoxcxx . . $ QMessageBox#::criticalcxx . . $ QMessageBox#critical(a9e3742e6f7b4147).(nullptr,"closeConnection"cxx . . $ QString#QString(85c52e162fed56f9).,QObjectcxx . . $ QObject#::trcxx . . $ QObject#tr(75d9f1c324b4579d).("set utilities for kill connections")); |
| 59 | }else{ |
| 60 | QStringListcxx . . $ QStringList# fromList = from.splitcxx . . $ QString#split(c8b44a97dcb6200d).(":"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 61 | QStringListcxx . . $ QStringList# toList = to.splitcxx . . $ QString#split(c8b44a97dcb6200d).(":"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 62 | |
| 63 | utiliteProcKill.replacecxx . . $ QString#replace(192e628656427d1c).("%LOCAL_IP%"cxx . . $ QString#QString(85c52e162fed56f9).,fromList.atcxx . . $ QList#at(e2681f9bb6b2f357).(0)); |
| 64 | utiliteProcKill.replacecxx . . $ QString#replace(192e628656427d1c).("%LOCAL_PORT%"cxx . . $ QString#QString(85c52e162fed56f9).,fromList.atcxx . . $ QList#at(e2681f9bb6b2f357).(1)); |
| 65 | utiliteProcKill.replacecxx . . $ QString#replace(192e628656427d1c).("%REMOTE_IP%"cxx . . $ QString#QString(85c52e162fed56f9).,toList.atcxx . . $ QList#at(e2681f9bb6b2f357).(0)); |
| 66 | utiliteProcKill.replacecxx . . $ QString#replace(192e628656427d1c).("%REMOTE_PORT%"cxx . . $ QString#QString(85c52e162fed56f9).,toList.atcxx . . $ QList#at(e2681f9bb6b2f357).(1)); |
| 67 | |
| 68 | system(utiliteProcKill.toStdStringcxx . . $ QString#toStdString(219584694fe2b248).().c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).()); |
| 69 | } |
| 70 | |
| 71 | } |