├── AVEngine_AsyncRPC ├── AVEngine_AsyncRPC.Acf ├── AVEngine_AsyncRPC.Idl ├── AVEngine_AsyncRPC_c.c ├── AVEngine_AsyncRPC_h.h └── AVEngine_AsyncRPC_s.c ├── BaseObjects ├── BaseObject.h ├── BaseString.h ├── JFile.cpp ├── JFile.h ├── Logger.cpp ├── Msg.cpp └── Msg.h ├── CommpersEnumator ├── CompFile.cpp └── IUnCompersser.h ├── CrcMatch ├── Crc.cpp ├── crc.h ├── crc64.cpp ├── crc64_init.cpp ├── crc64_table.c └── crc_macros.h ├── Cryption ├── C Version │ ├── JDecryptedFile.c │ └── JDecryptedFile.h └── C++ Version │ ├── JDecryptedFile.cpp │ └── JDecryptedFile.h ├── FileIoByDevice ├── FileIoByDevice.cpp ├── FileIoByDevice.h └── mountmgr.h ├── FileSystemEnumator ├── FileSystemEnumerator.cpp ├── FileSystemEnumerator.h ├── JFindFile.cpp └── JFindFile.h ├── FileType ├── FileInf.cpp └── FileInf.h ├── Guard ├── All_Defines.h ├── AvlTree.c ├── BinaryTranslate.c ├── BinaryTranslate.h ├── CPU.c ├── CPU.h ├── DatFileEnumator.c ├── DatFileEnumator.h ├── DatFileLoader.c ├── DatFileLoader.h ├── DatFileStruct.h ├── DebugHeader.c ├── FastIo.c ├── FastIo.h ├── FileApiBYIRP.c ├── FileApiBYIRP.h ├── FileInformation.c ├── FileInformation.h ├── FileIoStruct.h ├── FilterDispatch.c ├── FilterDispatch.h ├── Header.c ├── Header.h ├── Hook.c ├── IFunc.c ├── IFunc.h ├── IOCTL.h ├── IoMonitor.sln ├── IoMonitor.suo ├── IoMonitor.vcxproj ├── IoMonitor.vcxproj.filters ├── IoMonitor.vcxproj.user ├── JDecryptedFile.c ├── JDecryptedFile.h ├── LoadDatFile.c ├── LoadDatFile.h ├── Log.c ├── Log.h ├── Mem.c ├── Mem.h ├── MemoryTree.c ├── MemoryTree.h ├── OperationsFunctions.c ├── OperationsFunctions.h ├── OwnDispatch.c ├── OwnDispatch.h ├── PatMatchUtility.c ├── PatMatchUtility.h ├── SMBuffer.c ├── SMBuffer.h ├── SMFile.c ├── SMFile.h ├── SMTypeDefine.h ├── SOURCES ├── SbScaner.c ├── SbScaner.h ├── ScanImp.c ├── ScanImp.h ├── StateMachine.c ├── StateMachine.h ├── VirtualMachine.c ├── VirtualMachine.h ├── avltree.h ├── buildchk_wxp_x86.log ├── ddkbuild.bat ├── ddkbuild.bat1 ├── empty.c ├── hook.h ├── iomonitor.c └── iomonitor.h ├── Gui ├── Folder-Default-icon.png ├── Orginal1.png ├── Orginal2.png ├── Orginal3.png ├── Orginal4.png ├── Orginal5.png ├── Orginal6.png ├── Orginal7.png ├── Orginal8.png ├── Orginal9.png ├── Scan.pro ├── Scan.sln ├── Scan.suo ├── Scan.vcxproj ├── Scan.vcxproj.filters ├── Scan.vcxproj.user ├── aboutus.cpp ├── aboutus.h ├── aboutus.ui ├── arrow-left-icon.png ├── arrow-right-icon.png ├── business │ ├── AsyncRPCc.cpp │ └── AsyncRPCc.h ├── detail.png ├── down-icon.png ├── extendedfilesystem.cpp ├── extendedfilesystem.h ├── gear_wheel.png ├── header.png ├── help.png ├── help_icon.jpg ├── jsScan.js ├── linllabel.cpp ├── linllabel.h ├── main.cpp ├── main.h ├── next.png ├── pathselect.cpp ├── pathselect.h ├── pathselect.ui ├── reportofscan_dialog.cpp ├── reportofscan_dialog.h ├── reportofscan_dialog.ui ├── resource.h ├── resource1.h ├── scan.cpp ├── scan.h ├── scan.ui ├── scanprogess.cpp ├── scanprogess.h ├── scanprogess.ui ├── search.png ├── setting.cpp ├── setting.h ├── setting.ui ├── settingLabel.png ├── sorce.qrc ├── stop.ico ├── treemodelConfig.txt ├── ui_aboutus.h ├── ui_pathselect.h ├── ui_reportofscan_dialog.h ├── ui_scan.h └── ui_setting.h ├── JAVEnumator ├── JEnumerator.cpp ├── JEnumerator.h ├── JFileStreamEnumerator2.cpp └── JFileStreamEnumerator2.h ├── JBuffer ├── JBuffer.cpp └── JBuffer.h ├── JFilewraper ├── JCompressfile.cpp └── JCompressfile.h ├── LICENSE ├── LoadSbDatFile ├── DatFileStruct.h ├── SMTypeDefine.h ├── loadDatFile.cpp └── loadDatFile.h ├── Logger ├── JMessage.h ├── JMessage.mc ├── Logger.vcproj └── complie.bat ├── Md5 ├── md5.cpp └── md5.h ├── ModuleEnumerator ├── JModuleEnumetor.cpp ├── JModuleEnumetor.h └── killer.cpp ├── Quarantine ├── SMQuarantine.cpp └── SMQuarantine.h ├── README.md ├── SbScaner ├── SbScaner.cpp └── SbScaner.h ├── ServiceManager ├── AVEngine.cpp ├── AVEngine.h ├── AVEngine_AsyncRPC_Impl.cpp ├── ImpService.cpp ├── ImpService.h ├── SafavaServiceProcess.cpp ├── SafavaServiceProcess.h ├── SafavaServiceProcessManager.cpp ├── SafavaServiceProcessManager.h ├── Service.cpp ├── Service.h ├── ServiceManager.cpp ├── ServiceManager.sln ├── ServiceManager.suo ├── ServiceManager.vcproj ├── ServiceManager.vcxproj ├── ServiceManager.vcxproj.filters ├── ServiceManager.vcxproj.user ├── ServiceProcessConfig.cpp ├── ServiceProcessConfig.h ├── UpgradeLog.XML └── sample.h ├── SetDetector ├── PatMatchUtility.cpp ├── PatMatchUtility.h ├── SetDetector.cpp └── SetDetector.h ├── Signer-build-desktop ├── Makefile ├── Makefile.Debug ├── Makefile.Release ├── ui_DbTofile1.h ├── ui_NumberPrompt.h ├── ui_Report.h ├── ui_SelectDatFile.h ├── ui_dialog.h └── ui_mainwindow.h ├── Signer ├── CheckSumDelegete.cpp ├── CheckSumDelegete.h ├── CompareEngineThread.cpp ├── CompareEngineThread.h ├── DbTofile1.ui ├── DbTofileThread.cpp ├── DbTofileThread.h ├── DlgComapreEngine.cpp ├── DlgComapreEngine.h ├── DlgDbtoFile1.cpp ├── DlgDbtoFile1.h ├── DlgGetPattern.cpp ├── DlgGetPattern.h ├── DlgGetPatternFileInfo.cpp ├── DlgGetPatternFileInfo.h ├── DlgInputNum.cpp ├── DlgInputNum.h ├── DlgReport.cpp ├── DlgReport.h ├── DlgSelectDatFile.cpp ├── DlgSelectDatFile.h ├── DlgSetView.cpp ├── DlgSetView.h ├── EnumGetPatternThread.cpp ├── EnumGetPatternThread.h ├── GetPattern.ui ├── GetPtarrenFileInfo.ui ├── HexEditorDelegate.cpp ├── HexEditorDelegate.h ├── NumberPrompt.ui ├── QCheckSumModel.cpp ├── QCheckSumModel.h ├── QComboBoxEx.cpp ├── QComboBoxEx.h ├── QCompareEngineModel.cpp ├── QCompareEngineModel.h ├── QGetPatternFileInfoModel.cpp ├── QGetPatternFileInfoModel.h ├── QGetPatternModel.cpp ├── QGetPatternModel.h ├── QHexEditEx.cpp ├── QHexEditEx.h ├── QPatternModel.cpp ├── QPatternModel.h ├── QShowVirus.cpp ├── QShowVirus.h ├── Report.ui ├── SelectDatFile.ui ├── Signer.pro ├── Signer.pro.user ├── dialog.ui ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h ├── mainwindow.ui ├── rotate360anticlockwise2red.png ├── setmodel.cpp ├── setmodel.h ├── ui_DbTofile1.h ├── ui_GetPattern.h ├── ui_GetPtarrenFileInfo.h ├── ui_NumberPrompt.h ├── ui_Report.h ├── ui_SelectDatFile.h ├── ui_dialog.h └── ui_mainwindow.h ├── TestRar ├── Unrar.cpp └── Unrar.h ├── TestZip ├── JZipEnumerator.cpp ├── JZipEnumerator.h ├── SMSubZipEnumator.cpp └── SMSubZipEnumator.h └── dbtofile ├── DbToFile.cpp └── DbToFile.h /AVEngine_AsyncRPC/AVEngine_AsyncRPC.Acf: -------------------------------------------------------------------------------- 1 | interface AVEngine_AsyncRPC 2 | { 3 | [async] AsyncStartScan(); 4 | [async] AsyncStopScan(); 5 | [async] AsyncSaveAndExit(); 6 | [async] AsyncGetStatusMessage(); 7 | [async] AsyncGetNextMessageScan(); 8 | [async] AsyncStartQuarantine(); 9 | [async] AsyncGetQuarantineCount(); 10 | [async] AsyncMoveFileToQuarantine(); 11 | [async] AsyncGetQuarantinedFileInfo(); 12 | [async] AsyncRemoveFileFromQuarantine(); 13 | [async] AsyncRestore(); 14 | } -------------------------------------------------------------------------------- /BaseObjects/BaseString.h: -------------------------------------------------------------------------------- 1 | #ifndef BASESTRING_H 2 | #define BASESTRING_H 3 | #ifdef UNICODE 4 | #include 5 | #define TCHAR wchar_t 6 | #define _tcscpy wcscpy 7 | #define _tcscat wcscat 8 | #define _tcsstr wcsstr 9 | #define _tcsrchr wcsrchr 10 | #define _tcsncpy wcsncpy 11 | #define _tcsncat wcsncat 12 | #define _tcslen wcslen 13 | #define _tcsupr _wcsupr 14 | #define _istalpha iswalpha 15 | #define _tcsncicmp _wcsnicmp 16 | #define _stprintf swprintf 17 | #define _itoat _itow 18 | #define _T(x) L ## x 19 | #define _TEXT(x) _T(x) 20 | #else 21 | #include 22 | #define _T(x) x 23 | #define _TEXT(x) x 24 | #define TCHAR char 25 | #define _tcsstr strstr 26 | #define _tcscpy strcpy 27 | #define _tcscat strcat 28 | #define _tcsrchr strrchr 29 | #define _tcsncpy strncpy 30 | #define _tcsncat strncat 31 | #define _tcslen strlen 32 | #define _tcsupr _strupr 33 | #define _istalpha isalpha 34 | #define _tcsncicmp _strnicmp 35 | #define _stprintf sprintf 36 | #define _itoat _itoa 37 | #endif 38 | 39 | 40 | 41 | #endif // BASESTRING_H 42 | -------------------------------------------------------------------------------- /BaseObjects/JFile.h: -------------------------------------------------------------------------------- 1 | #ifndef __JFILE__ 2 | #define __JFILE__ 3 | #include "BaseObject.h" 4 | class JFile : public BaseObject 5 | { 6 | 7 | public : 8 | JFile &operator=( JFile &other ) ; 9 | typedef enum __MoveMethod__ { FBEGIN = FILE_BEGIN, FCURRENT = FILE_CURRENT , FEND = FILE_END } MoveMethod ; 10 | typedef enum __DirctoryFile__ {FDIRERROR , FISDir , FISFILE } DirctoryFile ; 11 | typedef struct __FileAttrib__ 12 | { 13 | UINT16 FARCHIVE : 1; 14 | UINT16 FCOMPRESSED : 1 ; 15 | UINT16 FDEVICE :1 ; 16 | UINT16 FDIRECTORY : 1 ; 17 | UINT16 FENCRYPTED : 1 ; 18 | UINT16 FHIDDEN :1 ; 19 | UINT16 FNORMAL : 1 ; 20 | UINT16 FREADONLY : 1 ; 21 | UINT16 FNODETECTATTRIB : 1 ; 22 | } FileAttrib ; 23 | JFile(); 24 | virtual ~JFile(); 25 | virtual void SetFileAsVirus(){} 26 | virtual void SetFileAsWorm(){} 27 | virtual BOOLEAN CloseHandle(){ return Close(); } 28 | //BOOLEAN Open(JString &Name,BOOLEAN OpenShared=FALSE,BOOLEAN Update=FALSE , BOOLEAN bTruncate = FALSE); 29 | BOOLEAN Open(JString &Name); // for rapid call 30 | BOOLEAN Open(JString &Name,BOOLEAN OpenShared); 31 | BOOLEAN Open(JString &Name,BOOLEAN OpenShared,BOOLEAN Update); 32 | BOOLEAN Open(JString &Name,BOOLEAN OpenShared ,BOOLEAN Update , BOOLEAN bTruncate); 33 | 34 | BOOLEAN CreateFile(JString &Name,BOOLEAN OpenShared,BOOLEAN Update=FALSE ,BOOLEAN OpenIfExist = FALSE ); 35 | virtual BOOLEAN Close(); 36 | void Flush(); 37 | BOOLEAN Delete(); 38 | BOOLEAN Rename(JString &NewName); 39 | BOOLEAN Write(const void *Data,size_t &Size); 40 | BOOLEAN Read(void *Data,size_t &Size); 41 | BOOLEAN Read(void *Data,DWORD &Size); 42 | BOOLEAN Seek(INT64 &Offset,MoveMethod Method); 43 | BOOLEAN Seek(UINT &Offset,MoveMethod Method); 44 | BOOLEAN GetFilePosition (UINT64 &Offset); 45 | BOOLEAN GetByte(BYTE &InByte); 46 | void PutByte(BYTE Byte); 47 | BOOLEAN Truncate(); 48 | BOOLEAN GetMd5(UINT8 o_arru8Md5[16]) ; 49 | UINT64 GetFileLength(); 50 | JString GetName(); 51 | virtual JString GetDisplayName(); 52 | 53 | /* TCHAR* GetCurrentFileNameinZip(){ return NULL;}*/ 54 | JString GetJustName() 55 | { 56 | UINT32 Index = m_strFileName.find_last_of(L"\\", m_strFileName.length()); 57 | return m_strFileName.substr(Index + 1) ; 58 | } 59 | FileHandle GetHandle() ; 60 | virtual void GetShortName(JString &o_strShortPath , UINT32 MaxLenght) ; 61 | static BOOLEAN Delete(JString &Name); 62 | static FileAttrib GetFileAttrib(JString &i_strFileName); 63 | static DirctoryFile GetPathType (const wchar_t * i_strFileName); 64 | static UINT64 GetFileLength (JString &Name); 65 | template static BOOLEAN GetTempFile( FileTemplate *&TempFile, TCHAR *Prfix ); 66 | protected : 67 | __inline BOOLEAN JCreateFile(JString &Name,BOOLEAN OpenShared,BOOLEAN Update , BOOLEAN OpenOrCreatec , BOOLEAN bOpenTrunc ) ; 68 | FileHandle hFile ; 69 | BOOLEAN m_bIsAlreadyOpenFile ; 70 | JString m_strFileName ; 71 | BOOLEAN bFileSizeIsValid; 72 | UINT64 u64FileSize ; 73 | }; 74 | 75 | template 76 | BOOLEAN JFile::GetTempFile( FileTemplate *&TempFile, TCHAR *Prfix ) 77 | { 78 | DWORD SizeNeme = MAX_PATH ; 79 | TCHAR TempPath[MAX_PATH] , TempFileName[MAX_PATH] ; 80 | 81 | 82 | SizeNeme = GetTempPath( SizeNeme , TempPath); 83 | if (SizeNeme == 0 ) 84 | { 85 | return FALSE ; 86 | } 87 | SizeNeme = GetTempFileName(TempPath ,Prfix ,0 , TempFileName ) ; 88 | if (SizeNeme == 0 ) 89 | { 90 | return FALSE ; 91 | } 92 | TempFile = new FileTemplate() ; 93 | if (TempFile == NULL) 94 | { 95 | return FALSE ; 96 | } 97 | JString Name(TempFileName) ; 98 | #ifdef JFILEKERNEL 99 | return TempFile->OpenTempFile(Name); 100 | #else 101 | return TempFile->Open(Name, FALSE , TRUE ) ; 102 | #endif 103 | 104 | } 105 | 106 | #endif -------------------------------------------------------------------------------- /BaseObjects/Logger.cpp: -------------------------------------------------------------------------------- 1 | #include "BaseObject.h" 2 | #include "JFile.h" 3 | #ifdef _LOGEE 4 | 5 | #if LogLevel == 1 6 | static void ReportMessage (TCHAR *Message) ; 7 | void Logger (DWORD MessageId , TCHAR *File , int Line ) 8 | { 9 | TCHAR strOwnMessage [200] ,strSystemMessage [200] , LogTemp[1024] ; 10 | DWORD dwLastError = GetLastError() ; 11 | if ( FormatMessage (FORMAT_MESSAGE_FROM_HMODULE , NULL , MessageId , 12 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT) ,strOwnMessage , sizeof (strOwnMessage) , NULL ) == 0 ) 13 | { 14 | DWORD dwLastError = GetLastError() ; 15 | return; 16 | } 17 | 18 | if ( FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM , NULL , dwLastError , 19 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT) ,strSystemMessage , sizeof (strSystemMessage) , NULL ) == 0 ) 20 | { 21 | DWORD dwLastError = GetLastError() ; 22 | return; 23 | } 24 | wsprintf ( LogTemp , _T("%wsLast Error : %wsFile : %ws \r\n Line : %d \r\n") , strOwnMessage ,strSystemMessage , File , Line ); 25 | ReportMessage(LogTemp) ; 26 | } 27 | void ReportMessage (TCHAR *Message) 28 | { 29 | #ifdef LogToFile 30 | JFile ocReportFile ; 31 | INT64 n64SeekParameter ; 32 | size_t stMessageLen ; 33 | if ( ocReportFile.CreateFile(JString(LogFile),TRUE ,TRUE , FALSE )==TRUE) 34 | { 35 | if ( ocReportFile.GetFileLength() < 1) 36 | { 37 | UINT8 u8Unicode [] = {0xFF,0xFE} ; 38 | stMessageLen = sizeof (u8Unicode) ; 39 | ocReportFile.Write(u8Unicode ,stMessageLen); 40 | } 41 | else 42 | { 43 | n64SeekParameter = 0; 44 | ocReportFile.Seek( n64SeekParameter, JFile::FEND); 45 | } 46 | size_t stMessageLen = lstrlen(Message) * sizeof (TCHAR) ; 47 | ocReportFile.Write(Message , stMessageLen); 48 | ocReportFile.Flush(); 49 | } 50 | #elif LogToConsol 51 | printf ("%ws" , Message); 52 | #endif 53 | } 54 | #endif 55 | #if LogLevel == 0 56 | void Logger (DWORD MessageId ) 57 | { 58 | 59 | TCHAR Temp [1024] ; 60 | FormatMessage (FORMAT_MESSAGE_FROM_HMODULE , NULL , MessageId , 61 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT) ,Temp , 0 , NULL ) ; 62 | OutputDebugStringA(Temp) ; 63 | }; 64 | 65 | #endif 66 | 67 | #endif -------------------------------------------------------------------------------- /BaseObjects/Msg.cpp: -------------------------------------------------------------------------------- 1 | #include "Msg.h" 2 | TCHAR MessageString[1024] ; 3 | TCHAR *MSC(UINT32 MessageId) 4 | { 5 | if ( FormatMessage(FORMAT_MESSAGE_FROM_HMODULE , NULL , MessageId , MAKELANGID(LANG_FARSI ,SUBLANG_DEFAULT) , 6 | MessageString ,sizeof (MessageString) , NULL ) == 0 ) 7 | { 8 | PutLog(FORMATMESSAGE_ERROR); 9 | MessageString[0] = NULL ; 10 | } 11 | return MessageString ; 12 | } 13 | 14 | TCHAR *MSC(UINT32 MessageId , ...) 15 | { 16 | va_list args = NULL; 17 | va_start(args, MessageId); 18 | if ( FormatMessage(FORMAT_MESSAGE_FROM_HMODULE , NULL , MessageId , MAKELANGID(LANG_FARSI ,SUBLANG_DEFAULT) , 19 | MessageString ,sizeof (MessageString) , &args ) == 0 ) 20 | { 21 | PutLog(FORMATMESSAGE_ERROR); 22 | MessageString[0] = NULL ; 23 | } 24 | va_end(args); 25 | return MessageString ; 26 | } 27 | 28 | /*TCHAR *MSC(UINT32 MessageId , TCHAR * i_strArg0 , TCHAR * i_strArg1) 29 | { 30 | if ( FormatMessage(FORMAT_MESSAGE_FROM_HMODULE , NULL , MessageId , MAKELANGID(LANG_FARSI ,SUBLANG_DEFAULT) , 31 | MessageString ,sizeof (MessageString) , i_strArg0 , i_strArg1 ) == 0 ) 32 | { 33 | PutLog(FORMATMESSAGE_ERROR); 34 | MessageString[0] = NULL ; 35 | } 36 | return MessageString ; 37 | }*/ 38 | 39 | -------------------------------------------------------------------------------- /BaseObjects/Msg.h: -------------------------------------------------------------------------------- 1 | #ifndef MSGH 2 | #define MSGH 3 | #include "BaseObject.h" 4 | /*TCHAR *MSC(UINT32 MessageId) ;*/ 5 | TCHAR *MSC(UINT32 MessageId , ...); 6 | //TCHAR *MSC(UINT32 MessageId , TCHAR * i_strArg0 , TCHAR * i_strArg1); 7 | #endif -------------------------------------------------------------------------------- /CommpersEnumator/CompFile.cpp: -------------------------------------------------------------------------------- 1 | // CommpersEnumator.cpp : Defines the entry point for the console application. 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "ZipEnumerator.h" 6 | #include "Unrar.h" 7 | #include "CompFile.h" 8 | 9 | 10 | int _tmain(int argc, _TCHAR* argv[]) 11 | { 12 | JString Long(_T("c:\\UTIL.zip")) ; 13 | while (1) 14 | { 15 | 16 | JFile rarFlie ; 17 | int i ; 18 | PWCHAR Name ; 19 | rarFlie.Open(Long) ; 20 | ICompFile *PComFile [2] ; 21 | UnrarInterface UNRARINTERFACE ; 22 | TZipFileEnum ZIPINTERFACE ; 23 | PComFile[0] = &UNRARINTERFACE ; 24 | PComFile[1] = &ZIPINTERFACE ; 25 | for (i = 0 ; i<2 ; i++) 26 | { 27 | if (PComFile[i]->SetHandle(&rarFlie) == TRUE ) 28 | { 29 | break ; 30 | } 31 | } 32 | if ( i >= 2 ) 33 | { 34 | return 0 ; 35 | } 36 | Name = PComFile[i]->GetFile() ; 37 | while (Name!= NULL ) 38 | { 39 | 40 | Name = PComFile[i]->GetFile() ; 41 | } 42 | 43 | } 44 | return 0; 45 | } 46 | 47 | -------------------------------------------------------------------------------- /CommpersEnumator/IUnCompersser.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPFILE__ 2 | #define __COMPFILE__ 3 | #include "baseObject.h" 4 | #include "JFile.h" 5 | #include "Msg.h" 6 | #include 7 | #define COMMPERSSCOUNTMODULE 2 8 | class IUnCompersser : public BaseObject 9 | { 10 | public : 11 | virtual BOOLEAN GetFile() = 0 ; 12 | virtual BOOLEAN HasNextFile() = 0 ; 13 | virtual JFile * GetCurrentFile () = 0 ; 14 | virtual UINT32 GetCurrentFileIndex () = 0 ; 15 | virtual BOOLEAN CloseCompessFile() = 0 ; 16 | virtual void SetMessageQueue(queue * ) = 0 ; 17 | virtual BOOLEAN SetHandle( JFile * ) = 0; 18 | virtual void SetDeleteIndex(UINT32 u32Index) = 0; 19 | virtual void SetReplaceIndex(JString ocFileNameinZip, JString ocFileName) = 0; 20 | virtual TCHAR* GetCurrentFileNameinZip() = 0; 21 | virtual UINT32 GetStatus() = 0; 22 | virtual JString GetCompressFileName() = 0; 23 | virtual UINT32 GetFilesCount() =0 ; 24 | }; 25 | #endif -------------------------------------------------------------------------------- /CrcMatch/crc.h: -------------------------------------------------------------------------------- 1 | #ifndef CRCH 2 | #define CRCH 3 | #include "BaseObject.h" 4 | 5 | class crc 6 | { 7 | public : 8 | static UINT32 crc32Rar(UINT32 start_crc,const UINT8 *addr, UINT32 size) ; 9 | static UINT32 crc32Zip(UINT32 start_crc,const UINT8 *addr, UINT32 size); 10 | static UINT64 crc64( UINT64 start_crc , const UINT8 *addr ,UINT32 size); 11 | private : 12 | static UINT32 crc_table[256] ; 13 | static UINT64 crc64_table[4][256]; 14 | }; 15 | 16 | #endif -------------------------------------------------------------------------------- /CrcMatch/crc64.cpp: -------------------------------------------------------------------------------- 1 | #include "check.h" 2 | #include "crc_macros.h" 3 | 4 | 5 | #ifdef WORDS_BIGENDIAN 6 | # define A1(x) ((x) >> 56) 7 | #else 8 | # define A1 A 9 | #endif 10 | 11 | 12 | // See comments in crc32.c. 13 | extern uint64_t 14 | lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc) 15 | { 16 | crc = ~crc; 17 | 18 | #ifdef WORDS_BIGENDIAN 19 | crc = bswap_64(crc); 20 | #endif 21 | 22 | if (size > 4) { 23 | while ((uintptr_t)(buf) & 3) { 24 | crc = lzma_crc64_table[0][*buf++ ^ A1(crc)] ^ S8(crc); 25 | --size; 26 | } 27 | 28 | const uint8_t *const limit = buf + (size & ~(size_t)(3)); 29 | size &= (size_t)(3); 30 | 31 | // Calculate the CRC64 using the slice-by-four algorithm. 32 | // 33 | // In contrast to CRC32 code, this one seems to be fastest 34 | // with -O3 -fomit-frame-pointer. 35 | while (buf < limit) { 36 | #ifdef WORDS_BIGENDIAN 37 | const uint32_t tmp = (crc >> 32) ^ *(uint32_t *)(buf); 38 | #else 39 | const uint32_t tmp = crc ^ *(uint32_t *)(buf); 40 | #endif 41 | buf += 4; 42 | 43 | // It is critical for performance, that 44 | // the crc variable is XORed between the 45 | // two table-lookup pairs. 46 | crc = lzma_crc64_table[3][A(tmp)] 47 | ^ lzma_crc64_table[2][B(tmp)] 48 | ^ S32(crc) 49 | ^ lzma_crc64_table[1][C(tmp)] 50 | ^ lzma_crc64_table[0][D(tmp)]; 51 | } 52 | } 53 | 54 | while (size-- != 0) 55 | crc = lzma_crc64_table[0][*buf++ ^ A1(crc)] ^ S8(crc); 56 | 57 | #ifdef WORDS_BIGENDIAN 58 | crc = bswap_64(crc); 59 | #endif 60 | 61 | return ~crc; 62 | } -------------------------------------------------------------------------------- /CrcMatch/crc64_init.cpp: -------------------------------------------------------------------------------- 1 | #ifdef HAVE_CONFIG_H 2 | # include 3 | #endif 4 | 5 | #include 6 | #include 7 | 8 | #ifdef WORDS_BIGENDIAN 9 | # include "check_byteswap.h" 10 | #endif 11 | 12 | 13 | uint64_t lzma_crc64_table[4][256]; 14 | 15 | 16 | extern void 17 | lzma_crc64_init(void) 18 | { 19 | static const uint64_t poly64 = UINT64_C(0xC96C5795D7870F42); 20 | 21 | for (size_t s = 0; s < 4; ++s) { 22 | for (size_t b = 0; b < 256; ++b) { 23 | uint64_t r = s == 0 ? b : lzma_crc64_table[s - 1][b]; 24 | 25 | for (size_t i = 0; i < 8; ++i) { 26 | if (r & 1) 27 | r = (r >> 1) ^ poly64; 28 | else 29 | r >>= 1; 30 | } 31 | 32 | lzma_crc64_table[s][b] = r; 33 | } 34 | } 35 | 36 | #ifdef WORDS_BIGENDIAN 37 | for (size_t s = 0; s < 4; ++s) 38 | for (size_t b = 0; b < 256; ++b) 39 | lzma_crc64_table[s][b] 40 | = bswap_64(lzma_crc64_table[s][b]); 41 | #endif 42 | 43 | return; 44 | } -------------------------------------------------------------------------------- /CrcMatch/crc_macros.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file crc_macros 4 | /// \brief Some endian-dependent macros for CRC32 and CRC64 5 | // 6 | // This code has been put into the public domain. 7 | // 8 | // This library is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | // 12 | /////////////////////////////////////////////////////////////////////////////// 13 | 14 | #ifdef WORDS_BIGENDIAN 15 | # include "check_byteswap.h" 16 | 17 | # define A(x) ((x) >> 24) 18 | # define B(x) (((x) >> 16) & 0xFF) 19 | # define C(x) (((x) >> 8) & 0xFF) 20 | # define D(x) ((x) & 0xFF) 21 | 22 | # define S8(x) ((x) << 8) 23 | # define S32(x) ((x) << 32) 24 | 25 | #else 26 | # define A(x) ((x) & 0xFF) 27 | # define B(x) (((x) >> 8) & 0xFF) 28 | # define C(x) (((x) >> 16) & 0xFF) 29 | # define D(x) ((x) >> 24) 30 | 31 | # define S8(x) ((x) >> 8) 32 | # define S32(x) ((x) >> 32) 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /Cryption/C Version/JDecryptedFile.h: -------------------------------------------------------------------------------- 1 | #ifndef __JDECRYPTEDFILE__ 2 | #define __JDECRYPTEDFILE__ 3 | #include "BaseObject.h" 4 | //#include "WinError.h" 5 | //#include "JFile.h" 6 | #pragma section ("JJJ",read , write) 7 | 8 | #define xtime(x) ((x<<1) ^ (((x>>7) & 1) * 0x1b)) 9 | 10 | // Multiplty is a macro used to multiply numbers in the field GF(2^8) 11 | #define Multiply(x,y) (((y & 1) * x) ^ ((y>>1 & 1) * xtime(x)) ^ ((y>>2 & 1) * xtime(xtime(x))) ^ ((y>>3 & 1) * xtime(xtime(xtime(x)))) ^ ((y>>4 & 1) * xtime(xtime(xtime(xtime(x)))))) 12 | 13 | #pragma pack(8) 14 | typedef struct _CryptFile 15 | { 16 | UINT8 Nb; 17 | UINT8 state[4][4], RoundKey[240], BUFFER [16] , WriteBuffer [16] , AlignByte, IndexBuffer, *inBuffer, *OutBuffer; 18 | UINT16 Nr , Nk ; 19 | UINT32 LastErrorCode; 20 | UINT64 FilePosition , BufferPosition , RealFilePosition , WriteBufferPosition , FileSize ; 21 | HANDLE hFile; 22 | }CryptFile; 23 | 24 | UINT64 GetCryptFileLength(CryptFile *osCryptFile); 25 | void CryptKeyExpansion(CryptFile *osCryptFile) ; 26 | FORCEINLINE UINT8 GetSBoxValue(UINT8 num) ; 27 | void AddRoundKey(CryptFile *osCryptFile, UINT8 round) ; 28 | void SubBytes(CryptFile *osCryptFile); 29 | void MixColumns(CryptFile *osCryptFile); 30 | void InvCipher(CryptFile *osCryptFile); 31 | void Cipher(CryptFile *osCryptFile); 32 | void ShiftRows(CryptFile *osCryptFile) ; 33 | void InvShiftRows(CryptFile *osCryptFile); 34 | void InvSubBytes(CryptFile *osCryptFile) ; 35 | void InvMixColumns(CryptFile *osCryptFile) ; 36 | UINT8 GetSBoxInvert(UINT8 num); 37 | BOOLEAN GetCryptedFilePosition (CryptFile *osCryptFile, UINT64 *Offset); 38 | void CryptedFileInit(CryptFile *osCryptFile); 39 | 40 | BOOLEAN CryptOpen(CryptFile *osCryptFile, TCHAR* szName); 41 | BOOLEAN CryptCreateFile(CryptFile *osCryptFile, TCHAR* szName); 42 | BOOLEAN CryptRead(CryptFile *osCryptFile, void *Data, DWORD *Size); 43 | BOOLEAN CryptWrite(CryptFile *osCryptFile, void *Data,DWORD *Size) ; 44 | BOOLEAN CryptSeek(CryptFile *osCryptFile, INT64 *Offset, UINT32 Method) ; 45 | // BOOLEAN GetCryptedFilePosition (UINT64 &Offset) ; 46 | BOOLEAN CryptClose(CryptFile *osCryptFile); 47 | 48 | #endif -------------------------------------------------------------------------------- /Cryption/C++ Version/JDecryptedFile.h: -------------------------------------------------------------------------------- 1 | #ifndef __JDECRYPTEDFILE__ 2 | #define __JDECRYPTEDFILE__ 3 | #include "BaseObject.h" 4 | #include "WinError.h" 5 | #include "JFile.h" 6 | #pragma section ("JJJ",read , write) 7 | 8 | #define xtime(x) ((x<<1) ^ (((x>>7) & 1) * 0x1b)) 9 | 10 | // Multiplty is a macro used to multiply numbers in the field GF(2^8) 11 | #define Multiply(x,y) (((y & 1) * x) ^ ((y>>1 & 1) * xtime(x)) ^ ((y>>2 & 1) * xtime(xtime(x))) ^ ((y>>3 & 1) * xtime(xtime(xtime(x)))) ^ ((y>>4 & 1) * xtime(xtime(xtime(xtime(x)))))) 12 | 13 | 14 | 15 | class JDecryptedFile : public JFile 16 | { 17 | 18 | private : 19 | static const UINT8 Nb = 4 ; 20 | UINT8 Nr , Nk ; 21 | UINT8 state[4][4]; 22 | unsigned char RoundKey[240]; 23 | 24 | BYTE BUFFER [16] , WriteBuffer [16] , AlignByte; 25 | 26 | UINT8 IndexBuffer ; 27 | unsigned char *inBuffer , *OutBuffer; 28 | 29 | void KeyExpansion() ; 30 | FORCEINLINE UINT8 getSBoxValue(UINT8 num) ; 31 | void AddRoundKey(UINT8 round) ; 32 | void SubBytes(); 33 | void MixColumns(); 34 | void InvCipher(); 35 | void Cipher(); 36 | void ShiftRows() ; 37 | void InvShiftRows(); 38 | void InvSubBytes() ; 39 | void InvMixColumns() ; 40 | UINT8 getSBoxInvert(UINT8 num); 41 | UINT64 FilePosiotn , BufferPosiotn , RealFilePosotion , WriteBuffrePostion , FileSize ; 42 | 43 | public : 44 | 45 | JDecryptedFile(); 46 | ~JDecryptedFile(); 47 | BOOLEAN Open(JString &Name,BOOLEAN OpenShared=FALSE,BOOLEAN Update=FALSE) ; 48 | BOOLEAN CreateFile(JString &Name,BOOLEAN OpenShared,BOOLEAN Update); 49 | BOOLEAN Read(void *Data,size_t &Size); 50 | BOOLEAN Write(const void *Data,size_t &Size) ; 51 | BOOLEAN Seek(INT64 &Offset,MoveMethod Method) ; 52 | BOOLEAN GetFilePosition (UINT64 &Offset) ; 53 | BOOLEAN Close(); 54 | UINT64 GetFileLength(); 55 | }; 56 | #endif -------------------------------------------------------------------------------- /FileIoByDevice/FileIoByDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef FILEIOBYDEVICE 2 | #define FILEIOBYDEVICE 3 | #include "BaseObject.h" 4 | #include "AVEngine_AsyncRPC_h.h" 5 | extern HANDLE hOwnDevice ; 6 | HANDLE CreateFileByDevice (LPCTSTR lpFileName, UINT32 u32DesiredAccess,UINT32 u32ShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, UINT32 u32CreationDisposition, UINT32 u32FlagsAndAttributes, HANDLE hTemplateFile ) ; 7 | BOOLEAN WriteFileByDevice ( HANDLE hFile, LPCVOID lpBuffer,UINT32 u32NumberOfBytesToWrite,UINT32* pu32NumberOfBytesWritten, LPOVERLAPPED lpOverlapped ) ; 8 | BOOLEAN ReadFileByDevice (HANDLE hFile, LPVOID lpBuffer, UINT32 u32NumberOfBytesToRead, UINT32* pu32NumberOfBytesRead, LPOVERLAPPED lpOverlapped); 9 | BOOLEAN SetFilePointerByDevice( HANDLE hFile, LARGE_INTEGER liDistanceToMove, PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod ); 10 | BOOLEAN SetEndOfFileByDevice ( HANDLE hFile ); 11 | BOOLEAN CloseFileByDevice ( HANDLE hFile ) ; 12 | UINT32 GetFileAttributesByDevice (const TCHAR* lstrFileName); 13 | BOOLEAN DeleteByApp(const TCHAR* lstrFileName); 14 | BOOLEAN ConnectToDevice (); 15 | void CloseConnectHandel(); 16 | BOOLEAN GetFileSizeExByDevice( HANDLE hFile, PLARGE_INTEGER lpFileSize ); 17 | BOOLEAN SetCurrentDevice (const TCHAR* lstrFileName , const TCHAR* lstrPureFileName ); 18 | HANDLE OpenDrictoryByDevice( TCHAR * lpFileName ); 19 | BOOLEAN ListDrictory (HANDLE hFile , UINT8 * o_pu8buffer); 20 | HANDLE CreateTempFileByDevice (LPCTSTR lpFileName); 21 | BOOLEAN DeleteTempFileByApp ( LPCTSTR lpFileName ); 22 | BOOLEAN StopScan(); 23 | BOOLEAN DoScan(HANDLE hFile ,UINT * ); 24 | BOOLEAN GetName(char *i_strname , UINT32 i_u32Buffersize); 25 | BOOLEAN GetCleanOrDelete(UINT32 * i_pu32CleanOrDelete); 26 | BOOLEAN SetConfig (ScanConfig *i_posConfig); 27 | BOOLEAN SetZipFlag() ; 28 | BOOLEAN CleanZipFlag() ; 29 | #endif -------------------------------------------------------------------------------- /FileSystemEnumator/FileSystemEnumerator.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/FileSystemEnumator/FileSystemEnumerator.cpp -------------------------------------------------------------------------------- /FileSystemEnumator/JFindFile.h: -------------------------------------------------------------------------------- 1 | #ifndef JFileSystemH 2 | #define JFileSystemH 3 | #include "BaseObject.h" 4 | #ifdef JFILEKERNEL 5 | typedef struct _FILE_DIRECTORY_INFORMATION { 6 | UINT32 NextEntryOffset; 7 | UINT32 FileIndex; 8 | UINT64 CreationTime; 9 | UINT64 LastAccessTime; 10 | UINT64 LastWriteTime; 11 | UINT64 ChangeTime; 12 | UINT64 EndOfFile; 13 | UINT64 AllocationSize; 14 | UINT32 FileAttributes; 15 | UINT32 FileNameLength; 16 | wchar_t FileName[1]; 17 | } FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION; 18 | #endif 19 | 20 | 21 | class JFindFile :public BaseObject 22 | { 23 | private : 24 | HANDLE m_hFoundFile ; 25 | HANDLE m_hFoundStreamFile; 26 | #ifdef JFILEKERNEL 27 | UINT8 m_arru8FindBuffer[0x1000]; 28 | PFILE_DIRECTORY_INFORMATION m_posCurrentFileDrictory ; 29 | #endif 30 | WIN32_FIND_DATA m_osFoundFileData; 31 | WIN32_FIND_STREAM_DATA m_osFindStreamData; 32 | public : 33 | JFindFile(); 34 | BOOLEAN IsDirectory(); 35 | BOOLEAN FindFirstFile(TCHAR *i_strPath); 36 | // BOOLEAN FindFristFileStream(wchar_t *i_strPath); 37 | BOOLEAN FindNextFile(); 38 | //BOOLEAN FindNextFileStream(); 39 | BOOLEAN FindClose(); 40 | // BOOLEAN FindStreamClose(); 41 | TCHAR *GetFindedName(); 42 | wchar_t *GetFindedStreamName(); 43 | UINT32 GetFindedNameLenght(); 44 | }; 45 | 46 | #endif -------------------------------------------------------------------------------- /FileType/FileInf.h: -------------------------------------------------------------------------------- 1 | #ifndef __FILEINFO__ 2 | #define __FILEINFO__ 3 | #include "BaseObject.h" 4 | #include "JFile.h" 5 | 6 | class FileInfo : public BaseObject 7 | { 8 | public : 9 | FileInfo(){ObjectTable = NULL ;} 10 | BOOLEAN SetFile(JFile &File); 11 | DWORD RvaToOffset (DWORD Rva) ; 12 | DWORD EntryPointOffset ; 13 | DWORD EntryPointRva ; 14 | DWORD ImageBase ; 15 | FileType Type ; 16 | LPOBJECTTABLE ObjectTable ; 17 | void Reset(); 18 | WORD ObjectsCount ; 19 | DWORD MaxSizeSection(DWORD Rva); 20 | DWORD MinSizeSection(DWORD Rva); 21 | DWORD MaxFirstSection(); 22 | DWORD MinFirstSection(); 23 | private : 24 | }; 25 | #endif -------------------------------------------------------------------------------- /Guard/BinaryTranslate.h: -------------------------------------------------------------------------------- 1 | #ifndef _BinaryTranslate_ 2 | #define _BinaryTranslate_ 3 | #include "All_Defines.h" 4 | #include "StateMachine.h" 5 | ////////////////////////////////////////////////////////////////////////// 6 | void TranslateFunc(FunctionBinary * posFunction, WCHAR * pszOutputString, UINT32 nOutputLength); 7 | void Translate(ConditionExpression * posCondition, WCHAR * pszOutputString, UINT32 nOutputLength); 8 | BOOLEAN GetForReg( UINT8 byRegIndex, WCHAR * pszOutputString, UINT32 nOutputLength ); 9 | #endif -------------------------------------------------------------------------------- /Guard/CPU.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef CPU_ADDED 3 | #define CPU_ADDED 4 | 5 | //#include "SMFile.h" 6 | //#include "FileInformation.h" 7 | //#include 8 | #include "Header.h" 9 | #include "All_Defines.h" 10 | 11 | 12 | // Defines 13 | #define pFinish 0x00F00000 14 | #define pContinue 0x0F000000 15 | #define pBad 0xF0000000 16 | 17 | #define p66 0x00000001 18 | #define p67 0x00000002 19 | 20 | #define pLock 0x00000100 21 | 22 | #define pES 0x00000400 23 | #define pCS 0x00000800 24 | #define pDS 0x00001000 25 | #define pFS 0x00002000 26 | #define pGS 0x00004000 27 | #define pSS 0x00008000 28 | 29 | #define pRepn 0x00010000 30 | #define pRep 0x00020000 31 | 32 | 33 | 34 | 35 | // Function Prototypes 36 | 37 | void InitCpu(VirtualMachine *posVm); 38 | BOOLEAN CPU_Fetch(VirtualMachine *posVm); 39 | BOOLEAN CPU_Execute(VirtualMachine *posVm); 40 | UINT32 GetOpcodeState(VirtualMachine *posVm, UINT8 byOpcode); 41 | BOOLEAN CheckOpcode(VirtualMachine *posVm); 42 | BOOLEAN SetOperands(VirtualMachine *posVm, SMTableBlock Block); 43 | void ReadModRM(VirtualMachine *posVm); 44 | void Mod_RM16( VirtualMachine *posVm, UINT8 nIndex ); 45 | void Mod_RM8_32( VirtualMachine *posVm, UINT8 nIndex , BOOLEAN Is8Bit ); 46 | void MakeTable16BitsReady(VirtualMachine *posVm); 47 | 48 | #endif -------------------------------------------------------------------------------- /Guard/DatFileEnumator.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Guard/DatFileEnumator.c -------------------------------------------------------------------------------- /Guard/DatFileEnumator.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Guard/DatFileEnumator.h -------------------------------------------------------------------------------- /Guard/DatFileStruct.h: -------------------------------------------------------------------------------- 1 | #ifndef DATFILESTRUCTH 2 | #define DATFILESTRUCTH 3 | #define MaxlenSetName 20 4 | #pragma pack (push , 1) 5 | 6 | #include "SMTypeDefine.h" 7 | typedef struct _tagSet 8 | { 9 | UINT32 OffsetSetName ; 10 | UINT8 SetNameLenght ; 11 | UINT8 SetOrVirus : 1 ; 12 | UINT8 CrcMatchCount ; 13 | UINT8 PatTypCount ; 14 | }tagSet; 15 | 16 | typedef struct _tagPattern 17 | { 18 | UINT16 PatternSize ; 19 | } tagPattern; 20 | 21 | typedef struct _tagCrcMatchInfo 22 | { 23 | UINT32 Start ; 24 | UINT32 End ; 25 | } tagCrcMatchInfo; 26 | 27 | typedef struct _tagCrcExtMatchInfo 28 | { 29 | UINT32 Start ; 30 | UINT32 Extended ; 31 | UINT32 End ; 32 | } tagCrcExtMatchInfo; 33 | 34 | typedef struct _tagOffset 35 | { 36 | UINT32 Offset ; 37 | UINT32 Counter ; 38 | } tagOffset; 39 | 40 | typedef struct _tagVirName 41 | { 42 | UINT32 VirusNameOffset ; 43 | UINT8 SizeName ; 44 | } tagVirName; 45 | 46 | typedef struct _tagChkVir 47 | { 48 | UINT64 CheckSum ; 49 | UINT32 VirusEntry ; 50 | } tagChkVir; 51 | 52 | typedef struct _tagSetMatchType 53 | { 54 | UINT32 MethodId ; 55 | UINT8 Type ; 56 | UINT8 TableIndex ; 57 | UINT32 CountVirusDetectViaMethod ; 58 | } tagSetMatchType; 59 | 60 | typedef struct _tagPatType 61 | { 62 | UINT32 PatternId ; 63 | UINT16 TypeCount ; 64 | } tagPatType; 65 | 66 | typedef struct _tagTypSet 67 | { 68 | UINT16 PatternType ; 69 | UINT16 SetCount; 70 | } tagTypSet; 71 | 72 | typedef struct _tagSetId 73 | { 74 | UINT16 SetID; 75 | } tagSetId; 76 | #pragma pack (pop , 8) 77 | #endif -------------------------------------------------------------------------------- /Guard/FastIo.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Guard/FastIo.c -------------------------------------------------------------------------------- /Guard/FastIo.h: -------------------------------------------------------------------------------- 1 | #ifndef __FASTIO_DISPATCH__ 2 | #define __FASTIO_DISPATCH__ 3 | 4 | #include "wdm.h" 5 | 6 | 7 | #define FASTIOPRESENT( _hookExt, _call ) \ 8 | (_hookExt->TYPE != GUIDEVICE && \ 9 | _hookExt->LowerDevice->DriverObject->FastIoDispatch && \ 10 | (((ULONG)&_hookExt->LowerDevice->DriverObject->FastIoDispatch->_call - \ 11 | (ULONG) &_hookExt->LowerDevice->DriverObject->FastIoDispatch->SizeOfFastIoDispatch < \ 12 | (ULONG) _hookExt->LowerDevice->DriverObject->FastIoDispatch->SizeOfFastIoDispatch )) && \ 13 | _hookExt->LowerDevice->DriverObject->FastIoDispatch->_call ) 14 | 15 | #define FASTIOPRESENTFORDEVICECONTORL( _hookExt, _call ) \ 16 | ( _hookExt->LowerDevice->DriverObject->FastIoDispatch && \ 17 | (((ULONG)&_hookExt->LowerDevice->DriverObject->FastIoDispatch->_call - \ 18 | (ULONG) &_hookExt->LowerDevice->DriverObject->FastIoDispatch->SizeOfFastIoDispatch < \ 19 | (ULONG) _hookExt->LowerDevice->DriverObject->FastIoDispatch->SizeOfFastIoDispatch )) && \ 20 | _hookExt->LowerDevice->DriverObject->FastIoDispatch->_call ) 21 | 22 | FAST_IO_CHECK_IF_POSSIBLE JAV_FastIoCheckifPossible ; 23 | 24 | FAST_IO_READ JAV_FastIoRead; 25 | 26 | FAST_IO_WRITE JAV_FastIoWrite; 27 | 28 | FAST_IO_QUERY_BASIC_INFO JAV_FastIoQueryBasicInfo ; 29 | 30 | FAST_IO_QUERY_STANDARD_INFO JAV_FastIoQueryStandardInfo ; 31 | 32 | FAST_IO_LOCK JAV_FastIoLock ; 33 | 34 | FAST_IO_UNLOCK_SINGLE JAV_FastIoUnlockSingle ; 35 | 36 | FAST_IO_UNLOCK_ALL JAV_FastIoUnlockAll ; 37 | 38 | FAST_IO_UNLOCK_ALL_BY_KEY JAV_FastIoUnlockAllByKey ; 39 | 40 | FAST_IO_DEVICE_CONTROL JAV_FastIoDeviceControl ; 41 | 42 | FAST_IO_ACQUIRE_FILE JAV_FastIoAcquireFile ; 43 | 44 | FAST_IO_RELEASE_FILE JAV_FastIoReleaseFile ; 45 | 46 | FAST_IO_DETACH_DEVICE JAV_FastIoDetachDevice ; 47 | 48 | FAST_IO_QUERY_NETWORK_OPEN_INFO JAV_FastIoQueryNetworkOpenInfo ; 49 | 50 | FAST_IO_ACQUIRE_FOR_MOD_WRITE JAV_FastIoAcquireForModWrite ; 51 | 52 | FAST_IO_MDL_READ JAV_FastIoMdlRead ; 53 | 54 | FAST_IO_MDL_READ_COMPLETE JAV_FastIoMdlReadComplete ; 55 | 56 | FAST_IO_PREPARE_MDL_WRITE JAV_FastIoPrepareMdlWrite ; 57 | 58 | FAST_IO_MDL_WRITE_COMPLETE JAV_FastIoMdlWriteComplete ; 59 | 60 | FAST_IO_READ_COMPRESSED JAV_FastIoReadCompressed ; 61 | 62 | FAST_IO_WRITE_COMPRESSED JAV_FastIoWriteCompressed; 63 | 64 | FAST_IO_MDL_READ_COMPLETE_COMPRESSED JAV_FastIoMdlReadCompleteCompressed; 65 | 66 | FAST_IO_MDL_WRITE_COMPLETE_COMPRESSED JAV_FastIoMdlWriteCompleteCompressed ; 67 | 68 | FAST_IO_QUERY_OPEN JAV_FastIoQueryOpen ; 69 | 70 | FAST_IO_RELEASE_FOR_MOD_WRITE JAV_FastIoReleaseForModWrite ; 71 | 72 | FAST_IO_ACQUIRE_FOR_CCFLUSH JAV_FastIoAcquireForCcFlush ; 73 | 74 | FAST_IO_RELEASE_FOR_CCFLUSH JAV_FastIoReleaseForCcFlush ; 75 | 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /Guard/FileApiBYIRP.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Guard/FileApiBYIRP.c -------------------------------------------------------------------------------- /Guard/FileApiBYIRP.h: -------------------------------------------------------------------------------- 1 | #ifndef __FILEAPIBYIRP__ 2 | #define __FILEAPIBYIRP__ 3 | #include "iomonitor.h" 4 | #include "SMBuffer.h" 5 | 6 | NTSTATUS ReadByIRPFromFileObject (SMBuffer *posSMBuffer, SMModuleDescriptor *Buffer , PULONG Size , __int64 Offset ); 7 | 8 | NTSTATUS IRPGetFileAttributes(IN PFileHandle FH , PULONG FileAttrib) ; 9 | 10 | NTSTATUS IRPGetFileName(IN PFileHandle FH, unsigned char *NameBuffer) ; 11 | 12 | NTSTATUS IRPGetFileCurrentOffset(IN PFileHandle FH,LARGE_INTEGER *CurrentByteOffset ) ; 13 | 14 | NTSTATUS IRPGetFileSize( SMBuffer *posJBuffer , LARGE_INTEGER *FileSize ); 15 | 16 | NTSTATUS IRPDeleteFile(IN PFileHandle FH ) ; 17 | 18 | NTSTATUS IRPSetEndFile(IN PFileHandle FH , LARGE_INTEGER EndOfFile ) ; 19 | 20 | NTSTATUS IRPSetPositionFile(IN PFileHandle FH , PLARGE_INTEGER Offset ) ; 21 | 22 | NTSTATUS IRPRenameFile(IN PFileHandle FH , WCHAR FileName[] ) ; 23 | NTSTATUS FsIoMakeQueryStandardFileInformationRequest( PFILE_OBJECT FileObject, 24 | PDEVICE_OBJECT DeviceObjectHint, 25 | PFILE_STANDARD_INFORMATION FileStdInfo) ; 26 | NTSTATUS IRPFlushFile(IN PFileHandle FH); 27 | 28 | NTSTATUS WriteByIRPFromFileObject (IN PFileHandle FH, UCHAR *Buffer , PULONG Size , LARGE_INTEGER *Offset ); 29 | 30 | #endif -------------------------------------------------------------------------------- /Guard/FileInformation.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Guard/FileInformation.c -------------------------------------------------------------------------------- /Guard/FileIoStruct.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Guard/FileIoStruct.h -------------------------------------------------------------------------------- /Guard/FilterDispatch.h: -------------------------------------------------------------------------------- 1 | #ifndef __FILTERDISPATCH__ 2 | #define __FILTERDISPATCH__ 3 | #include "ntddk.h" 4 | 5 | NTSTATUS FilterDefualtRutin ( PDEVICE_OBJECT DeviceObject, PIRP Irp , PIO_STACK_LOCATION irpStack ); 6 | NTSTATUS FilterCreateFileRutin ( PDEVICE_OBJECT DeviceObject, PIRP Irp , PIO_STACK_LOCATION irpStack ); 7 | NTSTATUS FilterFSControl ( PDEVICE_OBJECT DeviceObject, PIRP Irp , PIO_STACK_LOCATION irpStack ); 8 | NTSTATUS FilterCloseFileRutin (IN PDEVICE_OBJECT DeviceObject,IN PIRP Irp , PIO_STACK_LOCATION irpStack ) ; 9 | NTSTATUS FilterReadDefualtRutin (IN PDEVICE_OBJECT DeviceObject,IN PIRP Irp , PIO_STACK_LOCATION irpStack ); 10 | IO_COMPLETION_ROUTINE IoCompletionCreateFileIo; 11 | 12 | 13 | #endif -------------------------------------------------------------------------------- /Guard/Header.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_ADDED 2 | #define HEADER_ADDED 3 | #include "SMTypeDefine.h" 4 | 5 | 6 | typedef struct _VirtualMachine VirtualMachine; 7 | typedef enum _SMBytesEnum SMBytesEnum; 8 | typedef enum _OperandType 9 | { 10 | NotDef, 11 | AL, 12 | AX, 13 | CL, 14 | DL, 15 | BL, 16 | AH, 17 | CH, 18 | DH, 19 | BH, 20 | CX, 21 | BX, 22 | SP, 23 | BP, 24 | DI, 25 | SI, 26 | CR0, 27 | CR2, 28 | CR3, 29 | CR4, 30 | CS, 31 | DR0_DR7, 32 | DS, 33 | DX, 34 | EAX, 35 | ES, 36 | FS, 37 | GS, 38 | imm16, 39 | imm32, 40 | imm8, 41 | m, 42 | LEA32, 43 | m128, 44 | m14_Slash_28byte, 45 | m16, 46 | m16_Amp_16, 47 | m16_Amp_32, 48 | m16_Colon_16, 49 | m16_Colon_32, 50 | m32_Colon_32, 51 | m16int, 52 | m2byte, 53 | m32, 54 | m32_Amp_32, 55 | m32int, 56 | m32real, 57 | m512byte, 58 | m64, 59 | m64int, 60 | m64real, 61 | m8, 62 | m80bcd, 63 | m80dec, 64 | m80real, 65 | m94_Slash_108byte, 66 | mm, 67 | mm_Slash_m32, 68 | mm_Slash_m64, 69 | mm1, 70 | mm2_Slash_m64, 71 | moffs16, 72 | moffs32, 73 | moffs8, 74 | ptr16_Colon_16, 75 | ptr16_Colon_32, 76 | r_Slash_m16, 77 | r_Slash_m32, 78 | r_Slash_m8, 79 | r16, 80 | r32, 81 | r32_Slash_m16, 82 | r8, 83 | rel16, 84 | rel16_Slash_32, 85 | rel32, 86 | rel8, 87 | Sreg, 88 | SS, 89 | ST, 90 | ST__0__, 91 | ST__1__, 92 | ST__2__, 93 | ST__3__, 94 | ST__4__, 95 | ST__5__, 96 | ST__6__, 97 | ST__7__, 98 | ST__8__, 99 | ST__9__, 100 | ST__10__, 101 | ST__11__, 102 | ST__12__, 103 | ST__13__, 104 | ST__14__, 105 | ST__15__, 106 | xmm, 107 | xmm_Slash_m32, 108 | xmm_Slash_m64, 109 | xmm1, 110 | xmm2_Slash_m128, 111 | xmm2_Slash_m32, 112 | 113 | EBX, 114 | ECX, 115 | EDX, 116 | ESI, 117 | EDI, 118 | EBP, 119 | ESP, 120 | EIP, 121 | EFL 122 | } OperandType; 123 | 124 | #pragma pack (push, 1) 125 | typedef void (__fastcall *Pointer)(VirtualMachine *posVm); 126 | 127 | // Structure use for match from opcode table list 128 | typedef struct _SMTableBlock 129 | { 130 | #if _DEBUG 131 | WCHAR *szOpcode; 132 | #endif 133 | Pointer pFuncPointer; 134 | OperandType eOperand1 ; 135 | OperandType eOperand2 ; 136 | OperandType eOperand3 ; 137 | Pointer pNextFuncPointer; 138 | SMBytesEnum eInstruction; 139 | UINT8 Prefix; 140 | }SMTableBlock; 141 | #pragma pack (pop) 142 | #endif -------------------------------------------------------------------------------- /Guard/IFunc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Guard/IFunc.c -------------------------------------------------------------------------------- /Guard/IFunc.h: -------------------------------------------------------------------------------- 1 | #ifndef __IFunc__ 2 | #define __IFunc__ 3 | #include "iomonitor.h" 4 | 5 | NTSTATUS GetDeviceFromName ( WCHAR *filename , PDEVICE_OBJECT * FileSysDevice ); 6 | NTSTATUS UnHookAllDevice ( IN PDRIVER_OBJECT DriverObject) ; 7 | NTSTATUS UnHookByDevice ( IN PDEVICE_OBJECT FileSysDevice ) ; 8 | BOOLEAN IsValidFileSystemForHook ( IN PDEVICE_OBJECT FileSysDevice ) ; 9 | NTSTATUS GetNameObject(IN PDEVICE_OBJECT FileSysDevice ,OUT POBJECT_NAME_INFORMATION* DeviceName) ; 10 | NTSTATUS AttachToMountVolume(IN PDRIVER_OBJECT MYDriverObject ,IN PDEVICE_OBJECT FSCDO) ; 11 | BOOLEAN AlreadyAttachToDevice(IN PDRIVER_OBJECT MYDriverObject ,IN PDEVICE_OBJECT Device) ; 12 | NTSTATUS GetBaseDeviceName (IN PDEVICE_OBJECT Device ,OUT POBJECT_NAME_INFORMATION* DeviceName) ; 13 | NTSTATUS CtrlMountVolume (PDEVICE_OBJECT DeviceObject, PIRP Irp , PIO_STACK_LOCATION irpStack ) ; 14 | NTSTATUS CtrlLoadFs (PDEVICE_OBJECT DeviceObject, PIRP Irp , PIO_STACK_LOCATION irpStack ) ; 15 | NTSTATUS HookByDevice( IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT FileSysDevice ,DEVICEMODEL MODEL , PUNICODE_STRING InputDeviceName); 16 | PDEVICE_OBJECT GetLowerDevice(IN PDRIVER_OBJECT MYDriverObject ,IN PDEVICE_OBJECT Device) ; 17 | 18 | 19 | #endif -------------------------------------------------------------------------------- /Guard/IOCTL.h: -------------------------------------------------------------------------------- 1 | #ifndef __IOCTL__ 2 | #define __IOCTL__ 3 | #define SymblicName L"\\DosDevices\\JavIomonitor" 4 | #ifndef CTL_CODE 5 | #pragma message ( \ 6 | "CTL_CODE undefined. Include winioctl.h or wdm.h") 7 | #endif 8 | 9 | #define IOCTL_GET_EVENT \ 10 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x801, METHOD_BUFFERED, \ 11 | FILE_ANY_ACCESS) 12 | 13 | #define IOCTL_ATTACH_DEVICE \ 14 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x802, METHOD_BUFFERED, \ 15 | FILE_ANY_ACCESS) 16 | 17 | #define IOCTL_DEATTACH_DEVICE \ 18 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x803, METHOD_BUFFERED, \ 19 | FILE_ANY_ACCESS) 20 | 21 | #define IOCTL_SET_DEVICE \ 22 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x804, METHOD_BUFFERED, \ 23 | FILE_ANY_ACCESS) 24 | 25 | #define IOCTL_DO_SCAN \ 26 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x805, METHOD_BUFFERED, \ 27 | FILE_ANY_ACCESS) 28 | 29 | #define IOCTL_STOP_SCAN_PROCESS \ 30 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x806, METHOD_BUFFERED, \ 31 | FILE_ANY_ACCESS) 32 | 33 | #define IOCTL_CREATE_FILE \ 34 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x807, METHOD_BUFFERED, \ 35 | FILE_ANY_ACCESS) 36 | #define IOCTL_WRITE_FILE \ 37 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x808, METHOD_BUFFERED, \ 38 | FILE_ANY_ACCESS) 39 | #define IOCTL_READ_FILE \ 40 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x809, METHOD_BUFFERED, \ 41 | FILE_ANY_ACCESS) 42 | #define IOCTL_SEEK_FILE \ 43 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x80A, METHOD_BUFFERED, \ 44 | FILE_ANY_ACCESS) 45 | #define IOCTL_SET_END_FILE \ 46 | CTL_CODE(FILE_DEVICE_UNKNOWN , 0x80B, METHOD_BUFFERED, \ 47 | FILE_ANY_ACCESS) 48 | #define IOCTL_CLOSE_FILE \ 49 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x80C, METHOD_BUFFERED, \ 50 | FILE_ANY_ACCESS) 51 | 52 | #define IOCTL_GET_FILE_SIZE \ 53 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x80D, METHOD_BUFFERED, \ 54 | FILE_ANY_ACCESS) 55 | 56 | #define IOCTL_GET_FILE_ATTRIB \ 57 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x80E, METHOD_BUFFERED, \ 58 | FILE_ANY_ACCESS) 59 | 60 | #define IOCTL_DELETE_FILE \ 61 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x80F, METHOD_BUFFERED, \ 62 | FILE_ANY_ACCESS) 63 | 64 | #define IOCTL_OPEN_DIRCTORY \ 65 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x810, METHOD_BUFFERED, \ 66 | FILE_ANY_ACCESS) 67 | 68 | #define IOCTL_LISE_DIRCTORY \ 69 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x811, METHOD_BUFFERED, \ 70 | FILE_ANY_ACCESS) 71 | 72 | #define IOCTL_OPEN_TEMP_FILE \ 73 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x812, METHOD_BUFFERED, \ 74 | FILE_ANY_ACCESS) 75 | 76 | #define IOCTL_DELETE_TEMP_FILE \ 77 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x813, METHOD_BUFFERED, \ 78 | FILE_ANY_ACCESS) 79 | 80 | #define IOCTL_GET_NAME \ 81 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x814, METHOD_BUFFERED, \ 82 | FILE_ANY_ACCESS) 83 | 84 | #define IOCTL_GET_PROCESSID \ 85 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x815, METHOD_BUFFERED, \ 86 | FILE_ANY_ACCESS) 87 | 88 | #define IOCTL_CLEAR_CONFIG \ 89 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x816, METHOD_BUFFERED, \ 90 | FILE_ANY_ACCESS) 91 | 92 | #define IOCTL_GET_CLEAN_DELETE \ 93 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x817, METHOD_BUFFERED, \ 94 | FILE_ANY_ACCESS) 95 | 96 | #define IOCTL_SET_DEMAND_CONFIG \ 97 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x818, METHOD_BUFFERED, \ 98 | FILE_ANY_ACCESS) 99 | 100 | #define IOCTL_CLEAR_DEMAND_CONFIG \ 101 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x819, METHOD_BUFFERED, \ 102 | FILE_ANY_ACCESS) 103 | 104 | #define IOCTL_SET_ONACCESS_CONFIG \ 105 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x820, METHOD_BUFFERED, \ 106 | FILE_ANY_ACCESS) 107 | 108 | #define IOCTL_CLEAN_ONACCESS_CONFIG \ 109 | CTL_CODE(FILE_DEVICE_UNKNOWN, 0x821, METHOD_BUFFERED, \ 110 | FILE_ANY_ACCESS) 111 | 112 | #endif 113 | -------------------------------------------------------------------------------- /Guard/IoMonitor.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual C++ Express 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IoMonitor", "IoMonitor.vcxproj", "{8673198A-0F0F-4E35-B894-432A9594FD84}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {8673198A-0F0F-4E35-B894-432A9594FD84}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {8673198A-0F0F-4E35-B894-432A9594FD84}.Debug|Win32.Build.0 = Debug|Win32 14 | {8673198A-0F0F-4E35-B894-432A9594FD84}.Release|Win32.ActiveCfg = Release|Win32 15 | {8673198A-0F0F-4E35-B894-432A9594FD84}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /Guard/IoMonitor.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Guard/IoMonitor.suo -------------------------------------------------------------------------------- /Guard/IoMonitor.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /Guard/JDecryptedFile.h: -------------------------------------------------------------------------------- 1 | #ifndef __JDECRYPTEDFILE__ 2 | #define __JDECRYPTEDFILE__ 3 | #include "SMTypeDefine.h" 4 | #include "SMFile.h" 5 | #pragma section ("JJJ",read , write) 6 | 7 | #define xtime(x) ((x<<1) ^ (((x>>7) & 1) * 0x1b)) 8 | 9 | // Multiplty is a macro used to multiply numbers in the field GF(2^8) 10 | #define Multiply(x,y) (((y & 1) * x) ^ ((y>>1 & 1) * xtime(x)) ^ ((y>>2 & 1) * xtime(xtime(x))) ^ ((y>>3 & 1) * xtime(xtime(xtime(x)))) ^ ((y>>4 & 1) * xtime(xtime(xtime(xtime(x)))))) 11 | 12 | #pragma pack(8) 13 | typedef struct _CryptFile 14 | { 15 | UINT8 Nb; 16 | UINT8 state[4][4], RoundKey[240], BUFFER [16] , WriteBuffer [16] , AlignByte, IndexBuffer, *inBuffer, *OutBuffer; 17 | UINT8 Nr , Nk ; 18 | NTSTATUS LastErrorCode; 19 | UINT64 FilePosition , BufferPosition , RealFilePosition , WriteBufferPosition , FileSize ; 20 | SMFile hFile; 21 | }CryptFile; 22 | 23 | UINT64 GetCryptFileLength(CryptFile *osCryptFile); 24 | void CryptKeyExpansion(CryptFile *osCryptFile) ; 25 | UINT8 GetSBoxValue(UINT8 num); 26 | void AddRoundKey(CryptFile *osCryptFile, UINT8 round) ; 27 | void SubBytes(CryptFile *osCryptFile); 28 | void MixColumns(CryptFile *osCryptFile); 29 | void Cipher(CryptFile *osCryptFile); 30 | void ShiftRows(CryptFile *osCryptFile) ; 31 | 32 | FORCEINLINE void InvCipher(CryptFile *osCryptFile); 33 | FORCEINLINE void InvShiftRows(CryptFile *osCryptFile); 34 | FORCEINLINE void InvSubBytes(CryptFile *osCryptFile) ; 35 | FORCEINLINE void InvMixColumns(CryptFile *osCryptFile) ; 36 | FORCEINLINE UINT8 GetSBoxInvert(UINT8 num); 37 | 38 | BOOLEAN GetCryptedFilePosition (CryptFile *osCryptFile, UINT64 *Offset); 39 | void CryptedFileInit(CryptFile *osCryptFile); 40 | 41 | BOOLEAN CryptOpen(CryptFile *osCryptFile, WCHAR* szName); 42 | BOOLEAN CryptCreateFile(CryptFile *osCryptFile, WCHAR* szName); 43 | BOOLEAN CryptRead(CryptFile *osCryptFile, void *Data ,UINT32 *Size); 44 | BOOLEAN CryptWrite(CryptFile *osCryptFile, void *Data ,UINT32 *Size) ; 45 | BOOLEAN CryptSeek(CryptFile *osCryptFile, INT64 *Offset) ; 46 | BOOLEAN CryptClose(CryptFile *osCryptFile); 47 | BOOLEAN CryptSeekCurrent(CryptFile *osCryptFile, INT64 *Offset); 48 | #endif -------------------------------------------------------------------------------- /Guard/LoadDatFile.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Guard/LoadDatFile.h -------------------------------------------------------------------------------- /Guard/Log.c: -------------------------------------------------------------------------------- 1 | #include "log.h" 2 | #include 3 | 4 | #ifdef ALLOC_PRAGMA 5 | #pragma alloc_text(PAGE, _BufferLog_) 6 | #pragma alloc_text(PAGE, _PutLog_) 7 | #ifdef LOGTOFILE 8 | #pragma alloc_text(PAGE, CloseLogFile) 9 | #endif 10 | #endif 11 | 12 | #ifdef LOGTOFILE 13 | SMFile g_ocFile ; 14 | 15 | NTSTATUS InitLogFile () 16 | { 17 | return SMCreateFileForWrite(&g_ocFile , L"\\??\\C:\\IoMonitorlog.log"); 18 | } 19 | 20 | #endif 21 | #ifdef IOHOOKMONITOR 22 | SMFile g_ocIoMonitorFile ; 23 | NTSTATUS InitMonitorLogFile () 24 | { 25 | return SMCreateFileForWrite(&g_ocIoMonitorFile , L"\\??\\C:\\IoMonitor.log"); 26 | } 27 | void LogHookMonitor (char * StrMessage ) 28 | { 29 | ULONG ulbufferlen ; 30 | ulbufferlen = strlen(StrMessage) ; 31 | SMWriteFile( &g_ocIoMonitorFile , StrMessage , &ulbufferlen ) ; 32 | SMFlushBuffer( &g_ocIoMonitorFile ); 33 | } 34 | #endif 35 | 36 | //---------------------------------------------------------------- 37 | #ifdef LOGTOFILE 38 | void _PutLog_ ( WCHAR * StrMessage , NTSTATUS STATUS , ULONG line , char * Source) 39 | { 40 | char MsgBuffer[1024]; 41 | ULONG ulbufferlen ; 42 | sprintf(MsgBuffer ,"Jav message : %ws \r\n CodeMessage : %d \r\n Source : %s \r\n Line : line %d\n\r Process Id : %d \r\n" , StrMessage , STATUS , Source, line , PsGetCurrentProcessId() ) ; 43 | ulbufferlen = strlen(MsgBuffer) ; 44 | SMWriteFile( &g_ocFile , MsgBuffer , &ulbufferlen ) ; 45 | SMFlushBuffer( &g_ocFile ); 46 | } 47 | #else 48 | //---------------------------------------------------------------- 49 | void _PutLog_ ( WCHAR * StrMessage , NTSTATUS STATUS , ULONG line , char * Source) 50 | { 51 | DbgPrint ( "Jav message : %ws \r\n CodeMessage : %d \r\n Source : %s \r\n Line : line %d\r\n Process Id : %d \r\n" , StrMessage , STATUS , Source, line , PsGetCurrentProcessId() ) ; 52 | } 53 | #endif 54 | //---------------------------------------------------------------- 55 | #ifdef LOGTOFILE 56 | void _BufferLog_ (char * StrMessage , WCHAR * Buffer , ULONG line , char * Source) 57 | { 58 | char MsgBuffer[1024]; 59 | ULONG ulbufferlen ; 60 | sprintf(MsgBuffer , "Jav message : %s \r\n Buffer : %ws \r\n Source : %s \r\n Line : line %d \r\n Process Id : %d \r\n" , StrMessage , Buffer , Source, line , PsGetCurrentProcessId() ) ; 61 | ulbufferlen = strlen(MsgBuffer) ; 62 | SMWriteFile( &g_ocFile , MsgBuffer , &ulbufferlen ) ; 63 | SMFlushBuffer( &g_ocFile ); 64 | } 65 | #else 66 | //---------------------------------------------------------------- 67 | void _BufferLog_ (char * StrMessage , WCHAR * Buffer , ULONG line , char * Source) 68 | { 69 | char MsgBuffer[1024]; 70 | DbgPrint ( "Jav message : %s \r\n Buffer : %ws \r\n Source : %s \r\n Line : line %d \r\n Process Id : %d \r\n" , StrMessage , Buffer , Source, line , PsGetCurrentProcessId() ) ; 71 | } 72 | #endif 73 | //---------------------------------------------------------------- 74 | #ifdef LOGTOFILE 75 | void CloseLogFile() 76 | { 77 | ZwClose(g_ocFile.HFile); 78 | } 79 | #endif -------------------------------------------------------------------------------- /Guard/Log.h: -------------------------------------------------------------------------------- 1 | #ifndef __LOGHEADER__ 2 | #define __LOGHEADER__ 3 | 4 | #include "ntddk.h" 5 | #include "SMFile.h" 6 | 7 | #ifdef LOGTOFILE 8 | extern SMFile g_ocFile ; 9 | NTSTATUS InitLogFile (); 10 | void CloseLogFile(); 11 | #endif 12 | 13 | void _PutLog_ ( WCHAR * StrMessage , NTSTATUS STATUS , ULONG line , char * Source) ; 14 | void _BufferLog_ (char * StrMessage , WCHAR * Buffer , ULONG line , char * Source); 15 | #ifdef IOHOOKMONITOR 16 | NTSTATUS InitMonitorLogFile (); 17 | void LogHookMonitor (char * StrMessage ); 18 | #endif 19 | //void CloseLogFile(); 20 | #ifdef LOGEE 21 | #define PutLog( _hookExt, _call ) \ 22 | _PutLog_ ( _hookExt , _call ,__LINE__, __FILE__ ) 23 | #else 24 | #define PutLog( _hookExt, _call ) 25 | #endif 26 | 27 | #ifdef LOGEE 28 | #define SourceLogger( _MESS ) \ 29 | PutLog(L##_MESS , STATUS_SUCCESS) 30 | #else 31 | #define SourceLogger( _MESS ) 32 | #endif 33 | 34 | #ifdef LOGEE 35 | #define BufferLogger( _MESS, _call ) \ 36 | _BufferLog_(_MESS , _call,__LINE__, __FILE__ ) 37 | #else 38 | #define BufferLogger( _MESS, _call ) 39 | #endif 40 | #endif -------------------------------------------------------------------------------- /Guard/Mem.h: -------------------------------------------------------------------------------- 1 | #ifndef Mem_ADDED 2 | #define Mem_ADDED 3 | #include "All_Defines.h" 4 | 5 | 6 | // Function Prototypes 7 | 8 | BOOLEAN ReadMemory(VirtualMachine *posVm, UINT32 nAddress, UINT32 nSize, BOOLEAN bIsOpcodeMemory); 9 | BOOLEAN WriteMemory(VirtualMachine *posVm, UINT32 nAddress, UINT32 nSize); 10 | void SetMemory(UINT8 * Data, UINT32 Address, UINT8 Size); 11 | void PushStack (VirtualMachine *posVm, UINT32 Value); 12 | UINT32 PopStack(VirtualMachine *posVm); 13 | UINT32 InitMem(VirtualMachine *posVm); 14 | BOOLEAN ReadOpcodeMemory(VirtualMachine *posVm, UINT32 nAddress); 15 | UINT8* NextOpcodeMemory(VirtualMachine *posVm, UINT32 nSize); 16 | 17 | #endif -------------------------------------------------------------------------------- /Guard/MemoryTree.h: -------------------------------------------------------------------------------- 1 | // align to 512 2 | 3 | #ifndef MemoryTree_ADDED 4 | #define MemoryTree_ADDED 5 | #include "All_Defines.h" 6 | #include "avltree.h" 7 | 8 | #define DefaultSize 4096 9 | 10 | // Structure base on link list data structure used for memory tree emulation 11 | typedef struct _MemoryCreated 12 | { 13 | UINT32 nOffset; 14 | UINT8 nData[DefaultSize]; 15 | // MemoryCreated* posLeft; 16 | // MemoryCreated* posRight; 17 | } MemoryCreated; 18 | 19 | // Structure base on link list data structure used for free memory tree 20 | // typedef struct _MemoryDel 21 | // { 22 | // MemoryCreated * Current; 23 | // MemoryDel * Next; 24 | // }MemoryDel; 25 | 26 | // Function Prototypes 27 | BOOLEAN SMGetMemBuffer(VirtualMachine *posVm, UINT32 nOffset, UINT32 nSize); 28 | BOOLEAN SMSetMemBuffer(VirtualMachine *posVm, UINT32 nOffset, UINT32 nSize); 29 | 30 | __inline MemoryCreated* GetTreeNode (VirtualMachine *posVm, UINT32 nOffset); 31 | __inline MemoryCreated* SetTreeNode (VirtualMachine *posVm, UINT32 nOffset); 32 | 33 | ////////////////////////////////////////////////////////////////////////// 34 | FORCEINLINE INT32 CompareMemory(const void *pa, const void *pb, void *param) 35 | { 36 | if (((MemoryCreated *)pa)->nOffset == ((MemoryCreated *)pb)->nOffset) 37 | { 38 | return 0; 39 | } 40 | else if (((MemoryCreated *)pa)->nOffset > ((MemoryCreated *)pb)->nOffset) 41 | { 42 | return 1; 43 | } 44 | else 45 | { 46 | return -1; 47 | } 48 | } 49 | ////////////////////////////////////////////////////////////////////////// 50 | __inline void InitMemoryTree(VirtualMachine *posVm) 51 | { 52 | posVm->posMainMemoryTree = avl_create(NULL , NULL); 53 | } 54 | ////////////////////////////////////////////////////////////////////////// 55 | __inline void DestroyMemoryTree(VirtualMachine *posVm) 56 | { 57 | avl_destroy(posVm->posMainMemoryTree); 58 | } 59 | #endif -------------------------------------------------------------------------------- /Guard/OwnDispatch.h: -------------------------------------------------------------------------------- 1 | #ifndef __OWNDISPATCH__ 2 | #define __OWNDISPATCH__ 3 | 4 | typedef struct __BITFILDMASK 5 | { 6 | unsigned char Mask:1 ; 7 | 8 | }BITFILDMASK , * PBITFILDMASK ; 9 | 10 | typedef struct __MASK 11 | { 12 | BITFILDMASK Byte[32] ; 13 | 14 | } MASK , *PMASK ; 15 | 16 | 17 | NTSTATUS OwnDefualtRutin (IN PDEVICE_OBJECT DeviceObject,IN PIRP Irp , PIO_STACK_LOCATION irpStack ); 18 | 19 | NTSTATUS DeviceControlRutin (IN PDEVICE_OBJECT DeviceObject,IN PIRP Irp , PIO_STACK_LOCATION irpStack ); 20 | 21 | NTSTATUS DeviceFsControl (IN PDEVICE_OBJECT DeviceObject,IN PIRP Irp , PIO_STACK_LOCATION irpStack ); 22 | 23 | NTSTATUS UserAttachDevice (IN PDEVICE_OBJECT DeviceObject , ULONG InputBufferLength , ULONG OutputBufferLength , PVOID SystemBuffer) ; 24 | 25 | NTSTATUS UserDeAttachDevice (IN PDEVICE_OBJECT DeviceObject , ULONG InputBufferLength , ULONG OutputBufferLength , PVOID SystemBuffer) ; 26 | 27 | NTSTATUS GetEvent (IN PDEVICE_OBJECT DeviceObject , ULONG InputBufferLength , ULONG OutputBufferLength , PVOID SystemBuffer) ; 28 | 29 | NTSTATUS GetDeviceNameFromUser ( ULONG InputBufferLength , PVOID SystemBuffer) ; 30 | 31 | NTSTATUS DoScan( PULONG pulOutputBufferLength , PVOID pInputBuffer , PVOID pOutPutBuffer); 32 | 33 | NTSTATUS ReleaseResource (); 34 | 35 | NTSTATUS CloseFileForApp( PVOID pSystemBuffer); 36 | 37 | NTSTATUS SetFilePointerForApp( PULONG pulOutputBufferLength , PVOID pInputBuffer , PVOID pOutPutBuffer); 38 | 39 | NTSTATUS ReadFileForApp (ULONG ulBufferSize , PULONG pulReadCount , PVOID pInputBuffer , PVOID pOutBuffer); 40 | 41 | NTSTATUS WriteFileForApp (ULONG InputBufferLength , PULONG pulOutputBufferLength , PVOID pSystemBuffer) ; 42 | 43 | NTSTATUS CreadteFileForApp ( PULONG pulOutputBufferLength , PVOID InputBuffer , PVOID OutputBuffer) ; 44 | 45 | NTSTATUS GetFileAttribForApp( PULONG pulOutputBufferLength , PVOID pInpubuffer , PVOID pOutPutBuffer ); 46 | 47 | NTSTATUS DeleteFileForApp (PVOID pSystemBuffer); 48 | 49 | NTSTATUS GetFileSizeForApp( PULONG pulOutputBufferLength , PVOID pInputBuffer , PVOID pOutPutBuffer ); 50 | 51 | NTSTATUS OpenDrictory( PULONG o_pulOutPutLenght , PVOID pInpubuffer , PVOID pOutPutBuffer) ; 52 | 53 | NTSTATUS GetListDrictory ( ULONG uOutPutBufferLength , PULONG ulCountRead , PVOID pInpubuffer , PVOID pOutPutBuffer); 54 | 55 | NTSTATUS OpenTempFile (PULONG o_pulOutPutLenght , PVOID pSystemBuffer); 56 | 57 | NTSTATUS DeleteTempFile( PVOID pSystemBuffer ); 58 | 59 | NTSTATUS GetVirusNameByApp (PULONG o_pulOutLenght , ULONG i_pulLenght , PVOID pInputBuffer); 60 | 61 | NTSTATUS GetCleanOrDelete (PULONG o_pulOutLenght , ULONG i_pulLenght , PVOID pInputBuffer) ; 62 | 63 | NTSTATUS GetProcessId ( PVOID pSystemBuffer ) ; 64 | 65 | NTSTATUS SetGlobalConfigFlage(UINT32 u32Config) ; 66 | 67 | NTSTATUS ClearGlobalConfigFlage(UINT32 u32Config) ; 68 | 69 | NTSTATUS SetGlobalConfigFlage(UINT32 u32Config) ; 70 | 71 | NTSTATUS SetAppConfigFlage(UINT32 u32Config); 72 | 73 | NTSTATUS ClearAppConfigFlage(UINT32 u32Config); 74 | 75 | 76 | #ifdef IOHOOKMONITOR 77 | extern ULONG G_ulMonitorProcId ; 78 | #endif 79 | #endif -------------------------------------------------------------------------------- /Guard/SMBuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef __JBUFFER__ 2 | #define __JBUFFER__ 3 | #include "iomonitor.h" 4 | #include "log.h" 5 | 6 | typedef struct _ModuleDescriptor 7 | { 8 | unsigned __int64 Start , Limit ; 9 | BOOLEAN Used ; 10 | UCHAR *Pointer ; 11 | PMDL mdl; 12 | } SMModuleDescriptor; 13 | 14 | typedef struct _SMBuffer 15 | { 16 | __int64 Current ; 17 | PFileHandle File ; 18 | UINT32 Config ; 19 | PIRP Irp ; 20 | UCHAR *Buffer ; 21 | ULONG CountChunk ; 22 | ULONG CurrentBlock , ModuleSize ; 23 | PKEVENT phEvent; 24 | // LARGE_INTEGER FileSize ; 25 | unsigned __int64 FileSize ; 26 | SMModuleDescriptor *ModuleDescriptor ; 27 | } SMBuffer , *PSMBuffer; 28 | 29 | NTSTATUS SMBufferInit (IN PSMBuffer *ImpBuffer , ULONG CountModule , ULONG SizeOfModule ); 30 | NTSTATUS SMSetBufferFile (IN SMBuffer *ImpBuffer ) ; 31 | //NTSTATUS SetBufferFile4App( IN JBuffer *ImpBuffer , PFileHandle FH); 32 | BOOLEAN SMSetBufferPointer (SMBuffer *ImpBuffer ,unsigned __int64 Index) ; 33 | BOOLEAN SMSetRelativePointer (IN SMBuffer *ImpBuffer , int Index) ; 34 | PVOID SMGetBuffer(IN SMBuffer *ImpBuffer, ULONG SizeofBuffer ) ; 35 | PVOID SMGetBufferOffset(IN SMBuffer *ImpBuffer,unsigned __int64 Offset , ULONG SizeofBuffer ) ; 36 | PVOID SMGetBufferOffsetForMemTree( IN SMBuffer *ImpBuffer,unsigned __int64 Offset , ULONG SizeofBuffer ) ; 37 | 38 | void SMBufferUninitialize(SMBuffer **ImpBuffer); 39 | __inline PSbScaner SMGetBufferFromPool( IN PFileHandle FH ) 40 | { 41 | NTSTATUS status ; 42 | ULONG CurrentBufferPointer ; 43 | WCHAR log[100] ; 44 | PAGED_CODE(); 45 | status = KeWaitForSingleObject ( &GV.BufferSemaphore , Executive, KernelMode, FALSE, NULL); 46 | if ( !NT_SUCCESS(status) ) 47 | { 48 | PutLog(L"can not wait for single object" , status) ; 49 | return NULL ; 50 | } 51 | ExAcquireFastMutex (&GV.BufferPointerLock) ; 52 | { 53 | do 54 | { 55 | if (GV.StartBufferAccsess == COUNTFILEJBUFFER - 1 ) 56 | { 57 | GV.StartBufferAccsess = 0 ; 58 | } 59 | else 60 | { 61 | GV.StartBufferAccsess ++ ; 62 | } 63 | } while(GV.BufferPool[GV.StartBufferAccsess]->File != NULL) ; 64 | GV.BufferPool[GV.StartBufferAccsess]->File = FH ; 65 | CurrentBufferPointer = GV.StartBufferAccsess ; 66 | } 67 | ExReleaseFastMutex (&GV.BufferPointerLock) ; 68 | 69 | return GV.SbScanerPool[CurrentBufferPointer] ; 70 | } 71 | 72 | 73 | #endif -------------------------------------------------------------------------------- /Guard/SMFile.h: -------------------------------------------------------------------------------- 1 | #ifndef __JFILE__ 2 | #define __JFILE__ 3 | 4 | #include "iomonitor.h" 5 | 6 | typedef struct tagSMFile 7 | { 8 | HANDLE HFile ; 9 | ULONG ErrorCode ; 10 | }SMFile , *PSMFile ; 11 | typedef enum __MoveMethod__ { FBEGIN , FCURRENT , FEND } eSMSeekMethod ; 12 | NTSTATUS SMCreateFileForRead ( PSMFile posFile , WCHAR* FileName) ; 13 | NTSTATUS SMReadFileWithOffset ( PSMFile posFile , PUCHAR pucBuffer , PULONG pulLenght , PLARGE_INTEGER liByteOffset ) ; 14 | NTSTATUS SMReadFile( PSMFile posFile , PVOID pucBuffer , PULONG ulLenght ); 15 | NTSTATUS SMCloseFile(PSMFile posFile); 16 | NTSTATUS SMSeekFile (PSMFile posFile , PLARGE_INTEGER pliFileOffset); 17 | NTSTATUS SMSeekFileCurrent (PSMFile posFile , PLARGE_INTEGER pliFileOffset); 18 | NTSTATUS SMWriteFileWithOffset ( PSMFile posFile , PUCHAR pucBuffer , PULONG pulLenght , PLARGE_INTEGER liByteOffset ); 19 | NTSTATUS SMWriteFile( PSMFile posFile , PVOID pucBuffer , PULONG pulLenght ); 20 | NTSTATUS SMOpenFile4Kernel( PSMFile posFile , PWCHAR pwcsFileName , ULONG ulDesiredAccess ,ULONG ulShareAccess , PDEVICE_OBJECT pvDevice ); 21 | NTSTATUS SMCreateFileByApp( PSMFile posFile , PWCHAR pwcsFileName ,ULONG u32DesiredAccess , ULONG ulShareAccess , ULONG u32CreationDisposition , UINT32 u32FlagsAndAttributes ,ULONG ulCreateOptions , PDEVICE_OBJECT pvDevice ); 22 | NTSTATUS SMCreateFileForWrite ( PSMFile posFile , WCHAR* FileName); 23 | NTSTATUS SMGetFileLength ( PSMFile posFile, PLARGE_INTEGER dnFileSize ); 24 | NTSTATUS SMTruncate ( PSMFile posFile ); 25 | NTSTATUS GetFilePointer( PSMFile posFile , PLARGE_INTEGER pu64CurrentOffset) ; 26 | NTSTATUS SMFlushBuffer( PSMFile posFile ) ; 27 | NTSTATUS SMFileDelete ( PSMFile posFile ) ; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /Guard/SMTypeDefine.h: -------------------------------------------------------------------------------- 1 | #ifndef __SMTYPEDEFINE__ 2 | #define __SMTYPEDEFINE__ 3 | 4 | typedef unsigned __int8 UINT8 ; 5 | 6 | typedef unsigned __int16 UINT16 ; 7 | 8 | typedef unsigned __int32 UINT32 ; 9 | 10 | typedef unsigned __int64 UINT64 ; 11 | 12 | typedef __int64 INT64 ; 13 | 14 | typedef signed __int8 INT8 ; 15 | 16 | typedef signed __int16 INT16 ; 17 | 18 | typedef signed __int32 INT32 ; 19 | 20 | typedef signed __int64 INT64 ; 21 | 22 | typedef unsigned long ULONG ; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Guard/SOURCES: -------------------------------------------------------------------------------- 1 | TARGETNAME=IOMONITOR 2 | 3 | TARGETPATH=OBJ 4 | 5 | TARGETTYPE=DRIVER 6 | 7 | TARGETLIBS= $(TARGETLIBS) 8 | 9 | SOURCES=iomonitor.c \ 10 | IFunc.c \ 11 | FilterDispatch.c \ 12 | Log.c \ 13 | OwnDispatch.c \ 14 | FastIo.c \ 15 | FileApiBYIRP.c \ 16 | AvlTree.c \ 17 | BinaryTranslate.c \ 18 | CPU.c \ 19 | DatFileEnumator.c \ 20 | DatFileLoader.c \ 21 | DebugHeader.c \ 22 | FileInformation.c \ 23 | Header.c \ 24 | Hook.c \ 25 | iomonitor.c \ 26 | JDecryptedFile.c \ 27 | LoadDatFile.c \ 28 | Mem.c \ 29 | MemoryTree.c \ 30 | OperationsFunctions.c \ 31 | PatMatchUtility.c \ 32 | SbScaner.c \ 33 | ScanImp.c \ 34 | SMBuffer.c \ 35 | SMFile.c \ 36 | StateMachine.c \ 37 | VirtualMachine.c -------------------------------------------------------------------------------- /Guard/SbScaner.h: -------------------------------------------------------------------------------- 1 | #ifndef __SBSCANER__ 2 | #define __SBSCANER__ 3 | #include "FileInformation.h" 4 | #include "SMBuffer.h" 5 | #include "DatFileEnumator.h" 6 | #include "SMTypeDefine.h" 7 | 8 | typedef struct _SbScaner 9 | { 10 | PSMBuffer m_pocBuffer ; 11 | PFileInformation m_pocFileInfo ; 12 | PDatFileParser m_pocDatFileParser ; 13 | UINT32 m_u32VirusId ; 14 | BOOLEAN m_bIsPolyVirus ; 15 | PSMVirtualMachineStack m_posVmStack; 16 | } SbScaner , *PSbScaner ; 17 | 18 | void ResetAllFileCounter (PSbScaner i_posSbScaner); 19 | __inline void InitSbScaner(PSbScaner i_posSbScaner , PDatFileParser i_posDatFileParser , PSMBuffer i_pocBuffer, PSMVirtualMachineStack i_posVmStack) 20 | { 21 | i_posSbScaner->m_pocDatFileParser = i_posDatFileParser ; 22 | i_posSbScaner->m_pocBuffer = i_pocBuffer ; 23 | i_posSbScaner->m_posVmStack = i_posVmStack ; 24 | } 25 | //-------------------------------------------------------------------------- 26 | __inline void SetFileContext( PSbScaner i_posSbScaner , PFileInformation i_pocFileInfo ) 27 | { 28 | IncreseFileCounter(i_posSbScaner->m_pocDatFileParser) ; 29 | if (i_posSbScaner->m_pocDatFileParser->m_u32FileCounter == 0xffffffff) 30 | { 31 | ResetAllFileCounter(i_posSbScaner); 32 | } 33 | i_posSbScaner->m_pocFileInfo = i_pocFileInfo ; 34 | } 35 | //-------------------------------------------------------------------------- 36 | __inline char* GetVirusName(PSbScaner i_posSbScaner) 37 | { 38 | return ReadVirusName(i_posSbScaner->m_pocDatFileParser , i_posSbScaner->m_u32VirusId); 39 | } 40 | //-------------------------------------------------------------------------- 41 | __inline void FreeMemVirusName(PSbScaner i_posSbScaner) 42 | { 43 | FreeVirusName(i_posSbScaner->m_pocDatFileParser); 44 | } 45 | //--------------------------------------------------------------------------- 46 | BOOLEAN GetSet(PSbScaner i_posSbScaner); 47 | BOOLEAN IsInfectetPackedVirus (PSbScaner i_posSbScaner) ; 48 | #endif -------------------------------------------------------------------------------- /Guard/ScanImp.h: -------------------------------------------------------------------------------- 1 | #ifndef __SCANIMP__ 2 | #define __SCANIMP__ 3 | #include "iomonitor.h" 4 | 5 | NTSTATUS ScanFile( IN PFileHandle FH ) ; 6 | NTSTATUS DeleteVirus(IN PFileHandle i_pocFH); 7 | 8 | #endif -------------------------------------------------------------------------------- /Guard/VirtualMachine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef VirtualMachine_ADDED 3 | #define VirtualMachine_ADDED 4 | 5 | #include "FileInformation.h" 6 | #include "All_Defines.h" 7 | #include "StateMachine.h" 8 | 9 | 10 | // Function Prototypes 11 | 12 | void VM_Initialize(SMVirtualMachineStack *posVmStack, PFileInformation posInfoOFFile, PSMBuffer posBuffer, PFileHandle phFileHandle , UINT32 i_u32Config); 13 | UINT32 VM_Start(SMVirtualMachineStack *posVmStack); 14 | void DiscardMemory(VirtualMachine *posVm); 15 | VirtualMachine* CreateNewContext(PSMVirtualMachineStack posVmStack, VirtualMachine *posVm); 16 | //MemoryCreated * CreateSubMemory( MemoryCreated * posSourceMem , MemoryDel *posMemDel); 17 | #endif -------------------------------------------------------------------------------- /Guard/buildchk_wxp_x86.log: -------------------------------------------------------------------------------- 1 | BUILD: Computing Include file dependencies: 2 | BUILD: null byte at offset 0x00000003 3 | BUILD: 14793 null bytes in file 4 | BUILD: null byte at offset 0x00000003 5 | BUILD: 4274 null bytes in file 6 | BUILD: Examining c:\users\zare\documents\project\guard directory for files to compile. 7 | oacr invalidate root:x86chk /autocleanqueue 8 | 1>Compiling and Linking c:\users\zare\documents\project\guard ************* 9 | 1>'nmake.exe /nologo BUILDMSG=Stop. -i /nologo /f c:\winddk\7600.16385.0\bin\makefile.def BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1 MAKEDIR_RELATIVE_TO_BASEDIR=' 10 | 1>c:\users\zare\documents\project\guard: TARGETPATH is OBJ 11 | 1>BUILDMSG: _NT_TARGET_VERSION SET TO WINXP 12 | -------------------------------------------------------------------------------- /Guard/empty.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Guard/empty.c -------------------------------------------------------------------------------- /Guard/hook.h: -------------------------------------------------------------------------------- 1 | #ifndef __HOOK_H 2 | #define __HOOK_H 3 | #include "iomonitor.h" 4 | #ifdef IOHOOKMONITOR 5 | NTSTATUS HookApi(); 6 | #endif 7 | #endif -------------------------------------------------------------------------------- /Guard/iomonitor.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Guard/iomonitor.c -------------------------------------------------------------------------------- /Guard/iomonitor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Guard/iomonitor.h -------------------------------------------------------------------------------- /Gui/Folder-Default-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/Folder-Default-icon.png -------------------------------------------------------------------------------- /Gui/Orginal1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/Orginal1.png -------------------------------------------------------------------------------- /Gui/Orginal2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/Orginal2.png -------------------------------------------------------------------------------- /Gui/Orginal3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/Orginal3.png -------------------------------------------------------------------------------- /Gui/Orginal4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/Orginal4.png -------------------------------------------------------------------------------- /Gui/Orginal5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/Orginal5.png -------------------------------------------------------------------------------- /Gui/Orginal6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/Orginal6.png -------------------------------------------------------------------------------- /Gui/Orginal7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/Orginal7.png -------------------------------------------------------------------------------- /Gui/Orginal8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/Orginal8.png -------------------------------------------------------------------------------- /Gui/Orginal9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/Orginal9.png -------------------------------------------------------------------------------- /Gui/Scan.pro: -------------------------------------------------------------------------------- 1 | ###################################################################### 2 | # Automatically generated by qmake (2.01a) ???????? ????? 1 16:31:20 2012 3 | ###################################################################### 4 | 5 | TEMPLATE = app 6 | TARGET = 7 | DEPENDPATH += . business debug 8 | INCLUDEPATH += . 9 | QT += xml 10 | # Input 11 | HEADERS += extendedfilesystem.h \ 12 | linllabel.h \ 13 | main.h \ 14 | myThreadHandler.h \ 15 | pathselect.h \ 16 | reportofscan_dialog.h \ 17 | resource.h \ 18 | scan.h \ 19 | setting.h \ 20 | business/AsyncRPCc.h \ 21 | business/AVEngine_AsyncRPC_h.h \ 22 | aboutus.h 23 | FORMS += pathselect.ui reportofscan_dialog.ui scan.ui setting.ui \ 24 | aboutus.ui 25 | SOURCES += extendedfilesystem.cpp \ 26 | #line.cpp \ 27 | linllabel.cpp \ 28 | main.cpp \ 29 | myThreadHandler.cpp \ 30 | pathselect.cpp \ 31 | reportofscan_dialog.cpp \ 32 | scan.cpp \ 33 | setting.cpp \ 34 | business/AsyncRPCc.cpp \ 35 | business/AVEngine_AsyncRPC_c.c \ 36 | aboutus.cpp 37 | RESOURCES += sorce.qrc 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Gui/Scan.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Scan", "Scan.vcxproj", "{53FF0C92-EFF8-30F3-A994-E60AC79CFC2A}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {53FF0C92-EFF8-30F3-A994-E60AC79CFC2A}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {53FF0C92-EFF8-30F3-A994-E60AC79CFC2A}.Debug|Win32.Build.0 = Debug|Win32 14 | {53FF0C92-EFF8-30F3-A994-E60AC79CFC2A}.Release|Win32.ActiveCfg = Release|Win32 15 | {53FF0C92-EFF8-30F3-A994-E60AC79CFC2A}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /Gui/Scan.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/Scan.suo -------------------------------------------------------------------------------- /Gui/Scan.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /Gui/aboutus.cpp: -------------------------------------------------------------------------------- 1 | #include "aboutus.h" 2 | #include "ui_aboutus.h" 3 | 4 | AboutUs::AboutUs(QWidget *parent) : 5 | QDialog(parent), 6 | ui(new Ui::AboutUs) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | AboutUs::~AboutUs() 12 | { 13 | delete ui; 14 | } 15 | 16 | void AboutUs::on_pushButton_clicked() 17 | { 18 | AboutUs::close(); 19 | } 20 | -------------------------------------------------------------------------------- /Gui/aboutus.h: -------------------------------------------------------------------------------- 1 | #ifndef ABOUTUS_H 2 | #define ABOUTUS_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class AboutUs; 8 | } 9 | 10 | class AboutUs : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit AboutUs(QWidget *parent = 0); 16 | ~AboutUs(); 17 | 18 | private slots: 19 | void on_pushButton_clicked(); 20 | 21 | private: 22 | Ui::AboutUs *ui; 23 | }; 24 | 25 | #endif // ABOUTUS_H 26 | -------------------------------------------------------------------------------- /Gui/aboutus.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AboutUs 4 | 5 | 6 | 7 | 0 8 | 0 9 | 361 10 | 212 11 | 12 | 13 | 14 | ضد‌بد‌افزار حافظ 15 | 16 | 17 | #AboutUs 18 | { 19 | 20 | background-image: url(:/image/backForm.png); 21 | } 22 | 23 | 24 | 25 | 26 | 260 27 | 180 28 | 75 29 | 23 30 | 31 | 32 | 33 | بستن 34 | 35 | 36 | 37 | 38 | 39 | 30 40 | 40 41 | 301 42 | 131 43 | 44 | 45 | 46 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 47 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 48 | p, li { white-space: pre-wrap; } 49 | </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> 50 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">آنتی ویروس حافظ</span></p> 51 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">صنایع امنیت فناوری اطلاعات و ارتباطات (صافاوا) ایران</span></p> 52 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">تیم ضد بدافزار </span></p> 53 | <p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p> 54 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"><br /></span></p></body></html> 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Gui/arrow-left-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/arrow-left-icon.png -------------------------------------------------------------------------------- /Gui/arrow-right-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/arrow-right-icon.png -------------------------------------------------------------------------------- /Gui/detail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/detail.png -------------------------------------------------------------------------------- /Gui/down-icon.png: -------------------------------------------------------------------------------- 1 | 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- /Gui/extendedfilesystem.h: -------------------------------------------------------------------------------- 1 | #ifndef EXTENDEDFILESYSTEM_H 2 | #define EXTENDEDFILESYSTEM_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | 10 | 11 | 12 | class ExtendedFileSystem : public QFileSystemModel 13 | { 14 | Q_OBJECT 15 | public: 16 | ExtendedFileSystem(); 17 | virtual int columnCount ( const QModelIndex & parent = QModelIndex() ) const ; 18 | virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; 19 | virtual QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const; 20 | virtual Qt::ItemFlags flags ( const QModelIndex & index ) const; 21 | virtual bool setData ( const QModelIndex & idx, const QVariant & value, int role = Qt::EditRole ); 22 | QVector m_vchanged; 23 | QVector m_Partially; 24 | 25 | protected: 26 | virtual bool event ( QEvent * event ); 27 | 28 | private : 29 | bool RemoveCheked(QModelIndex const & index); 30 | bool Removeparirity(QModelIndex const & index); 31 | 32 | 33 | 34 | }; 35 | 36 | #endif EXTENDEDFILESYSTEM_H 37 | -------------------------------------------------------------------------------- /Gui/gear_wheel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/gear_wheel.png -------------------------------------------------------------------------------- /Gui/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/header.png -------------------------------------------------------------------------------- /Gui/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/help.png -------------------------------------------------------------------------------- /Gui/help_icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/help_icon.jpg -------------------------------------------------------------------------------- /Gui/jsScan.js: -------------------------------------------------------------------------------- 1 | function func() { 2 | 3 | 4 | } 5 | -------------------------------------------------------------------------------- /Gui/linllabel.cpp: -------------------------------------------------------------------------------- 1 | #include "linllabel.h" 2 | #include "scan.h" 3 | #include "ui_scan.h" 4 | 5 | linllabel::linllabel(QWidget * parent , Qt::WindowFlags f ) : QLabel(parent , f) 6 | { 7 | 8 | } 9 | 10 | void linllabel::mousePressEvent(QMouseEvent *ev) 11 | { 12 | emit clicked(2); 13 | } 14 | -------------------------------------------------------------------------------- /Gui/linllabel.h: -------------------------------------------------------------------------------- 1 | #ifndef LINLLABEL_H 2 | #define LINLLABEL_H 3 | #include "QLabel" 4 | 5 | class linllabel: public QLabel 6 | { 7 | Q_OBJECT 8 | public: 9 | linllabel(QWidget * parent = 0, Qt::WindowFlags f = 0); 10 | void mousePressEvent(QMouseEvent *ev); 11 | //QLabel *link; 12 | 13 | // ~linllabel(); 14 | 15 | signals: 16 | 17 | void clicked(int); 18 | 19 | }; 20 | 21 | #endif // LINLLABEL_H 22 | -------------------------------------------------------------------------------- /Gui/main.cpp: -------------------------------------------------------------------------------- 1 | #ifndef MAIN_CPP 2 | #define MAIN_CPP 3 | #include "main.h" 4 | #include "scan.h" 5 | scan *MainDlg; 6 | 7 | 8 | int main(int argc, char *argv[]) 9 | { 10 | QApplication app(argc, argv); 11 | QPixmap pixmap(":/icons/header.png"); 12 | QSplashScreen splash(pixmap); 13 | waitForInitaization=true; 14 | splash.setGeometry((app.desktop()->geometry().x() + app.desktop()->geometry().width())/2 - 250 , (app.desktop()->geometry().y() + app.desktop()->geometry().height() ) / 2 -150,500,300); 15 | splash.show(); 16 | app.setStyleSheet("QPushButton {" 17 | " border: 2px solid #8f8f91;" 18 | " border-radius: 2px;" 19 | " background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1," 20 | " stop: 0 #f6f7fa, stop: 1 #dadbde);" 21 | " min-width: 70px;" 22 | " min-height:20px" 23 | "}" 24 | " QPushButton:pressed {" 25 | " background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1," 26 | " stop: 0 #dadbde, stop: 1 #f6f7fa);" 27 | "}" 28 | "QPushButton:flat {" 29 | " border: none; /* no border for a flat push button */" 30 | "}" 31 | "QPushButton:default {" 32 | "border-color: navy; /* make the default button prominent */" 33 | "}"); 34 | 35 | QCoreApplication::setOrganizationName("Safava"); 36 | QCoreApplication::setOrganizationDomain("Safava.com"); 37 | QCoreApplication::setApplicationName("Hafez"); 38 | 39 | ////////////////////////////////////////////////////////////////////////// 40 | 41 | MainDlg = new scan; 42 | MainDlg->setExtendedPathSelect(new PathSelect()); 43 | MainDlg->setWindowIcon(QIcon(":/icons/gear_wheel.png")); 44 | MainDlg->setFixedSize(740,470); 45 | 46 | QPalette palette; 47 | palette.setBrush(MainDlg->backgroundRole(), QBrush(QImage(":/image/backForm.png"))); 48 | MainDlg->setPalette(palette); 49 | 50 | splash.showMessage("loading ..."); 51 | while(waitForInitaization) 52 | { 53 | app.processEvents(QEventLoop::AllEvents,100); 54 | } 55 | MainDlg->show(); 56 | 57 | splash.finish(MainDlg); 58 | 59 | return app.exec(); 60 | } 61 | 62 | void signalWaitForInit() 63 | { 64 | waitForInitaization=false; 65 | } 66 | 67 | #endif MAIN_CPP 68 | -------------------------------------------------------------------------------- /Gui/main.h: -------------------------------------------------------------------------------- 1 | #ifndef MAIN_H 2 | #define MAIN_H 3 | 4 | #include 5 | #include "scan.h" 6 | #include "QLabel" 7 | #include "QGraphicsEffect" 8 | #include "QIcon" 9 | #include "QDesktopWidget" 10 | 11 | 12 | 13 | bool waitForInitaization; 14 | int main(int argc, char *argv[]); 15 | void signalWaitForInit(); 16 | 17 | 18 | #endif MAIN_H 19 | 20 | 21 | -------------------------------------------------------------------------------- /Gui/next.png: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -------------------------------------------------------------------------------- /Gui/pathselect.cpp: -------------------------------------------------------------------------------- 1 | #include "pathselect.h" 2 | 3 | 4 | PathSelect::PathSelect(QWidget *parent) : 5 | QDialog(parent), 6 | ui(new Ui::PathSelect) 7 | { 8 | indexTypeScan=0;//default 9 | 10 | ui->setupUi(this); 11 | 12 | modelsystem = new ExtendedFileSystem(); 13 | modelsystem->setFilter(QDir::Dirs|QDir::NoDotAndDotDot|QDir::Hidden|QDir::System|QDir::AllEntries); 14 | modelsystem->setRootPath(QDir::currentPath()); 15 | ui->treeView_SelectPathScan->setModel(modelsystem); 16 | ui->treeView_SelectPathScan->setAlternatingRowColors(true); 17 | 18 | } 19 | 20 | 21 | PathSelect::~PathSelect() 22 | { 23 | delete ui; 24 | } 25 | 26 | void PathSelect::settingScan() 27 | { 28 | 29 | } 30 | 31 | void PathSelect::on_PathSelect_accepted() 32 | { 33 | 34 | } 35 | 36 | void PathSelect::on_buttonBox_rejected() 37 | { 38 | 39 | } 40 | 41 | void PathSelect::on_pushButton_Scan_clicked() 42 | { 43 | 44 | } 45 | 46 | void PathSelect::on_comboBox_ScanType_currentIndexChanged(int index) 47 | { 48 | indexTypeScan=index; 49 | } 50 | 51 | void PathSelect::on_saveButton_clicked() 52 | { 53 | 54 | } 55 | -------------------------------------------------------------------------------- /Gui/pathselect.h: -------------------------------------------------------------------------------- 1 | #ifndef PATHSELECT_H 2 | #define PATHSELECT_H 3 | #include 4 | #include "ui_pathselect.h" 5 | #include "extendedfilesystem.h" 6 | #include 7 | 8 | namespace Ui { 9 | class PathSelect; 10 | } 11 | 12 | class PathSelect : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit PathSelect(QWidget *parent = 0); 18 | int indexTypeScan; 19 | ExtendedFileSystem* modelsystem; 20 | ~PathSelect(); 21 | 22 | private slots: 23 | void on_saveButton_clicked(); 24 | void on_comboBox_ScanType_currentIndexChanged(int index); 25 | void on_pushButton_Scan_clicked(); 26 | void settingScan(); 27 | void on_PathSelect_accepted(); 28 | void on_buttonBox_rejected(); 29 | 30 | private: 31 | Ui::PathSelect *ui; 32 | 33 | //static DWORD WINAPI MakeExtendedPathList(); 34 | }; 35 | 36 | #endif // PATHSELECT_H 37 | -------------------------------------------------------------------------------- /Gui/reportofscan_dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef REPORTOFSCAN_DIALOG_H 2 | #define REPORTOFSCAN_DIALOG_H 3 | 4 | #include 5 | #include "AVEngine_AsyncRPC_h.h" 6 | #include "setting.h" 7 | #include "qtextstream.h" 8 | #include 9 | #include 10 | #define rootName "HafezLog" 11 | 12 | namespace Ui { 13 | class ReportOfScan_Dialog; 14 | } 15 | 16 | class ReportOfScan_Dialog : public QDialog 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit ReportOfScan_Dialog(QWidget *parent = 0,ScanEndJobReport* poScanEndJobReport=NULL); 22 | ~ReportOfScan_Dialog(); 23 | 24 | private: 25 | Ui::ReportOfScan_Dialog *ui; 26 | bool AppendXMLReport(); 27 | ScanEndJobReport oScanEndJobReport; 28 | private slots: 29 | void on_pushButton_clicked(); 30 | }; 31 | 32 | #endif // REPORTOFSCAN_DIALOG_H 33 | -------------------------------------------------------------------------------- /Gui/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by scan.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /Gui/resource1.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/resource1.h -------------------------------------------------------------------------------- /Gui/scan.h: -------------------------------------------------------------------------------- 1 | #ifndef SCAN_H 2 | #define SCAN_H 3 | 4 | 5 | #include 6 | #include 7 | #include "pathselect.h" 8 | #include "business/AsyncRPCc.h" 9 | 10 | 11 | class QLabel; 12 | class QPushButton; 13 | class QGroupBox; 14 | class QTreeView; 15 | class QGridLayout; 16 | class QString; 17 | 18 | enum ScanState 19 | { 20 | RapidScan, 21 | ExtendedScan 22 | }; 23 | enum animateEnumLabelState 24 | { 25 | state1,state2,state3,state4,state5,state6,state7,state8,state9 26 | }; 27 | namespace Ui { 28 | class scan; 29 | } 30 | class linllabel ; 31 | class scan : public QWidget 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit scan(QWidget *parent = 0); 37 | ~scan(); 38 | void setExtendedPathSelect(PathSelect* pPathSet); 39 | int flag; 40 | bool m_bPuasecontinue; 41 | void setIconButton(int); 42 | void helpLabelStyle(); 43 | QTimer slomationTimerRapid; 44 | QTimer animateScanLabelTimer; 45 | void SetNextMessageShut(); 46 | void ShowScanProgress(); 47 | void ShowScanMeg(); 48 | void DoStartScan(); 49 | 50 | public slots : 51 | void StartTimerGetStatus(); 52 | private slots: 53 | 54 | void on_logButton_clicked(); 55 | void on_settingButton_clicked(); 56 | void on_stopScanButton_clicked(); 57 | void on_searchButton_clicked(); 58 | void on_CancelButton_clicked(); 59 | void on_Quarantine_clicked(); 60 | void set_LinkLabel(); 61 | void on_scanButton_clicked(); 62 | 63 | void trigerButtonClicked(); 64 | 65 | void slowmation_Show(); 66 | void aboutUsDialog(); 67 | void rapidScanStart(); 68 | void animateScanLabel(); 69 | QString pathSet(QString); 70 | 71 | private: 72 | Ui::scan *ui; 73 | PathSelect *pExtendedPathSelect ; 74 | QGridLayout *gridLayout_2; 75 | QTreeView *treeView; 76 | QGroupBox *m_pqgrpScanBox; 77 | quint32 m_u32Rapidheight; 78 | quint32 m_u32extendedLeftPading; 79 | quint32 m_u32extendedTopPading; 80 | QString m_strRapidStyle; 81 | ScanState m_enScanState ; 82 | animateEnumLabelState m_enanimateLabelState; 83 | eOperationResualtState m_oeResStartScan ; 84 | bool ShowScanWidget(); 85 | void ShowEndJobReport(); 86 | void rapidBox_Show(); 87 | void on_pauseScanButton_clicked(); 88 | void continueClicked(); 89 | //QString strLastPartPath; 90 | 91 | 92 | /////////////////////////business start///////////////////////////////////// 93 | StatusMessage m_osStatusMessage; 94 | ScanMessage m_osScanMsg; 95 | ScanConfig* scan::fetchRapidScanConfig(); 96 | bool scanStartController(ScanConfig *oScanConfig); 97 | int scanTypeIndex; 98 | 99 | /////////////////////////business end///////////////////////////////////// 100 | }; 101 | #endif // SCAN_H 102 | -------------------------------------------------------------------------------- /Gui/scanprogess.cpp: -------------------------------------------------------------------------------- 1 | #include "scanprogess.h" 2 | #include "ui_scanprogess.h" 3 | 4 | ScanProgess::ScanProgess(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::ScanProgess) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | ScanProgess::~ScanProgess() 12 | { 13 | delete ui; 14 | } 15 | -------------------------------------------------------------------------------- /Gui/scanprogess.h: -------------------------------------------------------------------------------- 1 | #ifndef SCANPROGESS_H 2 | #define SCANPROGESS_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class ScanProgess; 8 | } 9 | 10 | class ScanProgess : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit ScanProgess(QWidget *parent = 0); 16 | ~ScanProgess(); 17 | 18 | private: 19 | Ui::ScanProgess *ui; 20 | }; 21 | 22 | #endif // SCANPROGESS_H 23 | -------------------------------------------------------------------------------- /Gui/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/search.png -------------------------------------------------------------------------------- /Gui/setting.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTING_H 2 | #define SETTING_H 3 | #include "AVEngine_AsyncRPC_h.h" 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | 10 | namespace Ui { 11 | class setting; 12 | } 13 | class QTreeWidgetItem; 14 | 15 | class QFileDialog ; 16 | class setting :public QWidget 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit setting(QWidget *parent = 0); 22 | static void GetPathLog(QString &o_qsrtResult); 23 | static eCleanOption GetCleanConfig(); 24 | ~setting(); 25 | 26 | private slots: 27 | void on_gbSystemActiviti_Toggel(bool on); 28 | void on_toolButton_BrowsPathSave_clicked(); 29 | void on_pushButton_MoveAllToExclude_clicked(); 30 | void on_pushButton_MoveSelectedToExclude_clicked(); 31 | void on_pushButton_MoveSelectedToInclude_clicked(); 32 | void on_pushButton_MoveAllToInclude_clicked(); 33 | void on_pushButton_AddInclude_clicked(); 34 | void on_pushButton_RemoveItem_clicked(); 35 | void on_okButton_clicked(); 36 | void on_pushButton_DefualtSettings_clicked(); 37 | void MyitemClicked( QTreeWidgetItem * item, int column); 38 | void on_toolButton_clicked(); 39 | 40 | private: 41 | Ui::setting *ui; 42 | QSettings m_qSetting; 43 | QFileDialog* getPathFileLogDialog(); 44 | void fullDefualtExtensions(); 45 | 46 | void writeDefaultConfig(); 47 | void updateConfig(); 48 | bool isBeforeConfigExist(); 49 | void readConfigFormReg(); 50 | }; 51 | 52 | #endif // SETTING_H 53 | -------------------------------------------------------------------------------- /Gui/settingLabel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/settingLabel.png -------------------------------------------------------------------------------- /Gui/sorce.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | treemodelConfig.txt 4 | image/scan.png 5 | image/log.png 6 | image/scan_clicked.png 7 | image/log_clicked.png 8 | image/setting.png 9 | image/setting_clicked.png 10 | image/add.png 11 | image/accept.png 12 | image/remove.png 13 | image/backForm.png 14 | image/scanLabel.png 15 | image/Quarantine.png 16 | image/Quarantine_clicked.png 17 | settingLabel.png 18 | image/Quarantine_Label.png 19 | image/logLabel.png 20 | 21 | 22 | Orginal9.png 23 | Orginal1.png 24 | Orginal2.png 25 | Orginal3.png 26 | Orginal4.png 27 | Orginal5.png 28 | Orginal6.png 29 | Orginal7.png 30 | Orginal8.png 31 | 32 | 33 | gear_wheel.png 34 | header.png 35 | down-icon.png 36 | search.png 37 | next.png 38 | help.png 39 | help_icon.jpg 40 | 41 | 42 | -------------------------------------------------------------------------------- /Gui/stop.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Gui/stop.ico -------------------------------------------------------------------------------- /Gui/treemodelConfig.txt: -------------------------------------------------------------------------------- 1 | Parent1 2 | Child1 3 | GrandChild1 4 | GrandChild2 5 | GrandChild3 6 | GrandGrandChild1 7 | Child2 8 | GrandChild1 9 | GrandGrandChild1 10 | GrandChild2 11 | Child3 12 | 13 | Parent2 14 | Child1 15 | GrandChild1 16 | Child2 17 | Child3 18 | GrandChild1 19 | GrandChild2 20 | 21 | -------------------------------------------------------------------------------- /JAVEnumator/JEnumerator.h: -------------------------------------------------------------------------------- 1 | #ifndef __JENUMERATOR__ 2 | #define __JENUMERATOR__ 3 | #include "BaseObject.h" 4 | #include "FileSystemEnumerator.h" 5 | #include "IUnCompersser.h" 6 | #include "JModuleEnumetor.h" 7 | #include "Unrar.h" 8 | #include "JZipEnumerator.h" 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | class JEnumerator ; 15 | typedef BOOLEAN (JEnumerator::*PHasNextFile)() ; 16 | typedef JFile* (JEnumerator::*PGetFile)(); 17 | typedef void (JEnumerator::*PCloseFile)(); 18 | 19 | extern PHasNextFile HasNextFile ; 20 | extern PGetFile GetFile ; 21 | extern PCloseFile CloseFile ; 22 | class JEnumerator : public BaseObject 23 | { 24 | public : 25 | JEnumerator ( JString SrearchPath , BOOLEAN DoNotMemoryScan =FALSE,BOOLEAN PrcessScan = FALSE,BOOLEAN ModuleScan = FALSE, BOOLEAN ServiceScan = FALSE, BOOLEAN ZIP = FALSE , BOOLEAN RAR = FALSE) ; 26 | UINT8 GetPercent(); 27 | UINT32 GetFileCount() ; 28 | UINT32 GetCompressFileCount(); 29 | queue * GetMessagequeue(); 30 | void AddMessage(JString &i_StrMsg); 31 | void SetFilter(const wchar_t *szFilterString); 32 | ~JEnumerator(); 33 | private : 34 | IUnCompersser *m_piclsCommpress ; 35 | JModuleEnumerator *m_pocModuleEnumator ; 36 | JFileSysEnum *m_pocFileSystem ; 37 | JString m_strPath; 38 | queue MessageQueue ; 39 | list m_lsstrPath ; 40 | list m_FilterList ; 41 | stack m_stackCompFile; 42 | BOOLEAN FilterFile(JString ocFileName); 43 | JFile * GetCurrentFileSystemFile (); 44 | JFile * GetCurrentCommperssFile (); 45 | JFile * GetCurrentModuleFile (); 46 | void CloseCurrentFileSystemFile (); 47 | void CloseCurrentCommperssFile (); 48 | void CloseCurrentModuleFile (); 49 | BOOLEAN ModuleEnumator(); 50 | BOOLEAN FileSystemFristFile(); 51 | BOOLEAN FileSystemNextFile(); 52 | BOOLEAN CommpersEnumator (); 53 | BOOLEAN SetCommpersHandel (); 54 | BOOLEAN m_bZipFlag ; 55 | BOOLEAN m_bRarFlag ; 56 | BOOLEAN m_JustMemory ; 57 | UINT8 m_u8PerCent ; 58 | UINT32 m_u32FileCount ; 59 | UINT32 m_u32CompressFileCount ; 60 | UINT32 m_u32CommpressFileOpen ; 61 | inline IUnCompersser * CheckCCommpersFile(JFile *i_pclsFile); 62 | bool SplitSreachPath(JString &i_strSreachPath ); 63 | bool SetFileSysEnum(); 64 | }; 65 | inline UINT8 JEnumerator::GetPercent() 66 | { 67 | if (m_pocFileSystem) 68 | { 69 | return m_pocFileSystem->GetPercent(); 70 | } 71 | return m_u8PerCent ; 72 | } 73 | inline queue * JEnumerator::GetMessagequeue() 74 | { 75 | return &MessageQueue; 76 | } 77 | 78 | #endif -------------------------------------------------------------------------------- /JAVEnumator/JFileStreamEnumerator2.cpp: -------------------------------------------------------------------------------- 1 | #include "JFileStreamEnumerator.h" 2 | 3 | JFileStreamEnumerator::JFileStreamEnumerator (queue *i_MessageQueue) 4 | { 5 | MessageQueue = i_MessageQueue ; 6 | } 7 | 8 | BOOLEAN JFileStreamEnumerator::IsPathHaveStream( const TCHAR *i_strPath ) 9 | { 10 | TCHAR strVolumePathName[MAX_PATH] ; 11 | DWORD dwMaximumComponentLength , dwFileSystemFlags; 12 | if ( GetVolumePathName(i_strPath , strVolumePathName ,MAX_PATH ) == FALSE) 13 | { 14 | PutLog (CAN_NOT_GETVOLUMEPATHNAME); 15 | return FALSE ; 16 | } 17 | if ( GetVolumeInformation(strVolumePathName , NULL , 0 , NULL , &dwMaximumComponentLength, 18 | &dwFileSystemFlags , NULL , 0) == FALSE ) 19 | { 20 | PutLog(CAN_NOT_GETVOLUMEINFORMATION); 21 | return FALSE ; 22 | } 23 | if ( dwFileSystemFlags & FILE_NAMED_STREAMS ) 24 | { 25 | return TRUE ; 26 | } 27 | return FALSE ; 28 | } 29 | void JFileStreamEnumerator::CloseEnum() 30 | { 31 | m_ocFindFile.FindStreamClose(); 32 | } 33 | -------------------------------------------------------------------------------- /JAVEnumator/JFileStreamEnumerator2.h: -------------------------------------------------------------------------------- 1 | #ifndef JFILESTREAMENUMERATORH 2 | #define JFILESTREAMENUMERATORH 3 | #include "baseobject.h" 4 | #include "JFindFile.h" 5 | #include "JFile.h" 6 | #include "Msg.h" 7 | #include 8 | 9 | class JFileStreamEnumerator : public BaseObject 10 | { 11 | private : 12 | JFindFile m_ocFindFile; 13 | JFile m_ocFile; 14 | queue *MessageQueue; 15 | public : 16 | static BOOLEAN IsPathHaveStream(const TCHAR *i_strPath); 17 | JFileStreamEnumerator (queue *MessageQueue); 18 | BOOLEAN HazNextFile (); 19 | BOOLEAN HaveStream (wchar_t *i_strPath); 20 | BOOLEAN GetFile(); 21 | JFile* GetCurrentFile(); 22 | void CloseCurrentFile(); 23 | void CloseEnum(); 24 | }; 25 | 26 | inline BOOLEAN JFileStreamEnumerator::HaveStream (wchar_t *i_strPath) 27 | { 28 | return m_ocFindFile.FindFristFileStream(i_strPath); 29 | } 30 | 31 | inline BOOLEAN JFileStreamEnumerator::HazNextFile () 32 | { 33 | return m_ocFindFile.FindNextFileStream(); 34 | } 35 | 36 | inline JFile * JFileStreamEnumerator::GetCurrentFile () 37 | { 38 | if ( m_ocFile.Open(JString(m_ocFindFile.GetFindedStreamName())) == TRUE) 39 | { 40 | return &m_ocFile; 41 | } 42 | else 43 | { 44 | JString Message = JString(m_ocFindFile.GetFindedStreamName()); 45 | Message += JString(MSC(CANNOT_OPEN_THIS_FILE)); 46 | MessageQueue->push(Message); 47 | return NULL ; 48 | } 49 | } 50 | 51 | inline void JFileStreamEnumerator::CloseCurrentFile() 52 | { 53 | m_ocFile.Close(); 54 | } 55 | 56 | #endif -------------------------------------------------------------------------------- /JFilewraper/JCompressfile.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "JCompressfile.h" 3 | #ifdef JFILEKERNEL 4 | #include "FileIoByDevice.h" 5 | #endif 6 | 7 | JCompressFile::JCompressFile() 8 | { 9 | ClassId = guidCommpressFile; 10 | bIsInfected = FALSE; 11 | bIsWorm = FALSE; 12 | } 13 | 14 | void JCompressFile::SetCompressor(IUnCompersser *inposIUnCompersser) 15 | { 16 | posIUnCompersser = inposIUnCompersser; 17 | } 18 | 19 | JString JCompressFile::GetDisplayName () 20 | { 21 | return m_strDisPlayName ; 22 | } 23 | void JCompressFile::SetDisplayName (JString i_strDisplayName) 24 | { 25 | m_strDisPlayName = i_strDisplayName ; 26 | } 27 | 28 | void JCompressFile::SetFileAsVirus() 29 | { 30 | bIsInfected = TRUE; 31 | } 32 | 33 | void JCompressFile::SetFileAsWorm() 34 | { 35 | bIsWorm = TRUE; 36 | } 37 | 38 | 39 | BOOLEAN JCompressFile::CloseHandle() 40 | { 41 | return JFile::Close (); 42 | } 43 | 44 | BOOLEAN JCompressFile::Close() 45 | { 46 | JString strFileName = JFile::GetName(); 47 | if ( JFile::Close () == TRUE && !bIsInfected) 48 | { 49 | if (bIsWorm) 50 | { 51 | posIUnCompersser->SetDeleteIndex(posIUnCompersser->GetCurrentFileIndex()); 52 | #ifdef JFILEKERNEL 53 | return DeleteForTemp (strFileName); 54 | #else 55 | return JFile::Delete (strFileName) ; 56 | #endif 57 | } 58 | } 59 | else if (bIsInfected) 60 | { 61 | posIUnCompersser->SetDeleteIndex(posIUnCompersser->GetCurrentFileIndex()); 62 | posIUnCompersser->SetReplaceIndex(posIUnCompersser->GetCurrentFileNameinZip(), strFileName); 63 | return TRUE; 64 | } 65 | 66 | return FALSE ; 67 | } 68 | JCompressFile::~JCompressFile() 69 | { 70 | Close(); 71 | } 72 | //------------------------------------------------------------- 73 | #ifdef JFILEKERNEL 74 | BOOLEAN JCompressFile::OpenTempFile( JString &Name ) 75 | { 76 | hFile = CreateTempFileByDevice (Name.c_str()); 77 | if ( hFile == INVALID_HANDLE_VALUE ) 78 | { 79 | LastErrorCode = GetLastError(); 80 | return FALSE ; 81 | 82 | } 83 | m_strFileName = Name ; 84 | bFileSizeIsValid = FALSE ; 85 | return TRUE ; 86 | } 87 | //------------------------------------------------------------- 88 | BOOLEAN JCompressFile::DeleteForTemp(JString &Name) 89 | { 90 | if ( DeleteTempFileByApp(Name.c_str())) 91 | { 92 | return TRUE ; 93 | } 94 | return FALSE ; 95 | } 96 | #endif 97 | //------------------------------------------------------------- 98 | void JCompressFile::GetShortName(JString &o_strShortPath , UINT32 i_u32MaxLenght) 99 | { 100 | if ( i_u32MaxLenght < m_strDisPlayName.length() ) 101 | { 102 | o_strShortPath = m_strDisPlayName.substr(0 , (i_u32MaxLenght - 3) / 2 ) ; 103 | o_strShortPath += _T("...") ; 104 | o_strShortPath += m_strDisPlayName.substr(m_strDisPlayName.length() - ((i_u32MaxLenght - 3) / 2 ), ((i_u32MaxLenght - 3) / 2 ) ) ; 105 | } 106 | else 107 | { 108 | o_strShortPath = m_strDisPlayName ; 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /JFilewraper/JCompressfile.h: -------------------------------------------------------------------------------- 1 | #ifndef JCOMPRESSFILEH 2 | #define JCOMPRESSFILEH 3 | 4 | #include "Jfile.h" 5 | #include "IUnCompersser.h" 6 | 7 | class JCompressFile : public JFile 8 | { 9 | public : 10 | JCompressFile(); 11 | void SetCompressor(IUnCompersser *inposIUnCompersser); 12 | JString GetDisplayName () ; 13 | void SetDisplayName (JString i_strDisplayName) ; 14 | void GetShortName(JString &o_strShortPath , UINT32 MaxLenght) ; 15 | BOOLEAN Close(); 16 | BOOLEAN CloseHandle(); 17 | void SetFileAsVirus(); 18 | void SetFileAsWorm(); 19 | ~JCompressFile(); 20 | #ifdef JFILEKERNEL 21 | BOOLEAN OpenTempFile(JString &Name); 22 | static BOOLEAN DeleteForTemp(JString &Name); 23 | #endif 24 | 25 | private : 26 | JString m_strDisPlayName ; 27 | IUnCompersser *posIUnCompersser; 28 | BOOLEAN bIsInfected, bIsWorm; 29 | }; 30 | 31 | #endif -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 WhiteGroup 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LoadSbDatFile/DatFileStruct.h: -------------------------------------------------------------------------------- 1 | #ifndef DATFILESTRUCTH 2 | #define DATFILESTRUCTH 3 | #define MaxlenSetName 20 4 | #pragma pack (push , 1) 5 | 6 | #include "SMTypeDefine.h" 7 | typedef struct _tagSet 8 | { 9 | UINT32 OffsetSetName ; 10 | UINT8 SetNameLenght ; 11 | UINT8 SetOrVirus : 1 ; 12 | UINT8 CrcMatchCount ; 13 | UINT8 PatTypCount ; 14 | }tagSet; 15 | 16 | typedef struct _tagPattern 17 | { 18 | UINT16 PatternSize ; 19 | } tagPattern; 20 | 21 | typedef struct _tagCrcMatchInfo 22 | { 23 | UINT32 Start ; 24 | UINT32 End ; 25 | } tagCrcMatchInfo; 26 | 27 | typedef struct _tagCrcExtMatchInfo 28 | { 29 | UINT32 Start ; 30 | UINT32 Extended ; 31 | UINT32 End ; 32 | } tagCrcExtMatchInfo; 33 | 34 | typedef struct _tagOffset 35 | { 36 | UINT32 Offset ; 37 | UINT32 Counter ; 38 | } tagOffset; 39 | 40 | typedef struct _tagVirName 41 | { 42 | UINT32 VirusNameOffset ; 43 | UINT8 SizeName ; 44 | } tagVirName; 45 | 46 | typedef struct _tagChkVir 47 | { 48 | UINT64 CheckSum ; 49 | UINT32 VirusEntry ; 50 | } tagChkVir; 51 | 52 | typedef struct _tagSetMatchType 53 | { 54 | UINT32 MethodId ; 55 | UINT8 Type ; 56 | UINT8 TableIndex ; 57 | UINT32 CountVirusDetectViaMethod ; 58 | } tagSetMatchType; 59 | 60 | typedef struct _tagPatType 61 | { 62 | UINT32 PatternId ; 63 | UINT16 TypeCount ; 64 | } tagPatType; 65 | 66 | typedef struct _tagTypSet 67 | { 68 | UINT16 PatternType ; 69 | UINT16 SetCount; 70 | } tagTypSet; 71 | 72 | typedef struct _tagSetId 73 | { 74 | UINT16 SetID; 75 | } tagSetId; 76 | #pragma pack (pop , 8) 77 | #endif -------------------------------------------------------------------------------- /LoadSbDatFile/SMTypeDefine.h: -------------------------------------------------------------------------------- 1 | #ifndef __SMTYPEDEFINE__ 2 | #define __SMTYPEDEFINE__ 3 | 4 | typedef unsigned __int8 UINT8 ; 5 | 6 | typedef unsigned __int16 UINT16 ; 7 | 8 | typedef unsigned __int32 UINT32 ; 9 | 10 | typedef unsigned __int64 UINT64 ; 11 | 12 | typedef __int64 INT64 ; 13 | 14 | #endif -------------------------------------------------------------------------------- /LoadSbDatFile/loadDatFile.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/LoadSbDatFile/loadDatFile.cpp -------------------------------------------------------------------------------- /LoadSbDatFile/loadDatFile.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/LoadSbDatFile/loadDatFile.h -------------------------------------------------------------------------------- /Logger/JMessage.mc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Logger/JMessage.mc -------------------------------------------------------------------------------- /Logger/Logger.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 24 | 37 | 38 | 44 | 57 | 58 | 59 | 60 | 61 | 62 | 67 | 70 | 71 | 72 | 77 | 78 | 83 | 84 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /Logger/complie.bat: -------------------------------------------------------------------------------- 1 | mc -u -U JMessage.mc -------------------------------------------------------------------------------- /Md5/md5.h: -------------------------------------------------------------------------------- 1 | #ifndef MD5H 2 | #define MD5H 3 | #include "BaseObject.h" 4 | class Md5 : public BaseObject 5 | { 6 | private : 7 | UINT32 hash[4]; 8 | UINT32 bits[2]; 9 | UINT32 data[16]; 10 | static void md5_transform( UINT32 hash[ 4 ], const UINT32 data[ 16 ] ) ; 11 | public : 12 | Md5(); 13 | void Reset() ; 14 | void md5_update( const UINT8 *buf, UINT32 buflen ) ; 15 | void md5_final( UINT8 digest[ 16 ] ); 16 | }; 17 | 18 | 19 | #endif -------------------------------------------------------------------------------- /ModuleEnumerator/JModuleEnumetor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/ModuleEnumerator/JModuleEnumetor.cpp -------------------------------------------------------------------------------- /Quarantine/SMQuarantine.h: -------------------------------------------------------------------------------- 1 | #ifndef __SMQUARANTINE__ 2 | #define __SMQUARANTINE__ 3 | #include "BaseObject.h" 4 | #include "AVEngine_AsyncRPC_h.h" 5 | #include 6 | #include 7 | #include "md5.h" 8 | 9 | struct QuarantineBaseFileStructure 10 | { 11 | UINT32 u32ValidHeaderCount; 12 | UINT32 u32AllCount; 13 | UINT8 pu32MD5[16]; 14 | UINT64 u64FileSize; 15 | }; 16 | //extern struct QuarantineFileStructure; 17 | // { 18 | // SYSTEMTIME osTime; 19 | // UINT32 u32FileIndex; 20 | // UINT32 u32NameSize; 21 | // UINT32 u32PathSize; 22 | // UINT32 u32ReasonSize; 23 | // TCHAR szFileName [MAX_PATH]; 24 | // TCHAR szFullPath[MAX_PATH * 2]; 25 | // TCHAR szReason[MAX_PATH]; 26 | // }; 27 | 28 | struct Combine 29 | { 30 | JString szFileAddress; 31 | QuarantineBaseFileStructure* posBaseHQF; 32 | QuarantineFileStructure osHQF; 33 | }; 34 | 35 | class SMQuarantine 36 | { 37 | public: 38 | SMQuarantine(JString szQurantinePath); 39 | ~SMQuarantine() 40 | { 41 | //SMHeapFree(pszQuarantineList); 42 | map ::iterator it; 43 | for (it = ocQuarantineItems.begin(); it != ocQuarantineItems.end(); it++) 44 | { 45 | //DeAlloc(it->second.osHQF); 46 | } 47 | } 48 | //BOOLEAN GetQuarantinedFile(UINT32 u32Index); 49 | BOOLEAN Restore(UINT32 u32Index, JString *szPathToExtract) 50 | { 51 | if (ocQuarantineItems.find(u32Index) != ocQuarantineItems.end()) 52 | { 53 | if (RestoreTo(&ocQuarantineItems[u32Index], szPathToExtract)) 54 | { 55 | //DeAlloc(ocQuarantineItems[u32Index].osHQF); 56 | ocQuarantineItems.erase(u32Index); 57 | return TRUE; 58 | } 59 | } 60 | return FALSE; 61 | } 62 | // void DeAlloc(QuarantineFileStructure *posHQF) 63 | // { 64 | // DeAlloc(*posHQF); 65 | // SMHeapFree(posHQF); 66 | // } 67 | BOOLEAN RemoveFileFromQuarantine(UINT32 u32Index); 68 | BOOLEAN GetQuarantinedFileInfo(UINT32 u32Index, QuarantineFileStructure* posHQF); 69 | BOOLEAN MoveFileToQuarantine(JString szFileName, JString szReason); 70 | UINT32 GetCount() { return ocQuarantineItems.size();} 71 | 72 | 73 | private: 74 | pair MyPair; 75 | map ocQuarantineItems; 76 | 77 | //JString **pszQuarantineList; 78 | JString m_szQurantinePath; 79 | //QuarantineFileStructure *posQuarantineList; 80 | UINT32 u32Count; 81 | QuarantineFileStructure* GetFileInformation(JString szFileName, QuarantineBaseFileStructure *posBaseHQF); 82 | BOOLEAN RestoreTo(Combine* posCombine, JString *szPathToExtract); 83 | BOOLEAN CreateDirectories(JString szPath); 84 | 85 | //void DeAlloc(QuarantineFileStructure osHQF); 86 | }; 87 | 88 | #endif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JAV-AV-Engine 2 | a av windows engine with file guard and compress file enumator 3 | -------------------------------------------------------------------------------- /SbScaner/SbScaner.h: -------------------------------------------------------------------------------- 1 | #ifndef SBSCANERH 2 | #define SBSCANERH 3 | #include "BaseObject.h" 4 | #include "loadDatFile.h" 5 | #include "JFile.h" 6 | #include "FileInf.h" 7 | #include "JBuffer.h" 8 | #include 9 | 10 | class SbScaner : public BaseObject 11 | { 12 | private : 13 | JBuffer *m_pocBuffer ; 14 | FileInfo *m_pocFileInfo ; 15 | JFile *m_pocFile ; 16 | LoadDatFile *m_pocLoadDatFile ; 17 | UINT32 m_u32VirusId ; 18 | public : 19 | SbScaner(LoadDatFile *) ; 20 | void SetFileContext(JBuffer *i_pocBuffer ,FileInfo *i_pocFileInfo ,JFile *i_pocFile); 21 | BOOLEAN GetSet() ; 22 | BOOLEAN IsInfectetPackedVirus () ; 23 | BOOLEAN HasSameCrc (vector &Crc) ; 24 | char* GetCurrentSetName() ; 25 | char* GetVirusName (); 26 | void FreeMemVirusName () ; 27 | }; 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /ServiceManager/AVEngine.h: -------------------------------------------------------------------------------- 1 | #ifndef _AVEngine_ 2 | #define _AVEngine_ 3 | 4 | #include "Service.h" 5 | #include 6 | #include 7 | #include 8 | #include "AVEngine_AsyncRPC_h.h" // header file generated by MIDL compiler 9 | 10 | 11 | const int DEFAULT_MIN_CALLS = 1; 12 | const int DEFAULT_MAX_CALLS = 20; 13 | 14 | static PSECURITY_DESCRIPTOR pszSecurity = NULL; 15 | static DWORD dwThreadId; 16 | static HANDLE hThread; 17 | 18 | // PURPOSE: Server side main program 19 | // RPC Service for handling client Scan requests 20 | class AVEngine : Service 21 | { 22 | public: 23 | // RPC states changes by 24 | bool Start(); 25 | bool Stop(); 26 | bool Puase(); 27 | bool Continue(); 28 | 29 | private: 30 | // Setup RPC on server and wait in thread for listen client request specified in "AVEngine_AsyncRPC_h.h" and implemented at "AVEngine_AsyncRPC_Impl.cpp" server side 31 | static DWORD WINAPI SetupRPCServer(void* lpParam); 32 | // Quit when SetupRPCServer failed 33 | static void Quit(RPC_STATUS status); 34 | // Wait until thread have terminated, then Close all thread handles and free memory allocation. 35 | static bool CloseRPC(); 36 | }; 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /ServiceManager/AVEngine_AsyncRPC_Impl.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/ServiceManager/AVEngine_AsyncRPC_Impl.cpp -------------------------------------------------------------------------------- /ServiceManager/ImpService.cpp: -------------------------------------------------------------------------------- 1 | #include "ImpService.h" 2 | 3 | bool ImpService::Start() 4 | { 5 | return true; 6 | } 7 | bool ImpService::Stop() 8 | { 9 | return true; 10 | } -------------------------------------------------------------------------------- /ServiceManager/ImpService.h: -------------------------------------------------------------------------------- 1 | #include "Service.h" 2 | #include 3 | class ImpService: public Service 4 | { 5 | public: 6 | bool Start(); 7 | bool Stop(); 8 | protected: 9 | private: 10 | }; -------------------------------------------------------------------------------- /ServiceManager/SafavaServiceProcessManager.h: -------------------------------------------------------------------------------- 1 | #ifndef _SafavaServiceProcessManager_ 2 | #define _SafavaServiceProcessManager_ 3 | 4 | #include 5 | #include 6 | #include "conio.h" 7 | #include "Service.h" 8 | #include "AVEngine.h" 9 | using namespace std; 10 | 11 | //typedef std::pair ID_ServicePair; 12 | //typedef std::map serviceMap; 13 | //typedef serviceMap::iterator serviceMap_pIter; 14 | #define numberOfEntryPoint 1 15 | 16 | typedef struct ServiceEntry 17 | { 18 | TCHAR* serviceID; 19 | Service* pService; 20 | }; 21 | 22 | 23 | static ServiceEntry serviceEntry[numberOfEntryPoint]; 24 | 25 | //static serviceMap serviceRepository;// 26 | 27 | class SafavaServiceProcessManager 28 | { 29 | public: 30 | 31 | SafavaServiceProcessManager(); 32 | ~SafavaServiceProcessManager(); 33 | 34 | // New Data Type 35 | enum mapOperationsResult 36 | { 37 | successfully, 38 | failing, 39 | failing_alreadyExist, 40 | failing_doesNotExist, 41 | failing_threadCannotbeStop 42 | }; 43 | 44 | // Business Methods 45 | static mapOperationsResult installNewThread(TCHAR* threadID,Service* servicethreadPointer, int index); 46 | static Service* getThreadHandler(TCHAR* threadID); // if threadID does not exist it return NULL. 47 | static int SafavaServiceProcessManager::getIndexOfThreadHandler( TCHAR* threadID ); 48 | 49 | static mapOperationsResult unistallThread(TCHAR* threadID); 50 | static int unistallAllThread(); // return number of failed un-installing thread(for thread can't be stop). Remark: if an unexpected exception occur it return -1. 51 | static bool isEmpty(); 52 | protected: 53 | 54 | private: 55 | 56 | static ServiceEntry* getServiceRepository(); 57 | 58 | static int SafavaServiceProcessManager::getLengthOfServiceRepository(); 59 | static void initializer(); 60 | 61 | }; 62 | #endif -------------------------------------------------------------------------------- /ServiceManager/Service.cpp: -------------------------------------------------------------------------------- 1 | #include "Service.h" 2 | 3 | 4 | Service::Service() 5 | { 6 | 7 | } 8 | 9 | 10 | Service::~Service() 11 | { 12 | } 13 | -------------------------------------------------------------------------------- /ServiceManager/Service.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SERVICE_ 3 | #define _SERVICE_ 4 | 5 | class Service 6 | { 7 | 8 | public: 9 | virtual bool Start()=0; 10 | virtual bool Stop()=0; 11 | virtual bool Puase()=0; 12 | virtual bool Continue()=0; 13 | }; 14 | 15 | #endif -------------------------------------------------------------------------------- /ServiceManager/ServiceManager.cpp: -------------------------------------------------------------------------------- 1 | // ServiceManager.cpp : Defines the entry point for the console application. 2 | // 3 | 4 | #include "stdafx.h" 5 | 6 | 7 | int _tmain(int argc, _TCHAR* argv[]) 8 | { 9 | printf("hhhh"); 10 | return 0; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /ServiceManager/ServiceManager.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ServiceManager", "ServiceManager.vcxproj", "{24A54CA4-B98F-4C7E-A035-558A3AEFB0F2}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {24A54CA4-B98F-4C7E-A035-558A3AEFB0F2}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {24A54CA4-B98F-4C7E-A035-558A3AEFB0F2}.Debug|Win32.Build.0 = Debug|Win32 14 | {24A54CA4-B98F-4C7E-A035-558A3AEFB0F2}.Release|Win32.ActiveCfg = Release|Win32 15 | {24A54CA4-B98F-4C7E-A035-558A3AEFB0F2}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /ServiceManager/ServiceManager.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/ServiceManager/ServiceManager.suo -------------------------------------------------------------------------------- /ServiceManager/ServiceManager.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /ServiceManager/ServiceProcessConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef _ServiceProcessConfig_ 2 | #define _ServiceProcessConfig_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "conio.h" 9 | #include "BaseObject.h" 10 | 11 | using namespace std; 12 | 13 | 14 | class ServiceProcessConfig 15 | { 16 | public: 17 | ServiceProcessConfig() 18 | { 19 | strPassword = NULL ; 20 | strServiceStartName = NULL; 21 | strDependencies = NULL; 22 | strLoadOrderGroup = NULL; 23 | strBinaryPathName = NULL ; 24 | strDisplayName = NULL; 25 | strServiceName = NULL; 26 | strDatabaseName = NULL; 27 | strMachineName = NULL; 28 | }; 29 | ServiceProcessConfig( 30 | __in_opt TCHAR * _strMachineName, 31 | __in_opt TCHAR * _strDatabaseName, 32 | __in DWORD _dwDesiredAccessSCM, 33 | __in TCHAR * _strServiceName, 34 | __in_opt TCHAR * _strDisplayName, 35 | __in DWORD _dwDesiredAccessService, 36 | __in DWORD _dwServiceType, 37 | __in DWORD _dwStartType, 38 | __in DWORD _dwErrorControl, 39 | __in_opt TCHAR * _strBinaryPathName, 40 | __in_opt TCHAR * _strLoadOrderGroup, 41 | __in_opt TCHAR * _strDependencies, 42 | __in_opt TCHAR * _strServiceStartName, 43 | __in_opt TCHAR * _strPassword) ; 44 | ~ServiceProcessConfig(); 45 | 46 | 47 | static string LpwstrToString(LPWSTR lpwstr); 48 | static void ServiceProcessConfig::StringToLpwstr(string str, LPWSTR& dest); 49 | 50 | const TCHAR * getMachineName(); 51 | void SetMachineName(const TCHAR *); 52 | 53 | const TCHAR * getDatabaseName(); 54 | void SetDatabaseName(const TCHAR *); 55 | 56 | DWORD getDesiredAccessSCM(); 57 | void SetDesiredAccessSCM(DWORD ); 58 | 59 | const TCHAR * getServiceName(); 60 | void SetServiceName(const TCHAR *); 61 | 62 | const TCHAR * getDisplayName(); 63 | void SetDisplayName(const TCHAR * ); 64 | 65 | DWORD getDesiredAccessService(); 66 | void SetDesiredAccessService(DWORD ); 67 | 68 | DWORD getServiceType(); 69 | void SetServiceType(DWORD); 70 | 71 | DWORD getStartType(); 72 | void SetStartType(DWORD); 73 | 74 | DWORD getErrorControl(); 75 | void SetErrorControl(DWORD ); 76 | 77 | const TCHAR * getBinaryPathName(); 78 | void SetBinaryPathName(const TCHAR * ); 79 | 80 | const TCHAR * getLoadOrderGroup(); 81 | void SetLoadOrderGroup(const TCHAR *); 82 | 83 | void SetTagId(DWORD i_dwTagId); 84 | DWORD getTagId(); 85 | 86 | const TCHAR * getDependencies(); 87 | void SetDependencies(const TCHAR * ); 88 | 89 | const TCHAR * getServiceStartName(); 90 | void SetServiceStartName(const TCHAR * ); 91 | 92 | const TCHAR * getPassword(); 93 | void SetPassword(const TCHAR * ); 94 | 95 | protected: 96 | 97 | private: 98 | TCHAR * strPassword; 99 | TCHAR * strServiceStartName; 100 | TCHAR * strDependencies; 101 | DWORD dwTagId; 102 | TCHAR * strLoadOrderGroup; 103 | TCHAR * strBinaryPathName; 104 | DWORD dwErrorControl; 105 | DWORD dwStartType; 106 | DWORD dwServiceType; 107 | DWORD dwDesiredAccessService; 108 | TCHAR * strDisplayName; 109 | TCHAR * strServiceName; 110 | DWORD dwDesiredAccessSCM; 111 | TCHAR * strDatabaseName; 112 | TCHAR * strMachineName; 113 | 114 | }; 115 | #endif -------------------------------------------------------------------------------- /ServiceManager/UpgradeLog.XML: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /ServiceManager/sample.h: -------------------------------------------------------------------------------- 1 | // The following are message definitions. 2 | // 3 | // Values are 32 bit values laid out as follows: 4 | // 5 | // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 6 | // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 7 | // +---+-+-+-----------------------+-------------------------------+ 8 | // |Sev|C|R| Facility | Code | 9 | // +---+-+-+-----------------------+-------------------------------+ 10 | // 11 | // where 12 | // 13 | // Sev - is the severity code 14 | // 15 | // 00 - Success 16 | // 01 - Informational 17 | // 10 - Warning 18 | // 11 - Error 19 | // 20 | // C - is the Customer code flag 21 | // 22 | // R - is a reserved bit 23 | // 24 | // Facility - is the facility code 25 | // 26 | // Code - is the facility's status code 27 | // 28 | // 29 | // Define the facility codes 30 | // 31 | #define FACILITY_SYSTEM 0x0 32 | #define FACILITY_STUBS 0x3 33 | #define FACILITY_RUNTIME 0x2 34 | #define FACILITY_IO_ERROR_CODE 0x4 35 | 36 | 37 | // 38 | // Define the severity codes 39 | // 40 | #define STATUS_SEVERITY_WARNING 0x2 41 | #define STATUS_SEVERITY_SUCCESS 0x0 42 | #define STATUS_SEVERITY_INFORMATIONAL 0x1 43 | #define STATUS_SEVERITY_ERROR 0x3 44 | 45 | 46 | // 47 | // MessageId: SVC_ERROR 48 | // 49 | // MessageText: 50 | // 51 | // An error has occurred (%2). 52 | // 53 | #define SVC_ERROR ((DWORD)0xC0020001L) 54 | 55 | -------------------------------------------------------------------------------- /SetDetector/PatMatchUtility.h: -------------------------------------------------------------------------------- 1 | #ifndef PATMATCHUTILITY 2 | #define PATMATCHUTILITY 3 | #include "BaseObject.h" 4 | #include "JBuffer.h" 5 | #include "JFile.h" 6 | #include "FileInf.h" 7 | #include "crc.h" 8 | 9 | class PatMatchUtility 10 | { 11 | public : 12 | 13 | static BOOLEAN RetrieveFilePackerType(UINT8 * i_u8Sb , UINT16 i_u16Size ,UINT32 i_u32Offset ,UINT32 i_u32Type , JBuffer *i_pocBuffer , FileInfo *i_pocFileInfo ) ; 14 | static BOOLEAN CheckPattern (UINT8 i_u8Sb[] , UINT16 i_u16Size , JBuffer *i_pocBuffer ); 15 | static UINT64 MakeCRC(INT32 i_i32Start , UINT32 i_u32Size , FileInfo *i_pocFileInfo , JFile *i_pocFile); 16 | static UINT64 MakeCRC1(INT32 i_i32Start , UINT32 i_u32Size , FileInfo *i_pocFileInfo , JFile *i_pocFile); 17 | static UINT64 MakeCRC2(UINT32 i_u32Size , FileInfo *i_pocFileInfo , JFile *i_pocFile) ; 18 | static UINT64 MakeCRC3(INT32 i_i32Start , INT32 i_i32ExtendedOffset ,UINT32 i_u32Size , FileInfo *i_pocFileInfo , JFile *i_pocFile ); 19 | static UINT64 MakeCRC4(INT32 i_i32Start , INT32 i_i32ExtendedOffset ,UINT32 i_u32Size , FileInfo *i_pocFileInfo , JFile *i_pocFile ); 20 | static UINT64 MakeCRC5(INT32 i_i32Start ,UINT32 i_u32Size , FileInfo *i_pocFileInfo , JFile *i_pocFile ); 21 | static UINT64 TakeCrc(UINT32 u_i32Size , JFile *i_pocFile); 22 | static BOOLEAN GetPatternType(UINT8 * i_pu8Sb , UINT16 i_u16Size ,UINT32 i_u32Offset ,UINT32 i_u32Type , JBuffer *i_pocBuffer , FileInfo *i_pocFileInfo ); 23 | }; 24 | #endif -------------------------------------------------------------------------------- /SetDetector/SetDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILITYH 2 | #define UTILITYH 3 | #include "BaseObject.h" 4 | #include "FileInf.h" 5 | #include 6 | #include 7 | class JBuffer ; 8 | class QSqlQuery ; 9 | class QSqlDatabase ; 10 | class SetDetector : public BaseObject 11 | { 12 | private: 13 | struct tagSetMatchInfo 14 | { 15 | UINT32 IdMatchInfo ; 16 | UINT32 Type ; 17 | } ; 18 | struct tagMachInfo 19 | { 20 | UINT32 start , end; 21 | }; 22 | struct tagMachInfoEx 23 | { 24 | UINT32 start , end , Extended; 25 | }; 26 | struct tagSBCPattern 27 | { 28 | UINT32 Offset ; 29 | UINT16 Size ; 30 | UINT8 SB[1]; 31 | }; 32 | struct tagSBCMianHeader 33 | { 34 | UINT32 *Type ; 35 | UINT32 PatternCount ; 36 | tagSBCPattern Pattern[0] ; 37 | }; 38 | struct tagSet 39 | { 40 | char *name ; 41 | UINT32 IdSet; 42 | tagSBCMianHeader *SetPattern ; 43 | vector vecCrcMatch ; 44 | }; 45 | 46 | public : 47 | SetDetector(QSqlDatabase &i_ocConnect) ; 48 | BOOLEAN SetFileObject(JFile *i_pocFile) ; 49 | BOOLEAN IsPacked() ; 50 | BOOLEAN TakeSignature ( vector &o_vecVirCheckSum) ; 51 | BOOLEAN TakeFileInfo () ; 52 | void DeleteObject() ; 53 | BOOLEAN isAllreadyExistVirus (JString & i_strNameVirus ) ; 54 | char * GetCurrentSetName(); 55 | UINT32 GetCurrentSetId(); 56 | quint32 GetMatchId (quint32 i_u32index); 57 | ~SetDetector() ; 58 | 59 | private : 60 | QSqlDatabase *m_pocConnect ; 61 | UINT32 m_u32VirusId ; 62 | BOOLEAN RetrieveFilePackerType( tagSBCMianHeader *i_arrPattern ); 63 | BOOLEAN ReadPatternForSet( UINT32 i_u32SetID , tagSBCMianHeader *&i_ospPattern ); 64 | UINT32 SetVirusId (JString &i_strVirusName) ; 65 | UINT64 GetSignature (UINT32 i_u32Type , UINT32 i_32IdMatchInfo ) ; 66 | UINT16 ReadSet (); 67 | bool ReadCrcMatch(); 68 | 69 | JBuffer *m_pocBuffer ; 70 | FileInfo m_ocFileInfo ; 71 | JFile *m_pocFile ; 72 | UINT16 m_u16CountSet ; 73 | tagSet *m_ospSets , *m_osCurrentSet ; 74 | 75 | QMap m_qmapMachInfo ; 76 | QMap m_qmapMachInfoEx ; 77 | }; 78 | 79 | 80 | 81 | #endif -------------------------------------------------------------------------------- /Signer-build-desktop/ui_NumberPrompt.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | ** Form generated from reading UI file 'NumberPrompt.ui' 3 | ** 4 | ** Created: Thu Jul 24 02:58:07 2014 5 | ** by: Qt User Interface Compiler version 4.7.0 6 | ** 7 | ** WARNING! All changes made in this file will be lost when recompiling UI file! 8 | ********************************************************************************/ 9 | 10 | #ifndef UI_NUMBERPROMPT_H 11 | #define UI_NUMBERPROMPT_H 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | QT_BEGIN_NAMESPACE 24 | 25 | class Ui_DlgInputNum 26 | { 27 | public: 28 | QGridLayout *gridLayout; 29 | QSpinBox *spinBox; 30 | QDialogButtonBox *buttonBox; 31 | 32 | void setupUi(QDialog *DlgInputNum) 33 | { 34 | if (DlgInputNum->objectName().isEmpty()) 35 | DlgInputNum->setObjectName(QString::fromUtf8("DlgInputNum")); 36 | DlgInputNum->resize(174, 67); 37 | gridLayout = new QGridLayout(DlgInputNum); 38 | gridLayout->setObjectName(QString::fromUtf8("gridLayout")); 39 | spinBox = new QSpinBox(DlgInputNum); 40 | spinBox->setObjectName(QString::fromUtf8("spinBox")); 41 | 42 | gridLayout->addWidget(spinBox, 0, 0, 1, 1); 43 | 44 | buttonBox = new QDialogButtonBox(DlgInputNum); 45 | buttonBox->setObjectName(QString::fromUtf8("buttonBox")); 46 | buttonBox->setOrientation(Qt::Horizontal); 47 | buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); 48 | 49 | gridLayout->addWidget(buttonBox, 1, 0, 1, 1); 50 | 51 | 52 | retranslateUi(DlgInputNum); 53 | QObject::connect(buttonBox, SIGNAL(accepted()), DlgInputNum, SLOT(accept())); 54 | QObject::connect(buttonBox, SIGNAL(rejected()), DlgInputNum, SLOT(reject())); 55 | 56 | QMetaObject::connectSlotsByName(DlgInputNum); 57 | } // setupUi 58 | 59 | void retranslateUi(QDialog *DlgInputNum) 60 | { 61 | DlgInputNum->setWindowTitle(QApplication::translate("DlgInputNum", "Enter Number", 0, QApplication::UnicodeUTF8)); 62 | } // retranslateUi 63 | 64 | }; 65 | 66 | namespace Ui { 67 | class DlgInputNum: public Ui_DlgInputNum {}; 68 | } // namespace Ui 69 | 70 | QT_END_NAMESPACE 71 | 72 | #endif // UI_NUMBERPROMPT_H 73 | -------------------------------------------------------------------------------- /Signer-build-desktop/ui_Report.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | ** Form generated from reading UI file 'Report.ui' 3 | ** 4 | ** Created: Thu Jul 24 02:58:07 2014 5 | ** by: Qt User Interface Compiler version 4.7.0 6 | ** 7 | ** WARNING! All changes made in this file will be lost when recompiling UI file! 8 | ********************************************************************************/ 9 | 10 | #ifndef UI_REPORT_H 11 | #define UI_REPORT_H 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | QT_BEGIN_NAMESPACE 26 | 27 | class Ui_DlgReport 28 | { 29 | public: 30 | QGridLayout *gridLayout; 31 | QHBoxLayout *horizontalLayout; 32 | QSpacerItem *horizontalSpacer_2; 33 | QPushButton *pushButton; 34 | QTableWidget *tableWidget; 35 | 36 | void setupUi(QDialog *DlgReport) 37 | { 38 | if (DlgReport->objectName().isEmpty()) 39 | DlgReport->setObjectName(QString::fromUtf8("DlgReport")); 40 | DlgReport->resize(550, 391); 41 | gridLayout = new QGridLayout(DlgReport); 42 | gridLayout->setObjectName(QString::fromUtf8("gridLayout")); 43 | horizontalLayout = new QHBoxLayout(); 44 | horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); 45 | horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); 46 | 47 | horizontalLayout->addItem(horizontalSpacer_2); 48 | 49 | pushButton = new QPushButton(DlgReport); 50 | pushButton->setObjectName(QString::fromUtf8("pushButton")); 51 | 52 | horizontalLayout->addWidget(pushButton); 53 | 54 | 55 | gridLayout->addLayout(horizontalLayout, 1, 0, 1, 1); 56 | 57 | tableWidget = new QTableWidget(DlgReport); 58 | if (tableWidget->columnCount() < 2) 59 | tableWidget->setColumnCount(2); 60 | QTableWidgetItem *__qtablewidgetitem = new QTableWidgetItem(); 61 | tableWidget->setHorizontalHeaderItem(0, __qtablewidgetitem); 62 | QTableWidgetItem *__qtablewidgetitem1 = new QTableWidgetItem(); 63 | tableWidget->setHorizontalHeaderItem(1, __qtablewidgetitem1); 64 | tableWidget->setObjectName(QString::fromUtf8("tableWidget")); 65 | 66 | gridLayout->addWidget(tableWidget, 0, 0, 1, 1); 67 | 68 | 69 | retranslateUi(DlgReport); 70 | 71 | QMetaObject::connectSlotsByName(DlgReport); 72 | } // setupUi 73 | 74 | void retranslateUi(QDialog *DlgReport) 75 | { 76 | DlgReport->setWindowTitle(QApplication::translate("DlgReport", "Dialog", 0, QApplication::UnicodeUTF8)); 77 | pushButton->setText(QApplication::translate("DlgReport", "Ok", 0, QApplication::UnicodeUTF8)); 78 | QTableWidgetItem *___qtablewidgetitem = tableWidget->horizontalHeaderItem(0); 79 | ___qtablewidgetitem->setText(QApplication::translate("DlgReport", "Error Value", 0, QApplication::UnicodeUTF8)); 80 | QTableWidgetItem *___qtablewidgetitem1 = tableWidget->horizontalHeaderItem(1); 81 | ___qtablewidgetitem1->setText(QApplication::translate("DlgReport", "File Name", 0, QApplication::UnicodeUTF8)); 82 | } // retranslateUi 83 | 84 | }; 85 | 86 | namespace Ui { 87 | class DlgReport: public Ui_DlgReport {}; 88 | } // namespace Ui 89 | 90 | QT_END_NAMESPACE 91 | 92 | #endif // UI_REPORT_H 93 | -------------------------------------------------------------------------------- /Signer-build-desktop/ui_dialog.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | ** Form generated from reading UI file 'dialog.ui' 3 | ** 4 | ** Created: Thu Jul 24 02:58:07 2014 5 | ** by: Qt User Interface Compiler version 4.7.0 6 | ** 7 | ** WARNING! All changes made in this file will be lost when recompiling UI file! 8 | ********************************************************************************/ 9 | 10 | #ifndef UI_DIALOG_H 11 | #define UI_DIALOG_H 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | QT_BEGIN_NAMESPACE 26 | 27 | class Ui_DlgView 28 | { 29 | public: 30 | QGridLayout *gridLayout; 31 | QTableView *tableView; 32 | QHBoxLayout *horizontalLayout; 33 | QSpacerItem *horizontalSpacer; 34 | QPushButton *BtnDelete; 35 | QPushButton *BtnAdd; 36 | QPushButton *BtnApplay; 37 | QPushButton *BtnUndo; 38 | 39 | void setupUi(QDialog *DlgView) 40 | { 41 | if (DlgView->objectName().isEmpty()) 42 | DlgView->setObjectName(QString::fromUtf8("DlgView")); 43 | DlgView->resize(608, 517); 44 | gridLayout = new QGridLayout(DlgView); 45 | gridLayout->setObjectName(QString::fromUtf8("gridLayout")); 46 | tableView = new QTableView(DlgView); 47 | tableView->setObjectName(QString::fromUtf8("tableView")); 48 | tableView->setLineWidth(0); 49 | 50 | gridLayout->addWidget(tableView, 0, 0, 1, 1); 51 | 52 | horizontalLayout = new QHBoxLayout(); 53 | horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); 54 | horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); 55 | 56 | horizontalLayout->addItem(horizontalSpacer); 57 | 58 | BtnDelete = new QPushButton(DlgView); 59 | BtnDelete->setObjectName(QString::fromUtf8("BtnDelete")); 60 | BtnDelete->setCheckable(false); 61 | BtnDelete->setChecked(false); 62 | BtnDelete->setFlat(false); 63 | 64 | horizontalLayout->addWidget(BtnDelete); 65 | 66 | BtnAdd = new QPushButton(DlgView); 67 | BtnAdd->setObjectName(QString::fromUtf8("BtnAdd")); 68 | 69 | horizontalLayout->addWidget(BtnAdd); 70 | 71 | BtnApplay = new QPushButton(DlgView); 72 | BtnApplay->setObjectName(QString::fromUtf8("BtnApplay")); 73 | 74 | horizontalLayout->addWidget(BtnApplay); 75 | 76 | BtnUndo = new QPushButton(DlgView); 77 | BtnUndo->setObjectName(QString::fromUtf8("BtnUndo")); 78 | 79 | horizontalLayout->addWidget(BtnUndo); 80 | 81 | 82 | gridLayout->addLayout(horizontalLayout, 1, 0, 1, 1); 83 | 84 | 85 | retranslateUi(DlgView); 86 | 87 | QMetaObject::connectSlotsByName(DlgView); 88 | } // setupUi 89 | 90 | void retranslateUi(QDialog *DlgView) 91 | { 92 | DlgView->setWindowTitle(QApplication::translate("DlgView", "Dialog", 0, QApplication::UnicodeUTF8)); 93 | BtnDelete->setText(QApplication::translate("DlgView", "Delete", 0, QApplication::UnicodeUTF8)); 94 | BtnAdd->setText(QApplication::translate("DlgView", "Add", 0, QApplication::UnicodeUTF8)); 95 | BtnApplay->setText(QApplication::translate("DlgView", "Applay", 0, QApplication::UnicodeUTF8)); 96 | BtnUndo->setText(QApplication::translate("DlgView", "Undo", 0, QApplication::UnicodeUTF8)); 97 | } // retranslateUi 98 | 99 | }; 100 | 101 | namespace Ui { 102 | class DlgView: public Ui_DlgView {}; 103 | } // namespace Ui 104 | 105 | QT_END_NAMESPACE 106 | 107 | #endif // UI_DIALOG_H 108 | -------------------------------------------------------------------------------- /Signer/CheckSumDelegete.cpp: -------------------------------------------------------------------------------- 1 | #include "CheckSumDelegete.h" 2 | #include "QComboBoxEx.h" 3 | #include 4 | #include 5 | //------------------------------------------------------------------ 6 | CheckSumDelegete::CheckSumDelegete(QAbstractItemView *qItemView , QObject *parent) 7 | { 8 | } 9 | //------------------------------------------------------------------ 10 | CheckSumDelegete::~CheckSumDelegete(void) 11 | { 12 | } 13 | //------------------------------------------------------------------ 14 | void CheckSumDelegete::paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const 15 | { 16 | QItemDelegate::paint(painter ,option ,index); 17 | } 18 | //------------------------------------------------------------------ 19 | QWidget * CheckSumDelegete::createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const 20 | { 21 | bool bOk ; 22 | switch(index.column()) 23 | { 24 | case 3: 25 | QSqlQuery qsqlPatType("Select TypeMemonotic , MachInfoType from machinfotype") ; 26 | QSqlQueryModel *pqsqlmdlType = new QSqlQueryModel; 27 | pqsqlmdlType->setQuery(qsqlPatType); 28 | QComboBoxEx *pqcomTypeEx ; 29 | pqcomTypeEx = new QComboBoxEx (parent); 30 | pqcomTypeEx->setInsertPolicy(QComboBox::NoInsert); 31 | pqcomTypeEx->setEditable(false); 32 | pqcomTypeEx->setModel(pqsqlmdlType); 33 | connect(pqcomTypeEx , SIGNAL(UnFocus()) , this , SLOT(commitAndCloseEditor())); 34 | connect(pqcomTypeEx , SIGNAL(DoPopup()) , this , SLOT(GetPopUp())); 35 | connect(pqcomTypeEx , SIGNAL(DoUnPop()) , this , SLOT(GetHidePopUp())); 36 | return pqcomTypeEx ; 37 | break ; 38 | } 39 | return QItemDelegate::createEditor( parent,option,index ); 40 | } 41 | //------------------------------------------------------------------ 42 | void CheckSumDelegete::setEditorData( QWidget *editor, const QModelIndex &index ) const 43 | { 44 | if (index.column() == 3) 45 | { 46 | QComboBoxEx *qcomTypeEx = qobject_cast(editor); 47 | quint32 qu32index = qcomTypeEx->findText(index.model()->data(index, Qt::DisplayRole).toString()); 48 | if ( qu32index == -1 ) 49 | { 50 | return ; 51 | } 52 | qcomTypeEx->setCurrentIndex(qu32index); 53 | } 54 | else 55 | { 56 | QItemDelegate::setEditorData( editor, index ); 57 | } 58 | 59 | 60 | } 61 | //------------------------------------------------------------------ 62 | void CheckSumDelegete::setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const 63 | { 64 | bool bOk; 65 | if(index.column()== 3) 66 | { 67 | quint32 qu32Type; 68 | QComboBoxEx *qcomTypeEx = qobject_cast(editor); 69 | model->setData(index , qcomTypeEx->currentText()); 70 | qu32Type = qcomTypeEx->model()->data(qcomTypeEx->model()->index(qcomTypeEx->currentIndex(),1)).toUInt(&bOk); 71 | if ( bOk ) 72 | model->setData(index , qu32Type ,Qt::UserRole); 73 | } 74 | else 75 | { 76 | QItemDelegate::setModelData(editor,model,index ); 77 | } 78 | 79 | } 80 | //------------------------------------------------------------------ 81 | void CheckSumDelegete::commitAndCloseEditor() 82 | { 83 | QComboBoxEx *qcomTypeEx = qobject_cast(sender()); 84 | emit commitData(qcomTypeEx); 85 | emit closeEditor(qcomTypeEx); 86 | } 87 | //------------------------------------------------------------------ 88 | void CheckSumDelegete::GetPopUp() 89 | { 90 | QComboBoxEx *pqcomTypeEx = qobject_cast(sender()); 91 | disconnect(pqcomTypeEx , SIGNAL(UnFocus()) , this , SLOT(commitAndCloseEditor())); 92 | } 93 | //------------------------------------------------------------------ 94 | void CheckSumDelegete::GetHidePopUp() 95 | { 96 | QComboBoxEx *pqcomTypeEx = qobject_cast(sender()); 97 | connect(pqcomTypeEx , SIGNAL(UnFocus()) , this , SLOT(commitAndCloseEditor())); 98 | } 99 | //------------------------------------------------------------------ -------------------------------------------------------------------------------- /Signer/CheckSumDelegete.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class CheckSumDelegete : 5 | public QItemDelegate 6 | { 7 | Q_OBJECT 8 | public: 9 | CheckSumDelegete(QAbstractItemView *qItemView , QObject *parent = 0); 10 | void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; 11 | QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; 12 | void setEditorData(QWidget *editor, const QModelIndex &index) const; 13 | void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; 14 | ~CheckSumDelegete(void); 15 | private slots: 16 | void commitAndCloseEditor(); 17 | void GetPopUp(); 18 | void GetHidePopUp(); 19 | }; 20 | -------------------------------------------------------------------------------- /Signer/CompareEngineThread.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "BaseObject.h" 4 | 5 | 6 | class JEnumerator ; 7 | class SetDetector ; 8 | class QSqlDatabase ; 9 | class LoadDatFile ; 10 | class SbScaner ; 11 | class JDecryptedFile ; 12 | 13 | class CompareEngineThread : 14 | public QThread 15 | { 16 | 17 | Q_OBJECT 18 | public: 19 | CompareEngineThread(QSqlDatabase &i_qSqlDatabase ,JString &Path ,JString &strDatFile); 20 | ~CompareEngineThread(void); 21 | virtual void run (); 22 | UINT32 LastErrorCode ; 23 | private : 24 | JEnumerator *m_pocEnumator; 25 | SetDetector *m_pocSetDetector; 26 | LoadDatFile *m_pocLoadDatFile ; 27 | SbScaner *m_pocSbScaner ; 28 | bool m_bCancel ; 29 | JDecryptedFile *m_pocFile ; 30 | signals : 31 | void Report( QString FileName , QString SetNamedat ,QString SetNameDb ); 32 | }; 33 | -------------------------------------------------------------------------------- /Signer/DbTofileThread.cpp: -------------------------------------------------------------------------------- 1 | #include "DbTofileThread.h" 2 | #include "DbToFile.h" 3 | #include 4 | #include 5 | #include "JFile.h" 6 | DbTofileThread::DbTofileThread(QSqlDatabase &i_qsqldatabase , JDecryptedFile &i_File) 7 | { 8 | 9 | 10 | m_pFile = &i_File; 11 | } 12 | 13 | DbTofileThread::~DbTofileThread(void) 14 | { 15 | } 16 | 17 | void DbTofileThread::run() 18 | { 19 | QMYSQLDriver MysqlDriver ; 20 | m__pqsqldatabase = new QSqlDatabase; 21 | *m__pqsqldatabase = QSqlDatabase::addDatabase(&MysqlDriver); ; 22 | m__pqsqldatabase->setHostName("127.0.0.1"); 23 | m__pqsqldatabase->setDatabaseName("backdb"); 24 | m__pqsqldatabase->setUserName("root"); 25 | m__pqsqldatabase->setPassword("123456789"); 26 | if ( !m__pqsqldatabase->open() ) 27 | { 28 | // QMessageBox::critical(0, QObject::tr("Database Error"), m_qSqlDatabase.lastError().text()); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Signer/DbTofileThread.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class QSqlDatabase; 5 | class JDecryptedFile ; 6 | class DbTofileThread : 7 | public QThread 8 | { 9 | Q_OBJECT 10 | public: 11 | void run(); 12 | DbTofileThread(QSqlDatabase &i_qsqldatabase , JDecryptedFile &i_File); 13 | ~DbTofileThread(void); 14 | private : 15 | QSqlDatabase *m__pqsqldatabase ; 16 | JDecryptedFile *m_pFile; 17 | signals : 18 | void CheckState(quint32 i_u32State , bool i_bRes ); 19 | }; 20 | -------------------------------------------------------------------------------- /Signer/DlgComapreEngine.cpp: -------------------------------------------------------------------------------- 1 | #include "DlgComapreEngine.h" 2 | #include "ui_GetPtarrenFileInfo.h" 3 | #include "CompareEngineThread.h" 4 | #include "QCompareEngineModel.h" 5 | //------------------------------------------------------------------------------------------------- 6 | DlgComapreEngine::DlgComapreEngine(QDialog *parent , QSqlDatabase &i_qSqlDatabase ,JString &Path ,JString &strDatFile):QDialog (parent) ,ui (new Ui::DlgGetPatternFileInfo) 7 | { 8 | ui->setupUi(this); 9 | m_posQCompareEngineModel = new QCompareEngineModel(this); 10 | ui->TblFileInfo->setModel(m_posQCompareEngineModel); 11 | m_pCompareEngineThread = new CompareEngineThread (i_qSqlDatabase , Path , strDatFile); 12 | connect(m_pCompareEngineThread , SIGNAL(Report( QString , QString ,QString )) , this , SLOT (GetReport( QString , QString ,QString ))); 13 | m_pCompareEngineThread->start(); 14 | } 15 | //------------------------------------------------------------------------------------------------- 16 | DlgComapreEngine::~DlgComapreEngine(void) 17 | { 18 | 19 | } 20 | //------------------------------------------------------------------------------------------------- 21 | void DlgComapreEngine::GetReport(QString FileName , QString SetNamedat ,QString SetNameDb) 22 | { 23 | m_posQCompareEngineModel->insertRows(ui->TblFileInfo->model()->rowCount(),1,QModelIndex()); 24 | m_posQCompareEngineModel->setData(m_posQCompareEngineModel->index(ui->TblFileInfo->model()->rowCount()-1,0) ,FileName); 25 | m_posQCompareEngineModel->setData(m_posQCompareEngineModel->index(ui->TblFileInfo->model()->rowCount()-1,1) ,SetNamedat); 26 | m_posQCompareEngineModel->setData(m_posQCompareEngineModel->index(ui->TblFileInfo->model()->rowCount()-1,2) ,SetNameDb); 27 | } 28 | //------------------------------------------------------------------------------------------------- 29 | -------------------------------------------------------------------------------- /Signer/DlgComapreEngine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "BaseObject.h" 4 | namespace Ui { 5 | class DlgGetPatternFileInfo; 6 | } // namespace Ui 7 | 8 | class QSqlDatabase ; 9 | class CompareEngineThread ; 10 | class QCompareEngineModel ; 11 | class DlgComapreEngine : 12 | public QDialog 13 | { 14 | Q_OBJECT 15 | public: 16 | DlgComapreEngine(QDialog *parent , QSqlDatabase &i_qSqlDatabase ,JString &Path ,JString &strDatFile); 17 | ~DlgComapreEngine(void); 18 | private : 19 | Ui::DlgGetPatternFileInfo *ui ; 20 | CompareEngineThread *m_pCompareEngineThread; 21 | QCompareEngineModel *m_posQCompareEngineModel; 22 | private slots : 23 | void GetReport(QString FileName , QString SetNamedat ,QString SetNameDb); 24 | }; 25 | -------------------------------------------------------------------------------- /Signer/DlgDbtoFile1.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | 5 | namespace Ui { 6 | class Dbtofile; 7 | } 8 | class QSqlDatabase; 9 | 10 | class JDecryptedFile ; 11 | class QIcon ; 12 | class DbtoFile1 : 13 | public QDialog 14 | { 15 | Q_OBJECT 16 | public: 17 | DbtoFile1(QWidget *parent ,QSqlDatabase *i_qSqlDatabase,JDecryptedFile *i_jfile); 18 | ~DbtoFile1(void); 19 | private : 20 | QSqlDatabase *m_qSqlDatabase ; 21 | JDecryptedFile *m_jfile ; 22 | Ui::Dbtofile *ui; 23 | 24 | QIcon *m_qiconErrorIcon , *m_qiconAcceptIcon , *m_qiconWaitIcon; 25 | void showEvent ( QShowEvent * event ) ; 26 | private slots: 27 | void ChangeState(quint32 i_u32State , bool i_bRes); 28 | signals : 29 | void CheckState(quint32 i_u32State , bool i_bRes ); 30 | 31 | }; 32 | -------------------------------------------------------------------------------- /Signer/DlgGetPattern.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "EnumGetPatternThread.h" 8 | namespace Ui 9 | { 10 | class GetPattern; 11 | } 12 | class QSqlDatabase; 13 | class EnumGetPatternThread ; 14 | class QGetPatternModel ; 15 | class QAction ; 16 | class QMenu ; 17 | class QPoint; 18 | class DlgGetPattern : 19 | public QDialog 20 | { 21 | Q_OBJECT 22 | public: 23 | DlgGetPattern(QWidget *parent = NULL , QSqlDatabase *i_pqsqlDb = NULL); 24 | ~DlgGetPattern(void); 25 | private : 26 | QSqlDatabase m_qSqlLite ; 27 | Ui::GetPattern *ui; 28 | EnumGetPatternThread *m_pGetPatternThread ; 29 | QSqlDatabase *m_pqsqlDb ; 30 | QGetPatternModel *m_pocQGetPatternModel ; 31 | bool AddSate ; 32 | QAction *m_qPopUpMenuAction[1]; 33 | quint32 m_qu32MenuCount ; 34 | QMenu *m_qPopMenu ; 35 | void CreatePopupMenuAndAssign(); 36 | void CreatePopupMenuAction(); 37 | private slots : 38 | void BtnAdd_Click(); 39 | void GetFileInfo(int Percent , int u32SetId ,QString i_qstrPath ,bool bNoSet); 40 | void GetFileInfoAction(); 41 | void PopupRequest(const QPoint & Arg); 42 | void BtnApplay_Click(); 43 | void ThreadFinish(); 44 | signals : 45 | void CancelThread() ; 46 | void GetFileInfoList(quint32 ,QSqlDatabase *i_qSqlLite); 47 | }; 48 | -------------------------------------------------------------------------------- /Signer/DlgGetPatternFileInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "dlgGetPatternFileInfo.h" 2 | #include "ui_GetPtarrenFileInfo.h" 3 | #include "EnumGetPatternThread.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "QGetPatternFileInfoModel.h" 9 | DlgGetPatternFileInfo::DlgGetPatternFileInfo(QDialog *parent , QSqlDatabase * i_pocDataBase ,quint32 i_SetId) :QDialog (parent) ,ui (new Ui::DlgGetPatternFileInfo) 10 | { 11 | ui->setupUi(this); 12 | QGetPatternFileInfoModel *qgetPAtFileInfoModel = new QGetPatternFileInfoModel(i_pocDataBase,parent,i_SetId); 13 | 14 | ui->TblFileInfo->setModel(qgetPAtFileInfoModel); 15 | } 16 | 17 | DlgGetPatternFileInfo::~DlgGetPatternFileInfo(void) 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /Signer/DlgGetPatternFileInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class QSqlDatabase; 5 | namespace Ui { 6 | class DlgGetPatternFileInfo; 7 | } // namespace Ui 8 | 9 | class DlgGetPatternFileInfo : 10 | public QDialog 11 | { 12 | Q_OBJECT 13 | public: 14 | DlgGetPatternFileInfo(QDialog *parent , QSqlDatabase * ,quint32 i_SetId); 15 | ~DlgGetPatternFileInfo(void); 16 | private : 17 | Ui::DlgGetPatternFileInfo *ui ; 18 | }; 19 | -------------------------------------------------------------------------------- /Signer/DlgInputNum.cpp: -------------------------------------------------------------------------------- 1 | #include "DlgInputNum.h" 2 | #include "ui_NumberPrompt.h" 3 | DlgInputNum::DlgInputNum( QWidget *parent ):QDialog( parent ), 4 | ui(new Ui::DlgInputNum) 5 | { 6 | ui->setupUi(this); 7 | } 8 | DlgInputNum::~DlgInputNum(void) 9 | { 10 | 11 | } 12 | int DlgInputNum::GetNumInput() 13 | { 14 | return ui->spinBox->value(); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /Signer/DlgInputNum.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Ui { 5 | class DlgInputNum; 6 | } 7 | 8 | class DlgInputNum : 9 | public QDialog 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit DlgInputNum(QWidget *parent = 0); 14 | ~DlgInputNum(void); 15 | int GetNumInput(); 16 | private : 17 | Ui::DlgInputNum *ui ; 18 | }; 19 | -------------------------------------------------------------------------------- /Signer/DlgReport.cpp: -------------------------------------------------------------------------------- 1 | #include "DlgReport.h" 2 | #include "ui_Report.h" 3 | 4 | DlgReport::DlgReport(QWidget *parent) 5 | :QDialog(parent),ui(new Ui::DlgReport) 6 | { 7 | ui->setupUi(this); 8 | } 9 | 10 | DlgReport::~DlgReport(void) 11 | { 12 | } 13 | -------------------------------------------------------------------------------- /Signer/DlgReport.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | namespace Ui { 4 | class DlgReport; 5 | } // namespace Ui 6 | 7 | class DlgReport 8 | : public QDialog 9 | { 10 | public: 11 | DlgReport(QWidget *parent); 12 | ~DlgReport(void); 13 | private : 14 | Ui::DlgReport *ui ; 15 | }; 16 | -------------------------------------------------------------------------------- /Signer/DlgSelectDatFile.cpp: -------------------------------------------------------------------------------- 1 | #include "DlgSelectDatFile.h" 2 | #include "ui_SelectDatFile.h" 3 | #include 4 | extern QFileDialog *q_pFileOpenDialog ; 5 | DlgSelectDatFile::DlgSelectDatFile(QWidget *parent , quint8 i_u8FolderOrFile):QDialog(parent) , ui(new Ui::Dialog) 6 | { 7 | ui->setupUi(this); 8 | connect(ui->BtnSelPath , SIGNAL(clicked()) , this , SLOT(BtnSelPath_Click())); 9 | m_u8FolderOrFile = i_u8FolderOrFile ; 10 | } 11 | 12 | DlgSelectDatFile::~DlgSelectDatFile(void) 13 | { 14 | 15 | } 16 | 17 | void DlgSelectDatFile::BtnSelPath_Click() 18 | { 19 | QStringList qstrfileNames; 20 | if ( m_u8FolderOrFile == 0 ) 21 | { 22 | q_pFileOpenDialog->setFileMode(QFileDialog::AnyFile); 23 | q_pFileOpenDialog->setAcceptMode(QFileDialog::AcceptSave); 24 | } 25 | else if ( m_u8FolderOrFile == 1 ) 26 | { 27 | q_pFileOpenDialog->setFileMode(QFileDialog::Directory); 28 | q_pFileOpenDialog->setAcceptMode(QFileDialog::AcceptOpen); 29 | } 30 | else if (m_u8FolderOrFile == 2) 31 | { 32 | q_pFileOpenDialog->setFileMode(QFileDialog::AnyFile); 33 | q_pFileOpenDialog->setAcceptMode(QFileDialog::AcceptOpen); 34 | } 35 | 36 | if ( q_pFileOpenDialog->exec()) 37 | { 38 | ui->TxtPath->setText(q_pFileOpenDialog->selectedFiles()[0]); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Signer/DlgSelectDatFile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | 5 | namespace Ui { 6 | class Dialog; 7 | } 8 | 9 | class DlgSelectDatFile : 10 | public QDialog 11 | { 12 | Q_OBJECT 13 | public: 14 | DlgSelectDatFile(QWidget *parent , quint8 i_u8FolderOrFile = 0); 15 | ~DlgSelectDatFile(void); 16 | Ui::Dialog *ui; 17 | private slots: 18 | void BtnSelPath_Click(); 19 | private : 20 | quint8 m_u8FolderOrFile ; 21 | }; 22 | -------------------------------------------------------------------------------- /Signer/DlgSetView.h: -------------------------------------------------------------------------------- 1 | #ifndef DIALOG_H 2 | #define DIALOG_H 3 | 4 | #include 5 | 6 | #include 7 | namespace Ui { 8 | class DlgView; 9 | } 10 | enum enTypeOfModel 11 | { 12 | enSetModel , 13 | enPatternModel , 14 | enCheckSumModel , 15 | enShowVirusModel 16 | }; 17 | class SetModel ; 18 | class QAction ; 19 | class QMenu ; 20 | class QPoint ; 21 | class QSqlDatabase ; 22 | class QPatternModel ; 23 | class QHexEditEx ; 24 | class QAbstractItemView ; 25 | class QCheckSumModel; 26 | class QShowVirus ; 27 | 28 | class DlgView : public QDialog 29 | { 30 | Q_OBJECT 31 | friend QAbstractItemView ; 32 | public: 33 | explicit DlgView(QWidget *parent , QSqlDatabase *i_pqsqlDb); 34 | explicit DlgView(QWidget *parent , enTypeOfModel TypeOfModel , quint32 id , QSqlDatabase *i_pqsqlDb); 35 | ~DlgView(); 36 | 37 | private slots: 38 | void on_BtnAdd_clicked(); 39 | 40 | void on_BtnDelete_clicked(); 41 | 42 | void on_BtnApplay_clicked(); 43 | 44 | void on_BtnUndo_clicked(); 45 | 46 | void ShowPatternAction(); 47 | 48 | void ShowVirusAction(); 49 | 50 | void ShowCheckSum(); 51 | 52 | void CreatePopupMenuAndAssign(); 53 | 54 | void PopupRequest(const QPoint &); 55 | 56 | void HexEditItemChanged(); 57 | 58 | void HexEditUnFous(); 59 | 60 | void PopUpForHexEditor(const QPoint & Arg); 61 | 62 | void ReadFromFile(); 63 | 64 | void ModelViewChanged(); 65 | 66 | void FillZero(); 67 | 68 | void RemoveByte(); 69 | 70 | void MakeDontCare(); 71 | 72 | signals : 73 | void PatternRequest(quint32 SetId); 74 | void CheckSumReguest(quint32 SetId); 75 | void ShowVirusReguest(quint32 SetId); 76 | 77 | private: 78 | QAction *m_qPopUpMenuAction[4]; 79 | void CreatePopupMenuActionForSet(); 80 | void CreatePopupMenuActionForPattern(); 81 | 82 | Ui::DlgView *ui ; 83 | QMenu *m_qPopMenu ; 84 | QPatternModel *m_PattrenModel; 85 | QCheckSumModel *m_CheckSumModel; 86 | QShowVirus *m_ShowVirusModel ; 87 | QSqlDatabase *m_pqsqlDb ; 88 | QHexEditEx *qhexTmp ; 89 | enTypeOfModel m_enTypeModel ; 90 | quint32 m_qu32MenuCount; 91 | quint32 m_qu32CurrentItem; 92 | quint32 m_qu32HexPos; 93 | quint32 m_qu32HexStartSel , m_qu32HexEndSel; 94 | }; 95 | 96 | #endif // DIALOG_H 97 | -------------------------------------------------------------------------------- /Signer/EnumGetPatternThread.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "BaseObject.h" 4 | #include 5 | #include 6 | #include 7 | struct PattrenFileInfo 8 | { 9 | quint32 u32SetId ; 10 | QString strFileName ; 11 | QString strPath ; 12 | QString VirusName ; 13 | quint64 FileSize ; 14 | UINT8 u8arrMd5[16]; 15 | UINT8 u8Percent ; 16 | vector vecu64Crc ; 17 | }; 18 | class QSqlDatabase ; 19 | class JEnumerator ; 20 | class SetDetector ; 21 | class EnumGetPatternThread : 22 | public QThread 23 | { 24 | Q_OBJECT 25 | public: 26 | EnumGetPatternThread(QSqlDatabase &i_qSqlDatabase ,JString &Path ,QSqlDatabase &i_qSqlSqlite ); 27 | ~EnumGetPatternThread(void); 28 | QMap> m_qmapVector ; 29 | virtual void run (); 30 | private slots : 31 | void Cancel(); 32 | 33 | private : 34 | QSqlDatabase *m_pqSqlSqlite ; 35 | JEnumerator *m_pocEnumator; 36 | SetDetector *m_pocSetDetector; 37 | bool m_bCancel ; 38 | signals : 39 | void FindFile(int Percent , int u32SetId , QString strPath , bool bNoSet); 40 | }; 41 | -------------------------------------------------------------------------------- /Signer/GetPattern.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | GetPattern 4 | 5 | 6 | 7 | 0 8 | 0 9 | 608 10 | 517 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 24 21 | 22 | 23 | 24 | 25 | 26 | 27 | 0 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | Qt::Horizontal 37 | 38 | 39 | 40 | 40 41 | 20 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | Delete 50 | 51 | 52 | false 53 | 54 | 55 | false 56 | 57 | 58 | false 59 | 60 | 61 | 62 | 63 | 64 | 65 | Add 66 | 67 | 68 | 69 | 70 | 71 | 72 | Applay 73 | 74 | 75 | 76 | 77 | 78 | 79 | Undo 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Signer/GetPtarrenFileInfo.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DlgGetPatternFileInfo 4 | 5 | 6 | 7 | 0 8 | 0 9 | 580 10 | 397 11 | 12 | 13 | 14 | File Info 15 | 16 | 17 | 18 | 19 | 20 | Qt::Horizontal 21 | 22 | 23 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | buttonBox 36 | accepted() 37 | DlgGetPatternFileInfo 38 | accept() 39 | 40 | 41 | 248 42 | 254 43 | 44 | 45 | 157 46 | 274 47 | 48 | 49 | 50 | 51 | buttonBox 52 | rejected() 53 | DlgGetPatternFileInfo 54 | reject() 55 | 56 | 57 | 316 58 | 260 59 | 60 | 61 | 286 62 | 274 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /Signer/HexEditorDelegate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | class QAbstractItemView ; 4 | class QComboBoxEx ; 5 | class HexEditorDelegate : 6 | public QItemDelegate 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit HexEditorDelegate(QAbstractItemView *qItemView , QObject *parent = 0); 11 | 12 | void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; 13 | QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; 14 | void setEditorData(QWidget *editor, const QModelIndex &index) const; 15 | void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; 16 | 17 | ~HexEditorDelegate(void); 18 | private slots: 19 | void commitAndCloseEditor(); 20 | void GetPopUp(); 21 | void GetHidePopUp(); 22 | void CommitAndCloseSpinBox(); 23 | private: 24 | QAbstractItemView *m_qItemView ; 25 | int durationColumn; 26 | 27 | 28 | }; 29 | -------------------------------------------------------------------------------- /Signer/NumberPrompt.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DlgInputNum 4 | 5 | 6 | 7 | 0 8 | 0 9 | 174 10 | 67 11 | 12 | 13 | 14 | Enter Number 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Qt::Horizontal 24 | 25 | 26 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | buttonBox 36 | accepted() 37 | DlgInputNum 38 | accept() 39 | 40 | 41 | 248 42 | 254 43 | 44 | 45 | 157 46 | 274 47 | 48 | 49 | 50 | 51 | buttonBox 52 | rejected() 53 | DlgInputNum 54 | reject() 55 | 56 | 57 | 316 58 | 260 59 | 60 | 61 | 286 62 | 274 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /Signer/QCheckSumModel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | class QSqlDatabase ; 6 | class QCheckSumModel : 7 | public QAbstractTableModel 8 | { 9 | struct tagMatchInfoTypePair 10 | { 11 | int u32MatchInfoId ; 12 | int u32TableIndex ; 13 | int u32Index ; 14 | int u32Type ; 15 | QString qstrTypDescription ; 16 | }; 17 | struct tagMatchExInfo 18 | { 19 | int u32Start; 20 | int u32Extended ; 21 | int u32End ; 22 | }; 23 | struct tagMatchInfo 24 | { 25 | int u32Start; 26 | int u32End; 27 | }; 28 | public: 29 | QCheckSumModel(QSqlDatabase *i_pqsqlDb , QObject * parent , quint32 i_qu32SetId); 30 | ~QCheckSumModel(void); 31 | QVariant data(const QModelIndex &index, int role) const; 32 | int rowCount(const QModelIndex &parent = QModelIndex()) const; 33 | int columnCount(const QModelIndex &parent = QModelIndex()) const; 34 | Qt::ItemFlags flags(const QModelIndex &index) const; 35 | QVariant headerData(int section, Qt::Orientation orientation,int role) const; 36 | bool setData(const QModelIndex &index, const QVariant &value,int role = Qt::EditRole); 37 | bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex()); 38 | bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex()); 39 | bool ApplayChange() ; 40 | bool Undo(); 41 | 42 | private : 43 | QVector m_qvecMatchInfoTypeInfo; 44 | QVector m_qvecMatchExInfo; 45 | QVector m_qvecMachInfo; 46 | QMap m_qmapChngStart , m_qmapInsertStart; 47 | QMap m_qmapChngSize , m_qmapInsertSize; 48 | QMap m_qmapChngExetended , m_qmapInsertExtended; 49 | QMap m_qmapChngTypeStr , m_qmapInsertTypeStr; 50 | QMap m_qmapChngTypeint , m_qmapInsertTypeInt; 51 | QMap m_qmapCheckTypeTableIndex ; 52 | QVector m_VecDelete; 53 | quint32 m_qu32SetId ; 54 | QSqlDatabase *m_pqsqlData ; 55 | private : 56 | bool UpdateTable0(quint32 i_u32MachInfo , quint32 i_u32Start ,quint32 i_u32Size ); 57 | bool UpdateTable1(quint32 i_u32MachInfo , quint32 i_u32Start ,quint32 i_u32Size , quint32 i_u32Exrended ); 58 | bool InsertNewMatchInfoEx(quint32 i_u32Start ,quint32 i_u32Size ,quint32 i_u32Exrended , quint32 &o_u32MachInfo); 59 | bool DeleteSetMachInfo(quint32 i_u32MachInfo); 60 | bool InsertNewMatchInfo(quint32 i_u32Start ,quint32 i_u32Size , quint32 &o_u32MachInfo); 61 | bool DeleteSetMachInfoEx(quint32 i_u32MachInfo); 62 | bool GetSizeForInsert(quint32 i_u32Index ,quint32 &o_u32Size); 63 | bool GetExtededFiledFortInsert(quint32 i_u32Index ,quint32& o_u32Extended); 64 | bool GetStart(quint32 i_u32Index ,quint32 &o_u32Start); 65 | bool UpdateStart(quint32 i_u32Index , quint32 i_u32Start , quint32 i_u32Size ,quint32 i_u32Extended); 66 | bool AlreadyExistMatchInfo(quint32 i_qu32Start ,quint32 i_qu32Size ,quint32 &o_qu32MatchInfoId ); 67 | bool UpdateMatchInfo(quint32 i_u32MachInfoOld ,quint32 i_u32MachInfoNew ,quint32 i_u32TableType , quint32 i_u32TableIndex ); 68 | bool ExistMoreMachInfo(quint32 i_u32MachInfo ,quint32 i_u32TableIndex); 69 | bool AlreadyExistMatchInfoEx(quint32 i_qu32Start ,quint32 i_qu32Size, quint32 i_qu32Extended ,quint32 &o_qu32MatchInfoId ); 70 | bool DoQuery(); 71 | bool InsertIntoSetMachinfo(quint32 i_u32MachInfo ,quint32 i_u32setId ,quint32 i_u32Type ,quint32 i_u32TableIndex ); 72 | bool AlreadyExistSetMachinfo(quint32 i_u32MachInfo ,quint32 i_u32setId ,quint32 i_u32Type); 73 | bool DeleteWithId(quint32 i_u32Index); 74 | bool DeleteSetMach (quint32 i_u32SetId , quint32 i_u32CrcMatchInfo ,quint32 i_u32TableIndex); 75 | }; 76 | -------------------------------------------------------------------------------- /Signer/QComboBoxEx.cpp: -------------------------------------------------------------------------------- 1 | #include "QComboBoxEx.h" 2 | #include 3 | QComboBoxEx::QComboBoxEx( QWidget * parent) : QComboBox(parent) 4 | { 5 | } 6 | 7 | QComboBoxEx::~QComboBoxEx(void) 8 | { 9 | } 10 | 11 | void QComboBoxEx::focusOutEvent( QFocusEvent * e ) 12 | { 13 | if (e->lostFocus()) 14 | emit UnFocus(); 15 | } 16 | 17 | void QComboBoxEx::showPopup() 18 | { 19 | emit DoPopup(); 20 | QComboBox::showPopup(); 21 | } 22 | 23 | void QComboBoxEx::hidePopup() 24 | { 25 | emit DoUnPop(); 26 | QComboBox::hidePopup(); 27 | } 28 | -------------------------------------------------------------------------------- /Signer/QComboBoxEx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class QComboBoxEx : 5 | public QComboBox 6 | { 7 | Q_OBJECT 8 | public: 9 | QComboBoxEx( QWidget * parent = 0 ); 10 | ~QComboBoxEx(void); 11 | 12 | virtual void focusOutEvent ( QFocusEvent * e ); 13 | virtual void showPopup () ; 14 | virtual void hidePopup(); 15 | signals: 16 | void UnFocus(); 17 | void DoPopup(); 18 | void DoUnPop(); 19 | 20 | 21 | }; 22 | -------------------------------------------------------------------------------- /Signer/QCompareEngineModel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | class QCompareEngineModel : 6 | public QAbstractTableModel 7 | { 8 | struct RowStruct 9 | { 10 | QString FileName ; 11 | QString SetNameDb ; 12 | QString SetNameDat ; 13 | }; 14 | public: 15 | QCompareEngineModel(QObject * parent); 16 | ~QCompareEngineModel(void); 17 | QVariant data( const QModelIndex &index, int role )const ; 18 | bool setData(const QModelIndex &index, const QVariant &value,int role = Qt::EditRole); 19 | int columnCount(const QModelIndex &parent = QModelIndex()) const ; 20 | bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex()); 21 | int rowCount(const QModelIndex &parent = QModelIndex()) const; 22 | Qt::ItemFlags flags(const QModelIndex &index) const; 23 | QVariant headerData( int section, Qt::Orientation orientation, int role ) const; 24 | private: 25 | QMap m_qmapRows ; 26 | }; 27 | -------------------------------------------------------------------------------- /Signer/QGetPatternFileInfoModel.cpp: -------------------------------------------------------------------------------- 1 | #include "QGetPatternFileInfoModel.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | //--------------------------------------------------------------------------- 9 | QGetPatternFileInfoModel::QGetPatternFileInfoModel(QSqlDatabase *i_pqsqlDb ,QObject * parent , quint32 i_qu32SetId) : QSqlQueryModel(parent) 10 | { 11 | QSqlQuery query (*i_pqsqlDb); 12 | if ( i_qu32SetId == 0xffffffff ) 13 | { 14 | query.prepare("select FileName , MD5 , FileSize , PATH , SetName from FileInfomTbl NATURAL Join SetNameId where OrdinalId IS NULL"); 15 | } 16 | else if ( i_qu32SetId == 0xfffffffe ) 17 | { 18 | query.prepare("select table1.FileName as FileName1 , table1.MD5 as MD51, table1.FileSize as FileSize1, table1.PATH as Path1, table2.FileName as FileName2, table2.MD5 as MD52, table2.FileSize as FileSize2, table2.PATH as Path2 from FileInfomTbl as table1 JOIN FileInfomTbl as table2 ON (table1.id = table2.OrdinalId)"); 19 | } 20 | else if (i_qu32SetId == 0xfffffffd) 21 | { 22 | query.prepare("select FileName , MD5 , FileSize , PATH , SetName from ErrFileInfomTbl NATURAL Join SetNameId"); 23 | } 24 | else 25 | { 26 | query.prepare("select FileName , MD5 , FileSize , PATH from FileInfomTbl where setId =:SetId AND OrdinalId IS NULL"); 27 | query.bindValue(":SetId" , i_qu32SetId); 28 | } 29 | 30 | if ( query.exec()== false ) 31 | { 32 | QString TestSting = query.lastError().text(); 33 | return ; 34 | } 35 | setQuery(query); 36 | } 37 | //--------------------------------------------------------------------------- 38 | QGetPatternFileInfoModel::~QGetPatternFileInfoModel(void) 39 | { 40 | } 41 | //--------------------------------------------------------------------------- 42 | QVariant QGetPatternFileInfoModel::data( const QModelIndex &index, int role ) const 43 | { 44 | if (role == Qt::DisplayRole ) 45 | { 46 | if ( index.column() == 1 || index.column() == 5) 47 | { 48 | QString qstrMd5 ,Temp = "0x" ; 49 | QByteArray tempArray = record((index.row())).value(1).toByteArray(); 50 | for ( int i = 0 ; i 3 | #include 4 | 5 | class QGetPatternModel : 6 | public QAbstractTableModel 7 | { 8 | public: 9 | QGetPatternModel(QObject * parent); 10 | ~QGetPatternModel(void); 11 | struct SetIdCount 12 | { 13 | quint32 u32SetId ; 14 | quint32 u32Count ; 15 | }; 16 | QMap m_qMapSetIdCount; 17 | bool setData(const QModelIndex &index, const QVariant &value,int role = Qt::EditRole); 18 | QVariant data(const QModelIndex &index, int role) const; 19 | int rowCount(const QModelIndex &parent = QModelIndex()) const; 20 | bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex()); 21 | int columnCount(const QModelIndex &parent = QModelIndex()) const ; 22 | bool SetFileInfo (quint32 i_u32SetId ) ; 23 | bool GetSetIdfromRowId (quint32 &o_u32SetId) ; 24 | void Reset(); 25 | 26 | }; 27 | -------------------------------------------------------------------------------- /Signer/QHexEditEx.cpp: -------------------------------------------------------------------------------- 1 | #include "QHexEditEx.h" 2 | 3 | QHexEditEx::QHexEditEx(int i_iTag ,QWidget *parent): QHexEdit(parent) 4 | { 5 | QHexEdit::qHexEdit_p->installEventFilter(this); 6 | m_iTag = i_iTag ; 7 | } 8 | 9 | QHexEditEx::~QHexEditEx(void) 10 | { 11 | 12 | } 13 | 14 | bool QHexEditEx::eventFilter( QObject *target, QEvent *event ) 15 | { 16 | if ( target == QHexEdit::qHexEdit_p ) 17 | { 18 | if (event->type() == QEvent::FocusOut) 19 | { 20 | emit UnFocus(); 21 | } 22 | return QHexEdit::eventFilter(target, event); 23 | } 24 | else 25 | { 26 | return QHexEdit::eventFilter(target, event); 27 | } 28 | } -------------------------------------------------------------------------------- /Signer/QHexEditEx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "qhexedit.h" 3 | 4 | class QHexEditEx : 5 | public QHexEdit 6 | { 7 | Q_OBJECT 8 | public: 9 | explicit QHexEditEx(int i_iTag = 0 ,QWidget *parent = 0); 10 | ~QHexEditEx(void); 11 | bool eventFilter(QObject *target, QEvent *event); 12 | int m_iTag ; 13 | signals: 14 | void UnFocus(); 15 | 16 | 17 | }; 18 | -------------------------------------------------------------------------------- /Signer/QShowVirus.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "qsqlquerymodel" 3 | #include "BaseObject.h" 4 | #include "JBuffer.h" 5 | #include "JFile.h" 6 | #include "FileInf.h" 7 | #include "DatFileStruct.h" 8 | #include 9 | 10 | 11 | struct tagCrcMatchStartEnd 12 | { 13 | quint32 u32Start ; 14 | quint32 u32End ; 15 | }; 16 | 17 | class QSqlDatabase ; 18 | class QShowVirus : 19 | public QSqlQueryModel 20 | { 21 | public: 22 | 23 | Qt::ItemFlags flags(const QModelIndex &index) const; 24 | bool setData(const QModelIndex &index, const QVariant &value,int role); 25 | QVariant data(const QModelIndex &index, int role) const; 26 | int rowCount(const QModelIndex &parent = QModelIndex()) const; 27 | QShowVirus(QSqlDatabase *i_pqsqlDb , QObject * parent , quint32 id); 28 | ~QShowVirus(void); 29 | bool ApplayChange() ; 30 | bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex()); 31 | bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex()); 32 | bool Undo(); 33 | private: 34 | QVector m_VecDelete; 35 | QVector m_qvecCrcMatch ; 36 | QWidget * m_parent; 37 | quint32 m_qu32SetId; 38 | QSqlDatabase *m_pqsqlDb; 39 | bool DoQury(); 40 | bool GetVirusId(quint32 i_u32Row , quint32 &o_u32VirusId); 41 | quint64 GetSignature( UINT32 i_u32Type , UINT32 i_32IdMatchInfo , JFile &ocFileTemp , FileInfo &ocFileInfo ); 42 | QMap m_mapChngShowVirus , m_mapInsertShowVirus; 43 | QMap m_mapInsertCrcMatchStartEnd ; 44 | }; 45 | -------------------------------------------------------------------------------- /Signer/Report.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DlgReport 4 | 5 | 6 | 7 | 0 8 | 0 9 | 550 10 | 391 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Qt::Horizontal 23 | 24 | 25 | 26 | 40 27 | 20 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | Ok 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | Error Value 46 | 47 | 48 | 49 | 50 | File Name 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Signer/SelectDatFile.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Dialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 396 10 | 72 11 | 12 | 13 | 14 | Select dat file 15 | 16 | 17 | Qt::LeftToRight 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 2 27 | 0 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | File Path 36 | 37 | 38 | 39 | 40 | 41 | 42 | Qt::Horizontal 43 | 44 | 45 | 46 | 40 47 | 20 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 0 57 | 0 58 | 59 | 60 | 61 | 62 | 10 63 | 10 64 | 65 | 66 | 67 | 68 | 10 69 | 10 70 | 71 | 72 | 73 | ... 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | Qt::Horizontal 83 | 84 | 85 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | buttonBox 95 | accepted() 96 | Dialog 97 | accept() 98 | 99 | 100 | 248 101 | 254 102 | 103 | 104 | 157 105 | 274 106 | 107 | 108 | 109 | 110 | buttonBox 111 | rejected() 112 | Dialog 113 | reject() 114 | 115 | 116 | 316 117 | 260 118 | 119 | 120 | 286 121 | 274 122 | 123 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /Signer/Signer.pro: -------------------------------------------------------------------------------- 1 | ###################################################################### 2 | # Automatically generated by qmake (2.01a) Wed Jan 25 14:25:31 2012 3 | ###################################################################### 4 | 5 | TEMPLATE = app 6 | TARGET = 7 | DEPENDPATH += . 8 | INCLUDEPATH += . 9 | INCLUDEPATH += D:\Ebrahim\Project\MySQLConnector\include 10 | 11 | # Input 12 | HEADERS += DlgSetView.h \ 13 | HexEditorDelegate.h \ 14 | mainwindow.h \ 15 | QHexEditEx.h \ 16 | QPatternModel.h \ 17 | setmodel.h 18 | FORMS += dialog.ui mainwindow.ui \ 19 | DbTofile1.ui \ 20 | SelectDatFile.ui \ 21 | Report.ui \ 22 | NumberPrompt.ui 23 | SOURCES += DlgSetView.cpp \ 24 | HexEditorDelegate.cpp \ 25 | main.cpp \ 26 | mainwindow.cpp \ 27 | QHexEditEx.cpp \ 28 | QPatternModel.cpp \ 29 | setmodel.cpp 30 | QT += core gui sql 31 | LIBS += D:\Ebrahim\Project\MySQLConnector\lib\opt\mysqlclient.lib D:\Ebrahim\Project\MySQLConnector\lib\opt\libmysql.lib qhexedit.lib 32 | 33 | RESOURCES += \ 34 | SinerResource.qrc 35 | -------------------------------------------------------------------------------- /Signer/dialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DlgView 4 | 5 | 6 | 7 | 0 8 | 0 9 | 608 10 | 517 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | Qt::Horizontal 30 | 31 | 32 | 33 | 40 34 | 20 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | Delete 43 | 44 | 45 | false 46 | 47 | 48 | false 49 | 50 | 51 | false 52 | 53 | 54 | 55 | 56 | 57 | 58 | Add 59 | 60 | 61 | 62 | 63 | 64 | 65 | Applay 66 | 67 | 68 | 69 | 70 | 71 | 72 | Undo 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /Signer/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mainwindow.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | QFileDialog *q_pFileOpenDialog ; 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | QSqlDatabase m_qSqlDatabase ; 15 | QMYSQLDriver *MysqlDriver = new QMYSQLDriver ; 16 | QApplication a(argc, argv); 17 | 18 | m_qSqlDatabase = QSqlDatabase::addDatabase(MysqlDriver); 19 | m_qSqlDatabase.setHostName("127.0.0.1"); 20 | //m_qSqlDatabase.setHostName("192.168.1.113"); 21 | m_qSqlDatabase.setDatabaseName("backdb"); 22 | m_qSqlDatabase.setUserName("root"); 23 | m_qSqlDatabase.setPassword("123456789"); 24 | if ( !m_qSqlDatabase.open() ) 25 | { 26 | QMessageBox::critical(0, QObject::tr("Database Error"), m_qSqlDatabase.lastError().text()); 27 | return -1; 28 | } 29 | 30 | MainWindow w(&m_qSqlDatabase); 31 | w.show(); 32 | q_pFileOpenDialog = new QFileDialog(&w); 33 | return a.exec(); 34 | } 35 | -------------------------------------------------------------------------------- /Signer/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "DlgGetPattern.h" 9 | 10 | class DlgView ; 11 | class QSqlDatabase ; 12 | class EnumGetPatternThread ; 13 | class PattrenFileInfo ; 14 | class MainWindow : public QMainWindow 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | 20 | explicit MainWindow(QSqlDatabase *i_qdbbase , QWidget *parent = 0); 21 | void CreateActions(); 22 | void CreateMenu() ; 23 | bool eventFilter(QObject *target, QEvent *event); 24 | ~MainWindow(); 25 | 26 | private slots : 27 | 28 | void newFile() ; 29 | void ViewSets(); 30 | void ViewPattern(quint32 SetId) ; 31 | void ViewCheckSum(quint32 SetId); 32 | void ViewVirus(quint32 SetId); 33 | void CreateDatFile(); 34 | void CompareEngine(); 35 | void GetPattern(); 36 | void GetFileInfoList ( quint32 , QSqlDatabase *); 37 | 38 | 39 | private : 40 | 41 | QAction * m_qactNewSet ; 42 | QAction * m_qactViewSet ; 43 | QAction * m_qactCreateDAtFile ; 44 | QAction * m_qactGetPattern ; 45 | QAction * m_qactCompareEngine ; 46 | QMdiArea * m_qtmdiArea; 47 | QMenu * FileMenu ; 48 | QMenu * ViewMenu ; 49 | DlgView * m_dlgSetView ; 50 | QMdiSubWindow * m_subWindow; 51 | QSqlDatabase * m_pqsqldb ; 52 | bool m_bViewSetFlag ; 53 | 54 | }; 55 | 56 | #endif // MAINWINDOW_H 57 | -------------------------------------------------------------------------------- /Signer/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 904 10 | 447 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 0 22 | 904 23 | 20 24 | 25 | 26 | 27 | 28 | &file 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | View 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | NewSet 49 | 50 | 51 | 52 | 53 | Take Pattern From File 54 | 55 | 56 | 57 | 58 | Take Pattern From Drictory 59 | 60 | 61 | 62 | 63 | View Set 64 | 65 | 66 | 67 | 68 | View Pattern 69 | 70 | 71 | 72 | 73 | View Virus 74 | 75 | 76 | 77 | 78 | View Checksum 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /Signer/rotate360anticlockwise2red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/Signer/rotate360anticlockwise2red.png -------------------------------------------------------------------------------- /Signer/setmodel.h: -------------------------------------------------------------------------------- 1 | #ifndef SETMODEL_H 2 | #define SETMODEL_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class QSqlDatabase ; 10 | class SetModel : public QAbstractTableModel 11 | { 12 | public: 13 | SetModel(QSqlDatabase *i_qsqlDb , QObject * parent); 14 | ~SetModel(); 15 | int rowCount(const QModelIndex &parent = QModelIndex()) const; 16 | int columnCount(const QModelIndex &parent = QModelIndex()) const; 17 | QVariant data(const QModelIndex &index, int role) const; 18 | QVariant headerData(int section, Qt::Orientation orientation, 19 | int role) const; 20 | Qt::ItemFlags flags(const QModelIndex &index) const; 21 | bool setData(const QModelIndex &index, const QVariant &value,int role = Qt::EditRole); 22 | bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex()); 23 | bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex()); 24 | bool ApplayChange() ; 25 | bool Undo(); 26 | bool GetSetIdfromRowId(quint32 &); 27 | 28 | private: 29 | QSqlDatabase *m_pqsqlDb; 30 | QMap m_Changedmap , InsertMaped; 31 | QVector m_idVector , DeleteVector; 32 | bool DeleteSetId (quint32 u32Setid); 33 | bool ExitMoreOneSet_Pattern(quint32 o_qu32PatTypeId); 34 | bool DeletePatType(quint32 u32PatTypSliceId); 35 | bool deleteSet_Pattern(quint32 u32Setid , quint32 u32PatTypId); 36 | bool ExitMoreOnePatType( quint32 o_qu32PatOffId ); 37 | bool DeletePatOffIdEx(quint32 u32PatOffId); 38 | bool DeletePatOffId (quint32 o_qu32PatOffId); 39 | bool deletePatTypeEx(quint32 u32PatTypSliceId ,quint32 u32PatOffId); 40 | bool ExistMoreOnePatOff( quint32 o_qu32PatId ); 41 | bool DeletePattern(quint32 u32PatternId); 42 | bool ExistMoreOneOffId( quint32 o_qu32OffId ); 43 | bool DeleteOffset(quint32 u32OffId); 44 | bool DeleteVirus (quint32 i_u32VirusId); 45 | bool DeleteSet_Virus(quint32 i_u32Virus ,quint32 i_u32Setid); 46 | bool DeleteCrcMatchInfo(quint32 i_u32CrcMethodId ,quint32 i_u32TableIndex); 47 | bool DeleteSet_CrcMatchInfo(quint32 i_u32CrcMethodId ,quint32 i_u32TableIndex ,quint32 i_u32Setid); 48 | bool ExitMoreOneCrcMethodId(quint32 i_u32CrcMethodId ,quint32 i_u32TableIndex); 49 | QWidget * m_parent; 50 | }; 51 | 52 | #endif // SETMODEL_H 53 | -------------------------------------------------------------------------------- /Signer/ui_GetPtarrenFileInfo.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | ** Form generated from reading UI file 'GetPtarrenFileInfo.ui' 3 | ** 4 | ** Created: Wed May 30 14:37:36 2012 5 | ** by: Qt User Interface Compiler version 4.8.0 6 | ** 7 | ** WARNING! All changes made in this file will be lost when recompiling UI file! 8 | ********************************************************************************/ 9 | 10 | #ifndef UI_GETPTARRENFILEINFO_H 11 | #define UI_GETPTARRENFILEINFO_H 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | QT_BEGIN_NAMESPACE 24 | 25 | class Ui_DlgGetPatternFileInfo 26 | { 27 | public: 28 | QGridLayout *gridLayout; 29 | QDialogButtonBox *buttonBox; 30 | QTableView *TblFileInfo; 31 | 32 | void setupUi(QDialog *DlgGetPatternFileInfo) 33 | { 34 | if (DlgGetPatternFileInfo->objectName().isEmpty()) 35 | DlgGetPatternFileInfo->setObjectName(QString::fromUtf8("DlgGetPatternFileInfo")); 36 | DlgGetPatternFileInfo->resize(580, 397); 37 | gridLayout = new QGridLayout(DlgGetPatternFileInfo); 38 | gridLayout->setObjectName(QString::fromUtf8("gridLayout")); 39 | buttonBox = new QDialogButtonBox(DlgGetPatternFileInfo); 40 | buttonBox->setObjectName(QString::fromUtf8("buttonBox")); 41 | buttonBox->setOrientation(Qt::Horizontal); 42 | buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); 43 | 44 | gridLayout->addWidget(buttonBox, 1, 0, 1, 1); 45 | 46 | TblFileInfo = new QTableView(DlgGetPatternFileInfo); 47 | TblFileInfo->setObjectName(QString::fromUtf8("TblFileInfo")); 48 | 49 | gridLayout->addWidget(TblFileInfo, 0, 0, 1, 1); 50 | 51 | 52 | retranslateUi(DlgGetPatternFileInfo); 53 | QObject::connect(buttonBox, SIGNAL(accepted()), DlgGetPatternFileInfo, SLOT(accept())); 54 | QObject::connect(buttonBox, SIGNAL(rejected()), DlgGetPatternFileInfo, SLOT(reject())); 55 | 56 | QMetaObject::connectSlotsByName(DlgGetPatternFileInfo); 57 | } // setupUi 58 | 59 | void retranslateUi(QDialog *DlgGetPatternFileInfo) 60 | { 61 | DlgGetPatternFileInfo->setWindowTitle(QApplication::translate("DlgGetPatternFileInfo", "File Info", 0, QApplication::UnicodeUTF8)); 62 | } // retranslateUi 63 | 64 | }; 65 | 66 | namespace Ui { 67 | class DlgGetPatternFileInfo: public Ui_DlgGetPatternFileInfo {}; 68 | } // namespace Ui 69 | 70 | QT_END_NAMESPACE 71 | 72 | #endif // UI_GETPTARRENFILEINFO_H 73 | -------------------------------------------------------------------------------- /Signer/ui_NumberPrompt.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | ** Form generated from reading UI file 'NumberPrompt.ui' 3 | ** 4 | ** Created: Wed May 30 14:37:35 2012 5 | ** by: Qt User Interface Compiler version 4.8.0 6 | ** 7 | ** WARNING! All changes made in this file will be lost when recompiling UI file! 8 | ********************************************************************************/ 9 | 10 | #ifndef UI_NUMBERPROMPT_H 11 | #define UI_NUMBERPROMPT_H 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | QT_BEGIN_NAMESPACE 24 | 25 | class Ui_DlgInputNum 26 | { 27 | public: 28 | QGridLayout *gridLayout; 29 | QSpinBox *spinBox; 30 | QDialogButtonBox *buttonBox; 31 | 32 | void setupUi(QDialog *DlgInputNum) 33 | { 34 | if (DlgInputNum->objectName().isEmpty()) 35 | DlgInputNum->setObjectName(QString::fromUtf8("DlgInputNum")); 36 | DlgInputNum->resize(174, 67); 37 | gridLayout = new QGridLayout(DlgInputNum); 38 | gridLayout->setObjectName(QString::fromUtf8("gridLayout")); 39 | spinBox = new QSpinBox(DlgInputNum); 40 | spinBox->setObjectName(QString::fromUtf8("spinBox")); 41 | 42 | gridLayout->addWidget(spinBox, 0, 0, 1, 1); 43 | 44 | buttonBox = new QDialogButtonBox(DlgInputNum); 45 | buttonBox->setObjectName(QString::fromUtf8("buttonBox")); 46 | buttonBox->setOrientation(Qt::Horizontal); 47 | buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); 48 | 49 | gridLayout->addWidget(buttonBox, 1, 0, 1, 1); 50 | 51 | 52 | retranslateUi(DlgInputNum); 53 | QObject::connect(buttonBox, SIGNAL(accepted()), DlgInputNum, SLOT(accept())); 54 | QObject::connect(buttonBox, SIGNAL(rejected()), DlgInputNum, SLOT(reject())); 55 | 56 | QMetaObject::connectSlotsByName(DlgInputNum); 57 | } // setupUi 58 | 59 | void retranslateUi(QDialog *DlgInputNum) 60 | { 61 | DlgInputNum->setWindowTitle(QApplication::translate("DlgInputNum", "Enter Number", 0, QApplication::UnicodeUTF8)); 62 | } // retranslateUi 63 | 64 | }; 65 | 66 | namespace Ui { 67 | class DlgInputNum: public Ui_DlgInputNum {}; 68 | } // namespace Ui 69 | 70 | QT_END_NAMESPACE 71 | 72 | #endif // UI_NUMBERPROMPT_H 73 | -------------------------------------------------------------------------------- /Signer/ui_Report.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | ** Form generated from reading UI file 'Report.ui' 3 | ** 4 | ** Created: Sat Apr 14 17:30:44 2012 5 | ** by: Qt User Interface Compiler version 4.8.0 6 | ** 7 | ** WARNING! All changes made in this file will be lost when recompiling UI file! 8 | ********************************************************************************/ 9 | 10 | #ifndef UI_REPORT_H 11 | #define UI_REPORT_H 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | QT_BEGIN_NAMESPACE 26 | 27 | class Ui_DlgReport 28 | { 29 | public: 30 | QGridLayout *gridLayout; 31 | QHBoxLayout *horizontalLayout; 32 | QSpacerItem *horizontalSpacer_2; 33 | QPushButton *pushButton; 34 | QTableWidget *tableWidget; 35 | 36 | void setupUi(QDialog *DlgReport) 37 | { 38 | if (DlgReport->objectName().isEmpty()) 39 | DlgReport->setObjectName(QString::fromUtf8("DlgReport")); 40 | DlgReport->resize(550, 391); 41 | gridLayout = new QGridLayout(DlgReport); 42 | gridLayout->setObjectName(QString::fromUtf8("gridLayout")); 43 | horizontalLayout = new QHBoxLayout(); 44 | horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); 45 | horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); 46 | 47 | horizontalLayout->addItem(horizontalSpacer_2); 48 | 49 | pushButton = new QPushButton(DlgReport); 50 | pushButton->setObjectName(QString::fromUtf8("pushButton")); 51 | 52 | horizontalLayout->addWidget(pushButton); 53 | 54 | 55 | gridLayout->addLayout(horizontalLayout, 1, 0, 1, 1); 56 | 57 | tableWidget = new QTableWidget(DlgReport); 58 | if (tableWidget->columnCount() < 2) 59 | tableWidget->setColumnCount(2); 60 | QTableWidgetItem *__qtablewidgetitem = new QTableWidgetItem(); 61 | tableWidget->setHorizontalHeaderItem(0, __qtablewidgetitem); 62 | QTableWidgetItem *__qtablewidgetitem1 = new QTableWidgetItem(); 63 | tableWidget->setHorizontalHeaderItem(1, __qtablewidgetitem1); 64 | tableWidget->setObjectName(QString::fromUtf8("tableWidget")); 65 | 66 | gridLayout->addWidget(tableWidget, 0, 0, 1, 1); 67 | 68 | 69 | retranslateUi(DlgReport); 70 | 71 | QMetaObject::connectSlotsByName(DlgReport); 72 | } // setupUi 73 | 74 | void retranslateUi(QDialog *DlgReport) 75 | { 76 | DlgReport->setWindowTitle(QApplication::translate("DlgReport", "Dialog", 0, QApplication::UnicodeUTF8)); 77 | pushButton->setText(QApplication::translate("DlgReport", "Ok", 0, QApplication::UnicodeUTF8)); 78 | QTableWidgetItem *___qtablewidgetitem = tableWidget->horizontalHeaderItem(0); 79 | ___qtablewidgetitem->setText(QApplication::translate("DlgReport", "Error Value", 0, QApplication::UnicodeUTF8)); 80 | QTableWidgetItem *___qtablewidgetitem1 = tableWidget->horizontalHeaderItem(1); 81 | ___qtablewidgetitem1->setText(QApplication::translate("DlgReport", "File Name", 0, QApplication::UnicodeUTF8)); 82 | } // retranslateUi 83 | 84 | }; 85 | 86 | namespace Ui { 87 | class DlgReport: public Ui_DlgReport {}; 88 | } // namespace Ui 89 | 90 | QT_END_NAMESPACE 91 | 92 | #endif // UI_REPORT_H 93 | -------------------------------------------------------------------------------- /Signer/ui_dialog.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | ** Form generated from reading UI file 'dialog.ui' 3 | ** 4 | ** Created: Wed May 30 14:37:35 2012 5 | ** by: Qt User Interface Compiler version 4.8.0 6 | ** 7 | ** WARNING! All changes made in this file will be lost when recompiling UI file! 8 | ********************************************************************************/ 9 | 10 | #ifndef UI_DIALOG_H 11 | #define UI_DIALOG_H 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | QT_BEGIN_NAMESPACE 26 | 27 | class Ui_DlgView 28 | { 29 | public: 30 | QGridLayout *gridLayout; 31 | QTableView *tableView; 32 | QHBoxLayout *horizontalLayout; 33 | QSpacerItem *horizontalSpacer; 34 | QPushButton *BtnDelete; 35 | QPushButton *BtnAdd; 36 | QPushButton *BtnApplay; 37 | QPushButton *BtnUndo; 38 | 39 | void setupUi(QDialog *DlgView) 40 | { 41 | if (DlgView->objectName().isEmpty()) 42 | DlgView->setObjectName(QString::fromUtf8("DlgView")); 43 | DlgView->resize(608, 517); 44 | gridLayout = new QGridLayout(DlgView); 45 | gridLayout->setObjectName(QString::fromUtf8("gridLayout")); 46 | tableView = new QTableView(DlgView); 47 | tableView->setObjectName(QString::fromUtf8("tableView")); 48 | tableView->setLineWidth(0); 49 | 50 | gridLayout->addWidget(tableView, 0, 0, 1, 1); 51 | 52 | horizontalLayout = new QHBoxLayout(); 53 | horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); 54 | horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); 55 | 56 | horizontalLayout->addItem(horizontalSpacer); 57 | 58 | BtnDelete = new QPushButton(DlgView); 59 | BtnDelete->setObjectName(QString::fromUtf8("BtnDelete")); 60 | BtnDelete->setCheckable(false); 61 | BtnDelete->setChecked(false); 62 | BtnDelete->setFlat(false); 63 | 64 | horizontalLayout->addWidget(BtnDelete); 65 | 66 | BtnAdd = new QPushButton(DlgView); 67 | BtnAdd->setObjectName(QString::fromUtf8("BtnAdd")); 68 | 69 | horizontalLayout->addWidget(BtnAdd); 70 | 71 | BtnApplay = new QPushButton(DlgView); 72 | BtnApplay->setObjectName(QString::fromUtf8("BtnApplay")); 73 | 74 | horizontalLayout->addWidget(BtnApplay); 75 | 76 | BtnUndo = new QPushButton(DlgView); 77 | BtnUndo->setObjectName(QString::fromUtf8("BtnUndo")); 78 | 79 | horizontalLayout->addWidget(BtnUndo); 80 | 81 | 82 | gridLayout->addLayout(horizontalLayout, 1, 0, 1, 1); 83 | 84 | 85 | retranslateUi(DlgView); 86 | 87 | QMetaObject::connectSlotsByName(DlgView); 88 | } // setupUi 89 | 90 | void retranslateUi(QDialog *DlgView) 91 | { 92 | DlgView->setWindowTitle(QApplication::translate("DlgView", "Dialog", 0, QApplication::UnicodeUTF8)); 93 | BtnDelete->setText(QApplication::translate("DlgView", "Delete", 0, QApplication::UnicodeUTF8)); 94 | BtnAdd->setText(QApplication::translate("DlgView", "Add", 0, QApplication::UnicodeUTF8)); 95 | BtnApplay->setText(QApplication::translate("DlgView", "Applay", 0, QApplication::UnicodeUTF8)); 96 | BtnUndo->setText(QApplication::translate("DlgView", "Undo", 0, QApplication::UnicodeUTF8)); 97 | } // retranslateUi 98 | 99 | }; 100 | 101 | namespace Ui { 102 | class DlgView: public Ui_DlgView {}; 103 | } // namespace Ui 104 | 105 | QT_END_NAMESPACE 106 | 107 | #endif // UI_DIALOG_H 108 | -------------------------------------------------------------------------------- /TestRar/Unrar.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/TestRar/Unrar.cpp -------------------------------------------------------------------------------- /TestZip/JZipEnumerator.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zareprj/JAV-AV-Engine/c258c1bb283d2cccc358dab5d3a7bacd4fc35790/TestZip/JZipEnumerator.h -------------------------------------------------------------------------------- /dbtofile/DbToFile.h: -------------------------------------------------------------------------------- 1 | #ifndef DBTOFILEH 2 | #define DBTOFILEH 3 | #include 4 | #include "BaseObject.h" 5 | #include "JDecryptedFile.h" 6 | #include "DatFileStruct.h" 7 | class QSqlQuery; 8 | class QSqlDatabase; 9 | class DbToFile : 10 | public BaseObject 11 | { 12 | private : 13 | 14 | QSqlQuery *m_pqSqlQury ; 15 | JDecryptedFile *m_pocFile ; 16 | map m_mapSetKeyToIndex ; 17 | map m_mapPatternKeyToIndex ; 18 | map m_mapCrcMatchKeyToIndex ; 19 | map m_mapCrcExMatchKeyToIndex ; 20 | map m_mapVirusKeyToIndex ; 21 | 22 | public: 23 | 24 | BOOLEAN CreateIDmap(); // مرتب شده بر اساس شاخص 25 | BOOLEAN SetTofile(); // مرتب شده بر اساس شاخص 26 | BOOLEAN PatternTofile(); // مرتب شده براساس شاخص 27 | BOOLEAN CrcMatchToFile(); // مرتب شده بر اساس شاخص 28 | BOOLEAN CrcMatchExtToFile(); // مرتب شده براساس شاخص 29 | BOOLEAN OffsetTofile();// مرتب شده بر اساس بیشترین تعداد استفاده در الگو های مختلف 30 | BOOLEAN VirusNameToFile(); // مرتب شده بر اساس شماره ویروس 31 | BOOLEAN ChecksumTofile();// ذخیره سازی اطلاعات چک سام هامرتب شده بر اساس دسته ها و روشهای گرفتن چک سام ها 32 | BOOLEAN ReSetMatchToFile(); // ذخیره سازی بر اساس چیدمان دسته ها به همراه تعداد و ابتدا جک سامها 33 | BOOLEAN ReOffsetPatToFile(); // ذخیره سازی بر اساس آفست به همراه تعداد نوع ها 34 | BOOLEAN ReOffPatTypeToFile() ; // مرتب سازی بر اساس آفست پترن و ذخیره سازی نوع و تعداد دسته های مرتبط با ان نوع 35 | BOOLEAN ReTypeSetToFile(); // مرتب سازی بر اساس نوع هاو ذخیره سازی دسته ها 36 | DbToFile(QSqlDatabase &i_ocConnect , JDecryptedFile &i_rocFile); 37 | ~DbToFile(void); 38 | }; 39 | #endif 40 | 41 | --------------------------------------------------------------------------------