diff --git a/README.md b/README.md index 73498fd..a61c0b4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Xvirus SDK C++ -Xvirus SDK 4.2.1 C++ bindings. +Xvirus SDK 4.2.2 C++ bindings. ## Table of Contents @@ -37,9 +37,15 @@ The following Operating Systems are supported: ## Changelog +- Version **4.2.2**: + - Optimized scanning speed of PDF files + - ScanResult now returns the file path + - Added new ScanFolder() and ScanFolderString() functions + - Version **4.2.1**: - Optimized scanning speed of big files - Optimized scanning speed in Linux version + - Version **4.2**: - Reduced glibc minimum version to 2.17 on Linux - Added "Logging()" function to enable/disable logging @@ -91,6 +97,8 @@ You can find the definition of all functions and structs in the file `xvneng.h` - "**File not found!**" - If no file is found in the submited path. - "**File too big!**" - If the file size is bigger than the set limit. - "**Could not get file hash!**" - There was an error calculating the hash of the file. +- **scanFolder** - Scans all the files inside the folder at `folderpath`. It will return an pointer for a array of [`ScanResult`](#Model). +- **scanFolderAsString** - Scans all the files inside the folder at `folderpath`. It will return the scan result message for each file scanned. - **checkUpdates** - Checks and updates the databases and AI engine to the most recent versions. If `checkSDKUpdates`=true then it will also check for SDK updates. If `loadDBAfterUpdate`=true then it will reload the Xvirus Scan Engine after the update is done. It can return the following strings: - "**There is a new SDK version available!**" - "**Database was updated!**" @@ -104,15 +112,16 @@ You can find the definition of all functions and structs in the file `xvneng.h` ## Model -The `scan` function returns a struct `ScanResult` with the following properties: +The `scan` and `scanFolder` functions return a struct `ScanResult` with the following properties: ```c++ struct ScanResult { bool sucess; // true if scan was sucessful + wchar_t* error; // error message, only has value if success=false bool isMalware; // true if malware + wchar_t* name; // detection name double score; // between 0 and 1, higher score means more likely to be malware, -1 if there was an error - wchar_t* name; // detection name - wchar_t* error; // error message, only has value if success=false + wchar_t* path; // file path }; ``` diff --git a/bin/Linux/XvirusSDK.so b/bin/Linux/XvirusSDK.so index 3e5a210..2b083ad 100644 Binary files a/bin/Linux/XvirusSDK.so and b/bin/Linux/XvirusSDK.so differ diff --git a/bin/Windows/XvirusSDK.dll b/bin/Windows/XvirusSDK.dll index c013308..c7942f8 100644 Binary files a/bin/Windows/XvirusSDK.dll and b/bin/Windows/XvirusSDK.dll differ diff --git a/example/xvneng.h b/example/xvneng.h index 370cc81..0a43918 100644 --- a/example/xvneng.h +++ b/example/xvneng.h @@ -6,6 +6,8 @@ #define UnloadFnKey "unload" #define ScanFnKey "scan" #define ScanAsStringFnKey "scanAsString" +#define ScanFolderFnKey "scanFolder" +#define ScanFolderAsStringFnKey "scanFolderAsString" #define CheckUpdatesFnKey "checkUpdates" #define GetSettingsFnKey "getSettings" #define LoggingFnKey "logging" @@ -22,16 +24,19 @@ struct ActionResult struct ScanResult { bool sucess; + wchar_t *error; bool isMalware; - double score; wchar_t *name; - wchar_t *error; + double score; + wchar_t *path; }; typedef ActionResult (*LoadFn)(bool force); typedef ActionResult (*UnloadFn)(); typedef ScanResult (*ScanFn)(const wchar_t *filepath); typedef ActionResult (*ScanAsStringFn)(const wchar_t *filepath); +typedef ScanResult *(*ScanFolderFn)(const wchar_t *folderPath); +typedef ActionResult (*ScanFolderAsStringFn)(const wchar_t *folderPath); typedef ActionResult (*CheckUpdatesFn)(bool checkSDKUpdates, bool loadDBAfterUpdate); typedef ActionResult (*GetSettingsFn)(); typedef bool (*LoggingFn)(bool enableLogging); diff --git a/functions.JPG b/functions.JPG index 005ed6f..66f861b 100644 Binary files a/functions.JPG and b/functions.JPG differ diff --git a/headers/xvneng.h b/headers/xvneng.h index 370cc81..0a43918 100644 --- a/headers/xvneng.h +++ b/headers/xvneng.h @@ -6,6 +6,8 @@ #define UnloadFnKey "unload" #define ScanFnKey "scan" #define ScanAsStringFnKey "scanAsString" +#define ScanFolderFnKey "scanFolder" +#define ScanFolderAsStringFnKey "scanFolderAsString" #define CheckUpdatesFnKey "checkUpdates" #define GetSettingsFnKey "getSettings" #define LoggingFnKey "logging" @@ -22,16 +24,19 @@ struct ActionResult struct ScanResult { bool sucess; + wchar_t *error; bool isMalware; - double score; wchar_t *name; - wchar_t *error; + double score; + wchar_t *path; }; typedef ActionResult (*LoadFn)(bool force); typedef ActionResult (*UnloadFn)(); typedef ScanResult (*ScanFn)(const wchar_t *filepath); typedef ActionResult (*ScanAsStringFn)(const wchar_t *filepath); +typedef ScanResult *(*ScanFolderFn)(const wchar_t *folderPath); +typedef ActionResult (*ScanFolderAsStringFn)(const wchar_t *folderPath); typedef ActionResult (*CheckUpdatesFn)(bool checkSDKUpdates, bool loadDBAfterUpdate); typedef ActionResult (*GetSettingsFn)(); typedef bool (*LoggingFn)(bool enableLogging);