Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef MAINWINDOW_H
- #define MAINWINDOW_H
- #include <QMainWindow>
- namespace Ui {
- class MainWindow;
- }
- class MainWindow : public QMainWindow
- {
- Q_OBJECT
- public:
- explicit MainWindow(QWidget *parent = 0);
- ~MainWindow();
- private slots:
- void Queud() ;
- void on_FindButton_clicked();
- protected:
- void closeEvent(QCloseEvent *e) ;
- private:
- Ui::MainWindow *ui;
- QTimer *timer ;
- };
- #endif // MAINWINDOW_H
- #ifndef SCANTHREAD_H
- #define SCANTHREAD_H
- #include <QtCore>
- class ScanThread :public QThread
- {
- public:
- ScanThread();
- void run() ;
- };
- #endif // SCANTHREAD_H
- #include "mainwindow.h"
- #include "scanthread.h"
- #include <QApplication>
- int main(int argc, char *argv[])
- {
- QApplication a(argc, argv);
- MainWindow w;
- w.show();
- /* start that thread */
- ScanThread sThread ;
- sThread.start() ;
- return a.exec();
- }
- #include "mainwindow.h"
- #include "ui_mainwindow.h"
- #include "scanthread.h"
- #include <QMessageBox>
- #include <QStorageInfo>
- #include <QDirIterator>
- #include <QFileDialog>
- #include <QTimer>
- #include <QDebug>
- #include <QtCore>
- #include <QString>
- #include <QCloseEvent>
- using namespace std ;
- QString Read_CurrentPath ;
- QString Read_Suspect ;
- QString Last_Suspect ;
- QString ThisPath ;
- QString Find_Item ;
- float LoadBar = 0 ;
- MainWindow::MainWindow(QWidget *parent) :
- QMainWindow(parent),
- ui(new Ui::MainWindow)
- {
- /* launch timer to update ui */
- timer = new QTimer(this);
- connect(timer, SIGNAL(timeout()), this, SLOT(Queud()));
- timer->start(1000);
- ui->setupUi(this);
- }
- MainWindow::~MainWindow()
- {
- delete ui;
- }
- void MainWindow::Queud()
- {
- /* looking for list state wich word is beign tested */
- QFile ReadLog_Count("ListState.temp") ;
- if(ReadLog_Count.open(QFile::ReadOnly | QFile::Text))
- {
- QTextStream in(&ReadLog_Count) ;
- in >> LoadBar ;
- //qDebug() << LoadBar ;
- }
- ReadLog_Count.flush() ;
- ReadLog_Count.close() ;
- /* looking wich current file is beign tested */
- QFile ReadLog_CurrentPath("CurrentP.temp") ;
- if(ReadLog_CurrentPath.open(QFile::ReadOnly | QFile::Text))
- {
- QTextStream in(&ReadLog_CurrentPath) ;
- Read_CurrentPath = in .readLine();
- //qDebug() << read_temp ;
- }
- ReadLog_CurrentPath.flush() ;
- ReadLog_CurrentPath.close() ;
- QFile ReadLog_VirusFound("VFound.temp") ;
- if(ReadLog_VirusFound.open(QFile::ReadOnly | QFile::Text))
- {
- QTextStream in(&ReadLog_VirusFound) ;
- Read_Suspect = in.readLine() ;
- if(Read_Suspect == Last_Suspect)
- {
- }
- else
- {
- ui->VirusView->addItem(Read_Suspect);
- }
- Last_Suspect = Read_Suspect ;
- Read_Suspect = "" ;
- }
- ReadLog_VirusFound.flush() ;
- ReadLog_VirusFound.close() ;
- LoadBar = (LoadBar / 235) * 100 ;
- if(Read_CurrentPath == "")
- {
- /* theres an error the path caint be empty */
- }
- else
- {
- /* receive the signal #1313 mean boss i finish my work */
- if(Read_CurrentPath == "#1313") //#1313 dev code to manually signal that the scans as been completed
- {
- //qDebug() << Read_CurrentPath ;
- LoadBar = 0 ;
- ui->Path_Status->setText("Scan Complete") ;
- ui->LoadBar->setValue(0) ;
- system("del VFound.temp") ;
- system("del CurrentP.temp") ;
- timer->stop() ;
- }
- else
- {
- ui->Path_Status->setText(Read_CurrentPath) ;
- }
- }
- /* update load bar as it needed */
- if(LoadBar == 0)
- {
- }
- else
- {
- ui->LoadBar->setValue(LoadBar);
- }
- /* unlock list & Find when scan is complete */
- if(Read_CurrentPath == "#1313")
- {
- ui->VirusView->setEnabled(true) ;
- ui->FindButton->setEnabled(true) ;
- }
- }
- /* close program handling */
- void MainWindow::closeEvent(QCloseEvent *e)
- {
- /* can close normally */
- if(Read_CurrentPath == "#1313")
- {
- timer->stop() ;
- e->accept() ;
- }
- /* dont close the program untill scan complete its not a --->bloatware<--- */
- else
- {
- QMessageBox MSG ;
- MSG.setText("You are about to close ,the scan is incomplete.n Leaving while the scan still running can occur errors n please wait..");
- MSG.exec() ;
- e->ignore() ;
- }
- }
- /* when clicked show the path of the "detected" virus */
- void MainWindow::on_FindButton_clicked()
- {
- Find_Item = ui->VirusView->currentItem()->text() ;
- qDebug() << " i want to find :: " + Find_Item ;
- QStorageInfo storage_name = QStorageInfo::root() ;
- QString Root_ = storage_name.rootPath() ;
- QDirIterator Find_ItemPath(Root_, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks) ;
- do
- {
- ThisPath = QString (Find_ItemPath.next()) ;
- if(ThisPath.contains(Find_Item) == true)
- {
- qDebug() << "I have Found the Path of the threat in :: " + ThisPath ;
- QMessageBox MSG ;
- MSG.setText("The Threat Path is n" + ThisPath) ;
- MSG.exec() ;
- break ;
- }
- }while(Find_ItemPath.hasNext()) ;
- }
- #include "scanthread.h"
- #include "mainwindow.h"
- #include "ui_mainwindow.h"
- #include <QDir>
- #include <QtCore>
- #include <QDebug>
- QString Root ;
- QString Path ;
- QString Match ;
- QString BlackList = ":/BlackList.txt" ;
- ScanThread::ScanThread()
- {
- }
- void ScanThread::run()
- {
- /* Getting storage name C:/ D:/ E:/ etc..*/
- QStorageInfo storage_name = QStorageInfo::root() ;
- Root = storage_name.rootPath() ;
- /* change Root for debug test to e.g C:/Users/Client/Desktop */
- QDirIterator Load_Path(Root, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks) ;
- /* scannning all file in all possible path of the principal dir */
- do
- {
- QFile Write_Path("path.temp") ;
- if(Write_Path.open(QFile::WriteOnly | QFile::Text | QFile::Append))
- {
- QTextStream out(&Write_Path) ;
- Path = QString (Load_Path.next()) ;
- qDebug() << Load_Path.fileName() ;
- out << Load_Path.fileName() << endl ;
- //qDebug() << "im looking for enviroment " << Path ;
- }
- Write_Path.flush() ;
- Write_Path.close() ;
- }while(Load_Path.hasNext()) ;
- /* setuping the scan */
- //qDebug() << "Trying to setup the scan " ;
- QFile Read_Path("path.temp") ;
- QFile Read_Blacklist(BlackList) ;
- if(Read_Path.open(QFile::ReadOnly | QFile::Text))
- {
- QTextStream in(&Read_Path) ;
- /* read path.temp(contain all file) */
- //qDebug() << "Trying to read path.temp" ;
- while(!Read_Path.atEnd())
- {
- Scan:
- Path = in.readLine() ;
- if(Path == "")
- {
- goto EndScan ;
- }
- else
- {
- /* look for path one by one */
- QFile Logs_CurrentPath("CurrentP.temp") ;
- if(Logs_CurrentPath.open(QFile::WriteOnly | QFile::Text))
- {
- QTextStream out(&Logs_CurrentPath) ;
- out << Path ;
- }
- Logs_CurrentPath.flush() ;
- Logs_CurrentPath.close() ;
- }
- /* open blacklist from ressource */
- //qDebug() << "Trying to open the blacklist " ;
- if(Read_Blacklist.open(QFile::ReadOnly | QFile::Text))
- {
- /* compare path file and words in blacklist */
- QTextStream in(&Read_Blacklist) ;
- for(int i = 0 ; i < 235 ; i ++)
- {
- Match = in.readLine() ;
- QFile Logs_ListState("ListState.temp") ;
- if(Logs_ListState.open(QFile::WriteOnly | QFile::Text))
- {
- QTextStream out(&Logs_ListState) ;
- out << i ;
- }
- Logs_ListState.flush() ;
- Logs_ListState.close() ;
- // qDebug() << "Scanning for potential threat" ;
- // qDebug() << Match ;
- // qDebug() << Path ;
- if(Path.contains(Match , Qt::CaseSensitive) == true)
- {
- /* theres a threat do something */
- //qDebug() << "Virus found in " + Path ;
- QFile Logs_VirusFound("VFound.temp") ;
- if(Logs_VirusFound.open(QFile::WriteOnly | QFile::Text))
- {
- QTextStream out(&Logs_VirusFound) ;
- out << Path ;
- //qDebug() << Path ;
- //qDebug() << Match ;
- }
- Logs_VirusFound.flush() ;
- Logs_VirusFound.close() ;
- ScanThread::sleep(1) ;
- //int pause = 20000 ;
- //for(int i = 0 ; i < pause ; i++)
- //{
- /* just make sure that the program can read it before it get overwrited */
- //qDebug() << "wait" ;
- //}
- }
- }
- }
- Read_Blacklist.flush() ;
- Read_Blacklist.close() ;
- goto Scan ;
- }
- /* end the scan once Read_Path is at end */
- if(Read_Path.atEnd())
- {
- EndScan:
- //qDebug() << "Scan Complete ";
- Read_Path.flush() ;
- Read_Path.close() ;
- QFile WriteEnd("CurrentP.temp") ;
- if(WriteEnd.open(QFile::WriteOnly | QFile::Text))
- {
- QTextStream out(&WriteEnd) ;
- out << "#1313" << endl ; //#1313 dev code to manually signal that the scans as been completed
- }
- WriteEnd.flush() ;
- WriteEnd.close() ;
- system("del path.temp") ;
- system("del ListState.temp") ;
- /* terminate thread */
- ScanThread::terminate() ;
- }
- }
- }
- <?xml version="1.0" encoding="UTF-8"?>
- <ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>659</width>
- <height>380</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>659</width>
- <height>380</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>659</width>
- <height>380</height>
- </size>
- </property>
- <property name="windowTitle">
- <string>Pinfo</string>
- </property>
- <widget class="QWidget" name="centralWidget">
- <widget class="QLabel" name="label_2">
- <property name="geometry">
- <rect>
- <x>20</x>
- <y>10</y>
- <width>71</width>
- <height>16</height>
- </rect>
- </property>
- <property name="text">
- <string>Interrogating:</string>
- </property>
- </widget>
- <widget class="QLabel" name="Path_Status">
- <property name="geometry">
- <rect>
- <x>90</x>
- <y>10</y>
- <width>551</width>
- <height>16</height>
- </rect>
- </property>
- <property name="text">
- <string>Scanning environment.....</string>
- </property>
- </widget>
- <widget class="QPushButton" name="FindButton">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="geometry">
- <rect>
- <x>290</x>
- <y>350</y>
- <width>80</width>
- <height>21</height>
- </rect>
- </property>
- <property name="text">
- <string>Find on Pc</string>
- </property>
- </widget>
- <widget class="QWidget" name="layoutWidget">
- <property name="geometry">
- <rect>
- <x>20</x>
- <y>40</y>
- <width>621</width>
- <height>301</height>
- </rect>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QProgressBar" name="LoadBar">
- <property name="value">
- <number>0</number>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QListWidget" name="VirusView">
- <property name="enabled">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </widget>
- </widget>
- <layoutdefault spacing="6" margin="11"/>
- <resources/>
- <connections/>
- </ui>
- AOM Trojan
- A97M
- Aardwolf
- Abal
- Abba
- Abbas
- Abraxas
- Absturz
- Absys
- Ache
- AcidRain
- AcidWarp
- Acula
- Acurev
- Acvt
- ADAF
- Adeni
- Adindi
- Adreim
- Adrenalin
- Adrenaline
- Adri
- ADsmile
- Worm
- ADDeliverer
- ADH
- Admagic
- AdPutHelper
- Binet
- Browext
- Cacb
- Cleanurl
- ContentDefend
- Controlthis
- ConvrtFilesFree
- Coolpp
- CouponAge
- CrimeWatch
- Cygo
- DealPly
- DriverTuneup
- DropSpam
- Ebon
- Edea
- FFinder
- Hotbar
- Iefeats
- IGetNet
- IntelliDownload
- ISearchHelpW
- ISMonitor
- KMGuide
- Kraddare
- KuwoMusic
- LampUpdate
- Lollipop
- Loudmo
- MidADdle
- Opencash
- PassShow
- Psic
- Ramdud
- Rcash
- Searchthisbiz
- SmartAllYes
- Soduisearch
- Sponsorbox
- SysAI
- Tginfo
- Toolgate
- WhistleHelp
- XPassmanager
- AdWhere
- AEP
- Aforia
- AFV
- AGA
- Agena
- Ailbone
- AIMpws
- AirCop
- Airdef
- Airwalker
- Aiwed
- Ajax
- Akill
- Alaeh
- Alaper
- Alar
- Alar
- Albania
- Albanian
- ALEV
- Alfons
- Alho
- Alicino
- Alphastrike
- Alphavirus
- ALS Kenilfe
- ALSetup
- Altx
- Jaring intended
- Aman
- Amanita
- Amoeba
- Amt
- Amuck
- Anad
- ANDR
- Andris
- Adflex
- Adload
- Bangcle
- Dumpplug
- Gaode
- GappII
- Goldeneagle
- Gonfu
- Gongxin
- Jztapp
- Kosat
- Minimob
- Mobidash
- Noiconads
- Quanzhifu
- Skypeads
- Smstracker
- Torsend
- TucySms
- Widdit
- Wifikill
- Xinyinhe
- ZZcollector
- Androide
- Andromeda
- Angera
- AnniVCS
- Annres
- Anony
- Anston
- Anthrax
- AntiArj
- Antiarj
- AntiArj
- AntiAVP
- AntiBase
- AntiBasic
- AntiCAD
- Anticheck
- Antichek
- AntiCMOS
- ANTICOM
- Antiem
- Antieta
- ANTIEXE
- Antifor
- AntiFort
- Antigus
- Antilamer
- AntiMit
- AntiMon
- AntiPascal
- Antipass
- Antipode
- AntiScan
- AntiSkol
- ANTIW
- AntiWin
- AoTaun
- Apadana
- APE
- APM
- APOC
- Apocalipse
- AppelSch
- Appelscha
- Arcobale
- ARCV
- Aref
- Areg
- Arequipa
- AreThree
- Arfav
- Argyle
- ArjDrop
- Arjworm
- Armageddon
- Armagedon
- Armen
- Armenia
- ARSON
- Arusiek
- Asahi
- ASBV
- Asch
- Asim
- Aslf
- Asmodeous
- Asmodeus
- ASMvirus
- Assassin
- Asscom
- ASStral
- Asterisk
- Astra
- AstraSYS
- Atas
- Atb
- ATB
- ATCORP
- Atenfor
- Atomant
- Atomant
- Augnight
- Aurea
- AusIH
- Auspar
- AussieBoy
- Aust
- AusTerm
- Austr
- AustralianTiny
- Autumnal
- Autur
- Avalgasil
- Avcs
- Avispa
- Avlanche
- Avvaddon
- AWME
- AWVCK
- Aximus
- Axypt
- Azatoth
- Azboo
Add Comment
Please, Sign In to add comment