diff --git a/src/client_backend/.vs/client_backend/FileContentIndex/1a063ad9-a9b0-412f-9830-4626191c4c01.vsidx b/src/client_backend/.vs/client_backend/FileContentIndex/1a063ad9-a9b0-412f-9830-4626191c4c01.vsidx new file mode 100644 index 0000000..df2ab7b Binary files /dev/null and b/src/client_backend/.vs/client_backend/FileContentIndex/1a063ad9-a9b0-412f-9830-4626191c4c01.vsidx differ diff --git a/src/client_backend/.vs/client_backend/FileContentIndex/25de53d8-e110-42a8-a16d-535cb66c1c6b.vsidx b/src/client_backend/.vs/client_backend/FileContentIndex/25de53d8-e110-42a8-a16d-535cb66c1c6b.vsidx new file mode 100644 index 0000000..1af1117 Binary files /dev/null and b/src/client_backend/.vs/client_backend/FileContentIndex/25de53d8-e110-42a8-a16d-535cb66c1c6b.vsidx differ diff --git a/src/client_backend/.vs/client_backend/FileContentIndex/7cba6441-a281-49da-a951-ea7219da26c6.vsidx b/src/client_backend/.vs/client_backend/FileContentIndex/7cba6441-a281-49da-a951-ea7219da26c6.vsidx deleted file mode 100644 index 70e8d4b..0000000 Binary files a/src/client_backend/.vs/client_backend/FileContentIndex/7cba6441-a281-49da-a951-ea7219da26c6.vsidx and /dev/null differ diff --git a/src/client_backend/.vs/client_backend/FileContentIndex/8116c3c9-700a-420c-b987-686a6fd0d881.vsidx b/src/client_backend/.vs/client_backend/FileContentIndex/8116c3c9-700a-420c-b987-686a6fd0d881.vsidx deleted file mode 100644 index f1ff13f..0000000 Binary files a/src/client_backend/.vs/client_backend/FileContentIndex/8116c3c9-700a-420c-b987-686a6fd0d881.vsidx and /dev/null differ diff --git a/src/client_backend/.vs/client_backend/FileContentIndex/8bfeb671-10e0-4f6a-a8ab-a7ace6121f07.vsidx b/src/client_backend/.vs/client_backend/FileContentIndex/8bfeb671-10e0-4f6a-a8ab-a7ace6121f07.vsidx deleted file mode 100644 index 918116b..0000000 Binary files a/src/client_backend/.vs/client_backend/FileContentIndex/8bfeb671-10e0-4f6a-a8ab-a7ace6121f07.vsidx and /dev/null differ diff --git a/src/client_backend/.vs/client_backend/FileContentIndex/8e08df99-3524-4d73-839f-38ae2e4ef02b.vsidx b/src/client_backend/.vs/client_backend/FileContentIndex/8e08df99-3524-4d73-839f-38ae2e4ef02b.vsidx new file mode 100644 index 0000000..62f8887 Binary files /dev/null and b/src/client_backend/.vs/client_backend/FileContentIndex/8e08df99-3524-4d73-839f-38ae2e4ef02b.vsidx differ diff --git a/src/client_backend/.vs/client_backend/FileContentIndex/93482d3d-3652-4a00-a6fb-3a2b9d460145.vsidx b/src/client_backend/.vs/client_backend/FileContentIndex/93482d3d-3652-4a00-a6fb-3a2b9d460145.vsidx deleted file mode 100644 index 78057f9..0000000 Binary files a/src/client_backend/.vs/client_backend/FileContentIndex/93482d3d-3652-4a00-a6fb-3a2b9d460145.vsidx and /dev/null differ diff --git a/src/client_backend/.vs/client_backend/FileContentIndex/dfcf7357-9d93-469e-b22b-e35f6eb2c010.vsidx b/src/client_backend/.vs/client_backend/FileContentIndex/dfcf7357-9d93-469e-b22b-e35f6eb2c010.vsidx new file mode 100644 index 0000000..0c3391d Binary files /dev/null and b/src/client_backend/.vs/client_backend/FileContentIndex/dfcf7357-9d93-469e-b22b-e35f6eb2c010.vsidx differ diff --git a/src/client_backend/.vs/client_backend/FileContentIndex/e1b0bba7-abdd-42fb-9d99-b1439239d010.vsidx b/src/client_backend/.vs/client_backend/FileContentIndex/e1b0bba7-abdd-42fb-9d99-b1439239d010.vsidx deleted file mode 100644 index 5e23c61..0000000 Binary files a/src/client_backend/.vs/client_backend/FileContentIndex/e1b0bba7-abdd-42fb-9d99-b1439239d010.vsidx and /dev/null differ diff --git a/src/client_backend/.vs/client_backend/FileContentIndex/eaaccf32-993e-4f4c-bc66-d29e61a37b1a.vsidx b/src/client_backend/.vs/client_backend/FileContentIndex/eaaccf32-993e-4f4c-bc66-d29e61a37b1a.vsidx new file mode 100644 index 0000000..56c001f Binary files /dev/null and b/src/client_backend/.vs/client_backend/FileContentIndex/eaaccf32-993e-4f4c-bc66-d29e61a37b1a.vsidx differ diff --git a/src/client_backend/.vs/client_backend/v17/.suo b/src/client_backend/.vs/client_backend/v17/.suo index d8289c1..e830b03 100644 Binary files a/src/client_backend/.vs/client_backend/v17/.suo and b/src/client_backend/.vs/client_backend/v17/.suo differ diff --git a/src/client_backend/.vs/client_backend/v17/Browse.VC.db b/src/client_backend/.vs/client_backend/v17/Browse.VC.db index 007cc7a..ab658fa 100644 Binary files a/src/client_backend/.vs/client_backend/v17/Browse.VC.db and b/src/client_backend/.vs/client_backend/v17/Browse.VC.db differ diff --git a/src/client_backend/app_ctrl.cpp b/src/client_backend/app_ctrl.cpp index 213a830..6073f26 100644 --- a/src/client_backend/app_ctrl.cpp +++ b/src/client_backend/app_ctrl.cpp @@ -1,7 +1,32 @@ #ifndef APP_CTRL_CPP #define APP_CTRL_CPP #include "app_ctrl.h" +bool app_stop_ = false; +bool can_run_thread_ = true; +bool can_scan_folder_ = true; int app_stop() { - return 0; + return app_stop_; +} +int can_run_thread() { + return can_run_thread_; +} +int thread_init() { + can_run_thread_ = false; + return can_run_thread_; +} +int thread_shutdown() { + can_run_thread_ = true; + return can_run_thread_; +} +int can_scan_folder() { + return can_scan_folder_; +} +int scan_folder_init() { + can_scan_folder_ = false; + return can_scan_folder_; +} +int scan_folder_shutdown() { + can_scan_folder_ = true; + return can_scan_folder_; } #endif \ No newline at end of file diff --git a/src/client_backend/app_ctrl.h b/src/client_backend/app_ctrl.h index ceb76d8..445060b 100644 --- a/src/client_backend/app_ctrl.h +++ b/src/client_backend/app_ctrl.h @@ -1,4 +1,10 @@ #ifndef APP_CTRL_H #define APP_CTRL_H int app_stop(); +int can_run_thread(); +int thread_init(); +int thread_shutdown(); +int can_scan_folder(); +int scan_folder_init(); +int scan_folder_shutdown(); #endif \ No newline at end of file diff --git a/src/client_backend/check_dir.cpp b/src/client_backend/check_dir.cpp new file mode 100644 index 0000000..57c6e30 --- /dev/null +++ b/src/client_backend/check_dir.cpp @@ -0,0 +1,360 @@ +#ifndef CHECK_DIR_CPP +#define CHECK_DIR_CPP +#include "check_dir.h" +#include "well_known.h" +#include "log.h" +#include "md5hash.h" +#include "scan.h" +#include "app_ctrl.h" +#include "virus_ctrl.h" +#include "scan.h" +#include "settings.h" +/* old implementation. used up a lot of resource and did not work properly. +void add_to_temp_db(const char*hash) { + //PERIODIC_FOLDER_SCAN_TEMP_DB + FILE*fp; + if (fopen_s(&fp, PERIODIC_FOLDER_SCAN_TEMP_DB, "a") != 0) { + log(LOGLEVEL::ERR, "[add_to_temp_db()]: Error opening temp db: ", PERIODIC_FOLDER_SCAN_TEMP_DB); + return; + } + else { + //log(LOGLEVEL::INFO, "[add_to_temp_db()]: Adding hash: ", hash, " to temp db: ", PERIODIC_FOLDER_SCAN_TEMP_DB); + fprintf_s(fp, "%s\n", hash); + fclose(fp); + } +} +void scan_folder_recursive(const std::string& directory, int thread_id,const std::string&db_file) { + std::string search_path = directory + "\\*.*"; + WIN32_FIND_DATA find_file_data; + HANDLE hFind = FindFirstFile(search_path.c_str(), &find_file_data); + + if (hFind == INVALID_HANDLE_VALUE) { + //std::cerr << "Error opening directory: " << directory << std::endl; + log(LOGLEVEL::ERR, "[scan_folder_recursive()]: Error opening directory: ", directory ," while scanning folder for new files"); + return; + } + + do { + if (strcmp(find_file_data.cFileName, ".") == 0 || strcmp(find_file_data.cFileName, "..") == 0) { + continue; // Skip the current and parent directories + } + + + std::string full_path = directory + "\\" + find_file_data.cFileName; + if (find_file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + // If it's a directory, recurse into it + scan_folder_recursive(full_path, thread_id,db_file); + } + else { + // If it's a file, check if it is in db, else scan it and add it to db + char*hash = new char[300]; + md5_file(full_path.c_str(), hash); + //now find hash in db + if (scan_hash(db_file.c_str(), hash)==1) { + //file is allready in db, skipping + //in order to not keep hashes that are not present anymore in the db, we have to write this hash into a temp dir, which is at the end copied into the main db + add_to_temp_db(hash); + } + else { + //scan the file and add it to db + //scan for virus + + switch (scan_hash(hash)) { + case 1: + //virus found + //log it + log(LOGLEVEL::VIRUS, "[scan_folder_recursive()]: Virus found in file: ", full_path, " while scanning ", directory, " for new files"); + //virus_ctrl_store(full_path.c_str(), hash, "fs"); + break; + case 2: + //error + log(LOGLEVEL::ERR, "[scan_folder_recursive()]: Error while scanning file: ", full_path, " while scanning ", directory, " for new files"); + break; + default: + //not a virus + add_to_temp_db(hash); + break; + } + } + + } + } while (FindNextFile(hFind, &find_file_data) != 0); + + FindClose(hFind); +} +int check_scan_dir(char*dirpath,char*dirname) { + if (can_scan_folder()) { + scan_folder_init(); + //FOLDER_DATABASE_DIR <= the folder where the database for folder checking is stored + //the database is stored in the following format: + /* a file per folder (and its subfolders) + in this db file the hashes of all the files in the folder (and its subfolders) are stored + If a file is detected, which hash is not known, it gets scanned and added to the db. if a hash is inside the db, which is not present in the folder, the hash is rempved from the db + + */ + /* + FILE* fp; + char* path = new char[300]; + path[0] = '\0'; + //build up the path for the db file. + strcpy_s(path, 295, FOLDER_DATABASE_DIR); + strcat_s(path, 295, "\\"); + strcat_s(path, 295, dirname); + strcat_s(path, 295, ".jdbf"); + + //check if the file exists. else we cannot scan the folder + if ((fopen_s(&fp, path, "r")) != 0) { + log(LOGLEVEL::ERR, "[check_scan_dir()]: Error opening database: ", path, " while scanning folder for new files; aborting"); + //try to create the file + if (fopen_s(&fp, path, "w") != 0) { + log(LOGLEVEL::ERR, "[check_scan_dir()]: Error creating new database: ", path, " while scanning folder for new files; aborting"); + } + else { + fprintf_s(fp, "%s\n", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");//write A 32 times A into the file. So the algorithm ha ssomething to map into memory. else it might throw an error + fclose(fp); + } + scan_folder_shutdown(); + return 1; + } + else { + fclose(fp); + //process the files of the folder. + //first: calculate hash of file + //second: check if hash is in db + //if not, scan file and add it to db (only add it if it is not detected as a virus) + scan_folder_recursive(dirpath, 0,path); + //process the found viruses + virus_ctrl_process("fs"); + } + delete[] path; + scan_folder_shutdown(); + return 0; + } + else { + + //there is already a folder scan happening + } +} + +*/ +void process_changes(const FILE_NOTIFY_INFORMATION* pInfo) { + // Allocate a buffer for the file name and copy the content + std::wstring fileName(pInfo->FileName, pInfo->FileNameLength / sizeof(wchar_t)); + + // Print information about the changed file or directory + + //convert wstring to string + std::string filename_str(fileName.begin(), fileName.end()); + filename_str = "c:\\" + filename_str; + //scan the file and send it to virus_ctrl if it is a virus and then process it + std::transform(filename_str.begin(), filename_str.end(), filename_str.begin(), ::tolower); + if (is_folder_excluded(filename_str.c_str())) { + //dont scan excluded files + return; + }else + // action_scanfile(filename_str.c_str()); + log(LOGLEVEL::INFO, "[process_changes()]: File change: ", filename_str.c_str(), " while monitoring directory for changes"); +} +/* +void monitor_directory(LPCSTR directory) { + // Open the directory for monitoring + HANDLE hDir = CreateFile( + directory, + FILE_LIST_DIRECTORY, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, + NULL + ); + + if (hDir == INVALID_HANDLE_VALUE) { + log(LOGLEVEL::ERR, "[monitor_directory()]: Error opening directory: ", directory, " while monitoring directory for changes"); + return; + } + + // Create a buffer for file change notifications + constexpr DWORD bufferSize = 4096; + BYTE buffer[bufferSize]; + + // Monitor the directory for changes + OVERLAPPED overlapped; + memset(&overlapped, 0, sizeof(overlapped)); + overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + + if (ReadDirectoryChangesW( + hDir, + buffer, + bufferSize, + TRUE, + FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_SIZE, + NULL, + &overlapped, + NULL) == 0) { + log(LOGLEVEL::ERR, "[monitor_directory()]: Error reading directory changes: ", GetLastError(), " while monitoring directory for changes"); + CloseHandle(hDir); + return; + } + + log(LOGLEVEL::INFO, "[monitor_directory()]: Monitoring directory: ", directory, " for changes"); + //print_exclusions(); + + // Wait for changes + while (true) { + DWORD bytesReturned; + if (GetOverlappedResult(hDir, &overlapped, &bytesReturned, TRUE)) { + // Process the changes in the buffer + FILE_NOTIFY_INFORMATION* pInfo = reinterpret_cast(buffer); + + do { + process_changes(pInfo); + + pInfo = reinterpret_cast( + reinterpret_cast(pInfo) + pInfo->NextEntryOffset); + + } while (pInfo->NextEntryOffset != 0); + + // Reset the event for the next wait + ResetEvent(overlapped.hEvent); + + // Continue monitoring + if (ReadDirectoryChangesW( + hDir, + buffer, + bufferSize, + TRUE, + FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_SIZE, + NULL, + &overlapped, + NULL) == 0) { + log(LOGLEVEL::ERR, "[monitor_directory()]: Error reading directory changes: ", GetLastError(), " while monitoring directory for changes"); + break; + } + } + else { + DWORD error = GetLastError(); + if (error != ERROR_IO_PENDING) { + log(LOGLEVEL::ERR, "[monitor_directory()]: Error reading directory changes: ", error, " while monitoring directory for changes"); + break; + } + } + + // Wait for the event to be signaled (infinite timeout) + WaitForSingleObject(overlapped.hEvent, INFINITE); + } + + // Cleanup + CloseHandle(overlapped.hEvent); + CloseHandle(hDir); +} +*/ + +void monitor_directory(LPCSTR directory) { + // Open the directory for monitoring + HANDLE hDir = CreateFile( + directory, + FILE_LIST_DIRECTORY, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, + NULL + ); + + if (hDir == INVALID_HANDLE_VALUE) { + std::cerr << "[monitor_directory()]: Error opening directory: " << directory << " while monitoring directory for changes" << std::endl; + return; + } + + // Create a buffer for file change notifications + constexpr DWORD bufferSize = 4096; + BYTE buffer[bufferSize]; + + // Monitor the directory for changes + OVERLAPPED overlapped; + memset(&overlapped, 0, sizeof(overlapped)); + overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + + if (ReadDirectoryChangesW( + hDir, + buffer, + bufferSize, + TRUE, + FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_SIZE, + NULL, + &overlapped, + NULL) == 0) { + std::cerr << "[monitor_directory()]: Error reading directory changes: " << GetLastError() << " while monitoring directory for changes" << std::endl; + CloseHandle(hDir); + return; + } + + std::cout << "[monitor_directory()]: Monitoring directory: " << directory << " for changes" << std::endl; + + // Wait for changes + while (true) { + DWORD bytesReturned; + DWORD waitStatus = WaitForSingleObject(overlapped.hEvent, INFINITE); + + if (waitStatus == WAIT_OBJECT_0) { + if (GetOverlappedResult(hDir, &overlapped, &bytesReturned, FALSE)) { + // Process the changes in the buffer + FILE_NOTIFY_INFORMATION* pInfo = reinterpret_cast(buffer); + + do { + process_changes(pInfo); + + pInfo = reinterpret_cast( + reinterpret_cast(pInfo) + pInfo->NextEntryOffset); + + } while (pInfo->NextEntryOffset != 0); + + // Reset the event for the next wait + ResetEvent(overlapped.hEvent); + + // Continue monitoring + if (ReadDirectoryChangesW( + hDir, + buffer, + bufferSize, + TRUE, + FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_LAST_WRITE, + NULL, + &overlapped, + NULL) == 0) { + std::cerr << "[monitor_directory()]: Error reading directory changes: " << GetLastError() << " while monitoring directory for changes" << std::endl; + break; + } + } + else { + std::cerr << "[monitor_directory()]: Error reading directory changes: " << GetLastError() << " while monitoring directory for changes" << std::endl; + break; + } + } + else { + std::cerr << "[monitor_directory()]: WaitForSingleObject failed: " << GetLastError() << std::endl; + break; + } + } + + // Cleanup + CloseHandle(overlapped.hEvent); + CloseHandle(hDir); +} + +void folder_scanner() { + + //we are in a completely seperate thread then the main thread; unlimited resources wuhuii + FILE*fp; + char* path = new char[300]; + char* foldername = new char[300]; + + //start the watch dir function used to monitor the dir for new files + monitor_directory("C:\\"); + + + delete[] path; + delete[] foldername; +} + +#endif // !CHECK_DIR_CPP \ No newline at end of file diff --git a/src/client_backend/check_dir.h b/src/client_backend/check_dir.h new file mode 100644 index 0000000..361948b --- /dev/null +++ b/src/client_backend/check_dir.h @@ -0,0 +1,11 @@ +#pragma once +#ifndef CHECK_DIR_H +#define CHECK_DIR_H +#include +#include +#include +#include +#include // for std::transform +void folder_scanner(); +#endif // !CHECK_DIR_H + diff --git a/src/client_backend/client_backend.cpp b/src/client_backend/client_backend.cpp index 6610de7..53118bc 100644 --- a/src/client_backend/client_backend.cpp +++ b/src/client_backend/client_backend.cpp @@ -13,8 +13,16 @@ #include "local_com.h" #include "local_schedule.h" #include "log.h" +#include "thread_ctrl.h" +#include "settings.h" +#include "check_dir.h" int main() { printf("welcome to the jakach security tool main thread\n"); + load_settings(); + //start a second thread which will scan for new files + std::thread folder_scannner_thread(folder_scanner); + // + // //main thread: /* watches for notifications on bus * start threads (scans etc); only one at a time may run @@ -29,21 +37,32 @@ int main() { //check for tasks in com //check for scheduled tasks //execute tasks - log(LOGLEVEL::WARN,"test","test2",222); - printf("check_from_com:%d\n",check_for_com_tasks(MAIN_COM, MAIN_COM_PATH)); - printf("check_from_task:%d\n", check_for_sched_tasks(SCHED,SCHED_PATH)); + //call_srv("8.8.8.8","",""); + auto start = std::chrono::high_resolution_clock::now(); + // printf("check_from_com:%d\n",check_for_com_tasks(MAIN_COM, MAIN_COM_PATH)); + // printf("check_from_task:%d\n", check_for_sched_tasks(SCHED,SCHED_PATH)); //unlock_task("tsk1"); else it will only be executed once. but this function has to be called at the end of the task. else it will nvr be executed again. this would be bad :( - Sleep(1000); - - int queue_size=get_queue_size(); - for (int i = 0; i < queue_size; i++) { - char* queue_entry = new char[300 * 2 + 5]; - queue_entry[0] = '\0'; - queue_pop(queue_entry); - printf("%s\n", queue_entry); - delete[] queue_entry; + //start a thread that executes check_scan_dir to scan folders for new files. this thread then should start a ock so only one scanfolder thread runs at a time + //Sleep(1000); + if (can_run_thread()) { + int queue_size = get_queue_size(); + for (int i = 0; i < queue_size; i++) { + char* queue_entry = new char[300 * 2 + 5]; + queue_entry[0] = '\0'; + queue_pop(queue_entry); + //execute the function which starts the threads + // printf("%s\n", queue_entry); + start_thread(queue_entry); + delete[] queue_entry; + } } - printf("\n\n\n"); + //to ensure that the loop takes at least 1 second else it will run too fast nd destroy you CPU :) + auto stop = std::chrono::high_resolution_clock::now(); + auto duration = std::chrono::duration_cast(stop - start); + if (duration.count() < 1000) + Sleep(1000 - duration.count()); + + // printf("\n\n\n"); } diff --git a/src/client_backend/client_backend.cpp~RF5a292d.TMP b/src/client_backend/client_backend.cpp~RF5a292d.TMP new file mode 100644 index 0000000..53118bc --- /dev/null +++ b/src/client_backend/client_backend.cpp~RF5a292d.TMP @@ -0,0 +1,101 @@ +#pragma warning(disable:4996) +#include +#include +#include +#include +//#include +#include "app_ctrl.h" +#include "md5hash.h" +#include "connect.h" +#include "scan.h" +#include "queue_ctrl.h" +#include "well_known.h" +#include "local_com.h" +#include "local_schedule.h" +#include "log.h" +#include "thread_ctrl.h" +#include "settings.h" +#include "check_dir.h" +int main() { + printf("welcome to the jakach security tool main thread\n"); + load_settings(); + //start a second thread which will scan for new files + std::thread folder_scannner_thread(folder_scanner); + // + // + //main thread: + /* watches for notifications on bus + * start threads (scans etc); only one at a time may run + * updates settings etc + * start scheduled tasks + + + */ + + while (!app_stop()) { + //run all the tasks described above + //check for tasks in com + //check for scheduled tasks + //execute tasks + //call_srv("8.8.8.8","",""); + auto start = std::chrono::high_resolution_clock::now(); + // printf("check_from_com:%d\n",check_for_com_tasks(MAIN_COM, MAIN_COM_PATH)); + // printf("check_from_task:%d\n", check_for_sched_tasks(SCHED,SCHED_PATH)); + //unlock_task("tsk1"); else it will only be executed once. but this function has to be called at the end of the task. else it will nvr be executed again. this would be bad :( + //start a thread that executes check_scan_dir to scan folders for new files. this thread then should start a ock so only one scanfolder thread runs at a time + //Sleep(1000); + if (can_run_thread()) { + int queue_size = get_queue_size(); + for (int i = 0; i < queue_size; i++) { + char* queue_entry = new char[300 * 2 + 5]; + queue_entry[0] = '\0'; + queue_pop(queue_entry); + //execute the function which starts the threads + // printf("%s\n", queue_entry); + start_thread(queue_entry); + delete[] queue_entry; + } + } + //to ensure that the loop takes at least 1 second else it will run too fast nd destroy you CPU :) + auto stop = std::chrono::high_resolution_clock::now(); + auto duration = std::chrono::duration_cast(stop - start); + if (duration.count() < 1000) + Sleep(1000 - duration.count()); + + // printf("\n\n\n"); + } + + + + + + //ListFilesRecursive("C:\\", 0); + /*char md5Hash[2 * MD5_DIGEST_LENGTH + 1]; // +1 for null-terminator + printf("Hash of the executable: "); + md5_file("C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\x64\\Debug\\client_backend.exe", md5Hash); + printf("%s", md5Hash); + char a_[2000]; + printf("\nerror:%d\n",connect_to_srv("https://self-signed.badssl.com/", a_, 2000,1)); //error 60: self signed => option für self-signed ignorieren aktivieren (bool ignore_invalid=true) + printf("%s", a_); //error 6: not reachable + download_file_from_srv("https://jakach.duckdns.org/php/login/v3/login.php", "c:\\programdata\\jakach\\out12.txt"); + /* + const int numThreads = 12; + std::thread threads[numThreads]; + + for (int i = 0; i < numThreads; ++i) { + threads[i] = std::thread(ListFilesRecursive, "C:\\Users\\janis\\Documents\\ma_av_tests",i); + } + + // Join threads to wait for them to finish + for (int i = 0; i < numThreads; ++i) { + threads[i].join(); + } + + std::cout << "All threads have finished." << std::endl; + */ + + //printf("code:%d",scan_hash("C:\\Users\\janis\\Documents\\ma_av_tests\\OutputFile.txt", "1fddc13c02a79442c911a44b02ee0f58")); + + return 0; +} + diff --git a/src/client_backend/client_backend.rc b/src/client_backend/client_backend.rc new file mode 100644 index 0000000..daaec21 Binary files /dev/null and b/src/client_backend/client_backend.rc differ diff --git a/src/client_backend/client_backend.sln b/src/client_backend/client_backend.sln index bfd0a1d..3d47ef1 100644 --- a/src/client_backend/client_backend.sln +++ b/src/client_backend/client_backend.sln @@ -17,8 +17,8 @@ Global {56E65283-AAC9-43F6-9613-72BE8D648AC4}.Debug|x64.Build.0 = Debug|x64 {56E65283-AAC9-43F6-9613-72BE8D648AC4}.Debug|x86.ActiveCfg = Debug|Win32 {56E65283-AAC9-43F6-9613-72BE8D648AC4}.Debug|x86.Build.0 = Debug|Win32 - {56E65283-AAC9-43F6-9613-72BE8D648AC4}.Release|x64.ActiveCfg = Release|x64 - {56E65283-AAC9-43F6-9613-72BE8D648AC4}.Release|x64.Build.0 = Release|x64 + {56E65283-AAC9-43F6-9613-72BE8D648AC4}.Release|x64.ActiveCfg = Debug|x64 + {56E65283-AAC9-43F6-9613-72BE8D648AC4}.Release|x64.Build.0 = Debug|x64 {56E65283-AAC9-43F6-9613-72BE8D648AC4}.Release|x86.ActiveCfg = Release|Win32 {56E65283-AAC9-43F6-9613-72BE8D648AC4}.Release|x86.Build.0 = Release|Win32 EndGlobalSection diff --git a/src/client_backend/client_backend.vcxproj b/src/client_backend/client_backend.vcxproj index ba03431..12c31a3 100644 --- a/src/client_backend/client_backend.vcxproj +++ b/src/client_backend/client_backend.vcxproj @@ -138,6 +138,7 @@ + @@ -147,8 +148,12 @@ + + + + @@ -156,9 +161,16 @@ + + + + + + + diff --git a/src/client_backend/client_backend.vcxproj.filters b/src/client_backend/client_backend.vcxproj.filters index 3ab1631..0e2bae4 100644 --- a/src/client_backend/client_backend.vcxproj.filters +++ b/src/client_backend/client_backend.vcxproj.filters @@ -48,6 +48,18 @@ Headerdateien + + Headerdateien + + + Headerdateien + + + Headerdateien + + + Headerdateien + @@ -77,5 +89,25 @@ Headerdateien + + Headerdateien + + + Headerdateien + + + Headerdateien + + + Headerdateien + + + Headerdateien + + + + + Ressourcendateien + \ No newline at end of file diff --git a/src/client_backend/connect.cpp b/src/client_backend/connect.cpp index 7113dac..aa2fc5d 100644 --- a/src/client_backend/connect.cpp +++ b/src/client_backend/connect.cpp @@ -78,4 +78,29 @@ int download_file_from_srv(const char* url, const char* outputFileName) { return 0; } + + +int call_srv(const char*server_url,const char*get_request,const char*additional) { + CURL* curl; + CURLcode res; + std::string readBuffer; + char*url=new char[1000]; + url[0] = '\0'; + + curl = curl_easy_init(); + if (curl) { + char* output = curl_easy_escape(curl, additional, strlen(additional)); + sprintf_s(url, 995, "%s%s%s", server_url, get_request,output); + curl_easy_setopt(curl, CURLOPT_URL, url); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); + res = curl_easy_perform(curl); + curl_free(output); + curl_easy_cleanup(curl); + delete[] url; + return res; + } + delete[] url; + return 0; +} #endif \ No newline at end of file diff --git a/src/client_backend/connect.h b/src/client_backend/connect.h index f0d71c1..137391d 100644 --- a/src/client_backend/connect.h +++ b/src/client_backend/connect.h @@ -1,6 +1,10 @@ #pragma once #include +#include +#include +#include #include #include int connect_to_srv(const char* url, char* out, int max_len, bool ignore_insecure); -int download_file_from_srv(const char* url, const char* outputFileName); \ No newline at end of file +int download_file_from_srv(const char* url, const char* outputFileName); +int call_srv(const char*, const char*,const char*); \ No newline at end of file diff --git a/src/client_backend/local_com.cpp b/src/client_backend/local_com.cpp index 979ffce..00f2f94 100644 --- a/src/client_backend/local_com.cpp +++ b/src/client_backend/local_com.cpp @@ -7,7 +7,6 @@ int check_for_com_tasks(const char* com_name, const char* com_path) { FILE* fp=nullptr; char* command=new char [300]; if ((fopen_s(&fp,com_path, "r")) != 0) { - //panic, create log entry, return 1; //no com file found = no communication needed delete[] command; return 1; @@ -16,7 +15,6 @@ int check_for_com_tasks(const char* com_name, const char* com_path) { while (!feof(fp)) { fscanf_s(fp, "%s", command, 295); // get the command if (!feof(fp)) { //last line =\n we dont want to process that - //printf("%s\n", command); //we scanned the command, now we will scan the path. If the process does not need a path the path will be nopath. (set from client) //get a full path. => " = start, second "= end char* path = new char[300]; diff --git a/src/client_backend/local_schedule.cpp b/src/client_backend/local_schedule.cpp index c6dfb31..6b879ff 100644 --- a/src/client_backend/local_schedule.cpp +++ b/src/client_backend/local_schedule.cpp @@ -2,6 +2,7 @@ #define LOCAL_SCHEDULE_CPP #include "local_schedule.h" #include "queue_ctrl.h" +#include "log.h" /* * To do: * read scheduled tasks form file @@ -88,6 +89,7 @@ int check_for_sched_tasks(const char* sched_name, const char* sched_path) { if ((fopen_s(&fp, sched_path, "r")) != 0) { //panic, create log entry, return 1; //no schedule file found. this is not normal + log(LOGLEVEL::ERR, "[check_for_sched_tasks()]: Error opening schedule file: ", sched_path, " while checking for scheduled tasks; aborting"); delete[] command; return 1; } @@ -151,16 +153,14 @@ int check_for_sched_tasks(const char* sched_name, const char* sched_path) { queue_entry[0] = '\0'; strcpy_s(queue_entry, 600, command); //copy the command strcat_s(queue_entry, 600, ";"); //add a ; to seperate command and path - //printf("%d\n", strlen(path)); strcat_s(queue_entry, 600, path); //add the path - //printf("%s::%d\n",queue_entry,strlen(queue_entry)); queue_push(queue_entry); delete[] queue_entry; } } else { - //echo something was malformatted + log(LOGLEVEL::ERR, "[check_for_sched_tasks()]: Error reading schedule file: ", sched_path, " while checking for scheduled tasks (malformat); aborting"); } delete[] datetime; delete[] path; diff --git a/src/client_backend/log.cpp b/src/client_backend/log.cpp index 55a3948..eca71dd 100644 --- a/src/client_backend/log.cpp +++ b/src/client_backend/log.cpp @@ -10,6 +10,11 @@ std::string get_loglevel(LOGLEVEL level) { return "WARNING"; case LOGLEVEL::ERR: return "ERROR"; + case LOGLEVEL::VIRUS: + return "VIRUS"; + case LOGLEVEL::RISK: + return "RISK"; + default: return "UNKNOWN"; } diff --git a/src/client_backend/log.h b/src/client_backend/log.h index 33570e5..7f4dcb8 100644 --- a/src/client_backend/log.h +++ b/src/client_backend/log.h @@ -9,7 +9,9 @@ enum class LOGLEVEL { INFO, WARN, - ERR + ERR, + VIRUS, + RISK }; std::string get_loglevel(LOGLEVEL level); @@ -18,8 +20,9 @@ template void log(LOGLEVEL level, const std::string& message, Args&&... args) { std::string prefix = get_loglevel(level); std::time_t now = std::time(nullptr); - std::tm tm = *std::localtime(&now); - + std::tm tm; + localtime_s(&tm, &now); + int error = 0; std::ostringstream logStream; logStream << std::put_time(&tm, "%Y-%m-%d %H:%M:%S") << " " << prefix << " " << message; if constexpr (sizeof...(args) > 0) { @@ -27,31 +30,62 @@ void log(LOGLEVEL level, const std::string& message, Args&&... args) { } logStream << std::endl; std::string logString = logStream.str(); - + printf("info from logger: %s", logString.c_str()); // Open the file based on log level - std::ofstream logFile; + FILE* fp; switch (level) { case LOGLEVEL::INFO: - logFile.open(INFOFILE, std::ios_base::app); + error=fopen_s(&fp, INFOFILE, "a"); break; case LOGLEVEL::WARN: - logFile.open(WARNFILE, std::ios_base::app); + error=fopen_s(&fp, WARNFILE, "a"); break; case LOGLEVEL::ERR: - logFile.open(ERRORFILE, std::ios_base::app); + error=fopen_s(&fp, ERRORFILE, "a"); break; - } + case LOGLEVEL::VIRUS: + error=fopen_s(&fp, VIRUSFILE, "a"); + break; + case LOGLEVEL::RISK: + error=fopen_s(&fp, RISKFILE, "a"); + break; - // Write the log to the file - if (logFile.is_open()) { - logFile << logString.c_str(); - logFile.close(); + default: + error=fopen_s(&fp, LOGFILE, "a"); + break; + } + if (error != 0) { + //panic, create log entry, return 1; + //printf("a"); + return; } - //write the log to the general file - logFile.open(LOGFILE, std::ios_base::app); - if (logFile.is_open()) { - logFile << logString.c_str(); - logFile.close(); + else { + switch (level) { + case LOGLEVEL::INFO: + fprintf_s(fp, "%s", logString.c_str()); + break; + case LOGLEVEL::WARN: + fprintf_s(fp, "%s", logString.c_str()); + break; + case LOGLEVEL::ERR: + fprintf_s(fp, "%s", logString.c_str()); + break; + case LOGLEVEL::VIRUS: + fprintf_s(fp, "%s", logString.c_str()); + break; + case LOGLEVEL::RISK: + fprintf_s(fp, "%s", logString.c_str()); + break; + + default: + fprintf_s(fp, "%s", logString.c_str()); + break; + } + fclose(fp); + if (fopen_s(&fp, LOGFILE, "a") == 0) { + fprintf_s(fp, "%s", logString.c_str()); + fclose(fp); + } } } diff --git a/src/client_backend/permissions.cpp b/src/client_backend/permissions.cpp index 3cd4aa4..347391a 100644 --- a/src/client_backend/permissions.cpp +++ b/src/client_backend/permissions.cpp @@ -46,97 +46,5 @@ BOOL create_file_protection(SECURITY_ATTRIBUTES* pSA) &(pSA->lpSecurityDescriptor), NULL); } -/* - -BOOL CreateMyDACL(SECURITY_ATTRIBUTES*); - -int main() -{ - SECURITY_ATTRIBUTES sa; - - sa.nLength = sizeof(SECURITY_ATTRIBUTES); - sa.bInheritHandle = FALSE; - - // Call function to set the DACL. The DACL - // is set in the SECURITY_ATTRIBUTES - // lpSecurityDescriptor member. - if (!CreateMyDACL(&sa)) - { - // Error encountered; generate message and exit. - printf("Failed CreateMyDACL\n"); - exit(1); - } - - // Use the updated SECURITY_ATTRIBUTES to specify - // security attributes for securable objects. - // This example uses security attributes during - // creation of a new directory. - if (0 == CreateDirectory(TEXT("C:\\MyFolder"), &sa)) - { - // Error encountered; generate message and exit. - printf("Failed CreateDirectory\n"); - exit(1); - } - - // Free the memory allocated for the SECURITY_DESCRIPTOR. - if (NULL != LocalFree(sa.lpSecurityDescriptor)) - { - // Error encountered; generate message and exit. - printf("Failed LocalFree\n"); - exit(1); - } - return 0; -} - - -// CreateMyDACL. -// Create a security descriptor that contains the DACL -// you want. -// This function uses SDDL to make Deny and Allow ACEs. -// -// Parameter: -// SECURITY_ATTRIBUTES * pSA -// Pointer to a SECURITY_ATTRIBUTES structure. It is your -// responsibility to properly initialize the -// structure and to free the structure's -// lpSecurityDescriptor member when you have -// finished using it. To free the structure's -// lpSecurityDescriptor member, call the -// LocalFree function. -// -// Return value: -// FALSE if the address to the structure is NULL. -// Otherwise, this function returns the value from the -// ConvertStringSecurityDescriptorToSecurityDescriptor -// function. -BOOL CreateMyDACL(SECURITY_ATTRIBUTES* pSA) -{ - // Define the SDDL for the DACL. This example sets - // the following access: - // Built-in guests are denied all access. - // Anonymous logon is denied all access. - // Authenticated users are allowed - // read/write/execute access. - // Administrators are allowed full control. - // Modify these values as needed to generate the proper - // DACL for your application. - TCHAR* szSD = TEXT("D:") - TEXT("(D;OICI;GA;;;BG)") // Deny access to authenticated users - TEXT("(D;OICI;GA;;;AN)") // Deny access to authenticated users - //TEXT("(D;OICI;GA;;;AU)") // Deny access to authenticated users - TEXT("(A;OICI;GA;;;BA)"); // Allow full control to builtinadministrators - TEXT("(A;OICI;GA;;;AA)"); // Allow full control to administrators - - - if (NULL == pSA) - return FALSE; - - return ConvertStringSecurityDescriptorToSecurityDescriptor( - szSD, - SDDL_REVISION_1, - &(pSA->lpSecurityDescriptor), - NULL); -} -*/ #endif \ No newline at end of file diff --git a/src/client_backend/queue _ctrl.cpp b/src/client_backend/queue _ctrl.cpp index 02329fc..7d8cfe4 100644 --- a/src/client_backend/queue _ctrl.cpp +++ b/src/client_backend/queue _ctrl.cpp @@ -3,8 +3,8 @@ #include "queue_ctrl.h" #include #define queue_limit 1000 -#define command_limit 100 -char queue[1000][100]; +#define command_limit 300 +char queue[queue_limit][command_limit]; int queue_size = 0; int queue_start = 0; int queue_end = 0; diff --git a/src/client_backend/resource.h b/src/client_backend/resource.h new file mode 100644 index 0000000..6582501 --- /dev/null +++ b/src/client_backend/resource.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by client_backend.rc + +// Nächste Standardwerte für neue Objekte +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/src/client_backend/scan.cpp b/src/client_backend/scan.cpp index e2ffcdd..eca5066 100644 --- a/src/client_backend/scan.cpp +++ b/src/client_backend/scan.cpp @@ -6,16 +6,30 @@ #include #include "md5hash.h" #include +#include "well_known.h" +#include "log.h" +#include "virus_ctrl.h" #ifndef SCAN_CPP #define SCAN_CPP int cnt = 0; +bool file_exists(const std::string& filePath) { + DWORD fileAttributes = GetFileAttributes(filePath.c_str()); + + if (fileAttributes == INVALID_FILE_ATTRIBUTES) { + // The file does not exist or there was an error + return false; + } + + // Check if it's a regular file and not a directory + return (fileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0; +} void ListFilesRecursive(const std::string& directory, int thread_id) { std::string search_path = directory + "\\*.*"; WIN32_FIND_DATA find_file_data; HANDLE hFind = FindFirstFile(search_path.c_str(), &find_file_data); if (hFind == INVALID_HANDLE_VALUE) { - std::cerr << "Error opening directory: " << directory << std::endl; + log(LOGLEVEL::ERR, "[ListFilesRecursive()]: Error opening directory: ", directory, " while scanning files inside folder."); return; } @@ -53,20 +67,20 @@ void ListFilesRecursive(const std::string& directory, int thread_id) { int scan_hash(const std::string& filename, const std::string& searchString) {//!!!! does not work with e.g. utf-16 or something like that. either ascii or utf8!! HANDLE hFile = CreateFile(filename.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { - std::cerr << "Error: Unable to open the file." << std::endl; + log(LOGLEVEL::ERR, "[scan_hash()]: Error opening database file: ", filename, " while searching for hash.", searchString); return 2; } HANDLE hMapping = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL); if (hMapping == NULL) { - std::cerr << "Error: Unable to create file mapping." << std::endl; + log(LOGLEVEL::ERR, "[scan_hash()]: Error creating database file mapping: ", filename, " while searching for hash."); CloseHandle(hFile); return 2; } char* fileData = static_cast(MapViewOfFile(hMapping, FILE_MAP_READ, 0, 0, 0)); if (fileData == NULL) { - std::cerr << "Error: Unable to map the file into memory." << std::endl; + log(LOGLEVEL::ERR, "[scan_hash()]: Error mapping database file: ", filename, " while searching for hash."); CloseHandle(hMapping); CloseHandle(hFile); return 2; @@ -90,4 +104,27 @@ int scan_hash(const std::string& filename, const std::string& searchString) {//! CloseHandle(hFile); return 0; } +int scan_hash(const char* hash) { + char* path = new char[600]; + path[0] = '\0'; + sprintf_s(path, 595, "%s\\%c%c.jdbf", DB_DIR, hash[0],hash[1]); + return scan_hash(path,hash); +} + +void action_scanfile(const char*filepath) { + if (strlen(filepath) == 0 or strcmp("", filepath) == 0 or file_exists(filepath)==false) { + log(LOGLEVEL::ERR, "[action_scanfile()]: Error opening file: ", filepath, " while scanning file for viruses."); + return; //no filepath given + } + char*hash = new char[300]; + md5_file(filepath, hash); + if (scan_hash(hash)==1) { //virus found + log(LOGLEVEL::VIRUS, "[action_scanfile()]: Virus found in file: ", filepath); + //add it to a database which stores filepaths of infected files + virus_ctrl_store(filepath,hash,"sf"); + //afterwards do the processing with that file + virus_ctrl_process("sf"); + } + delete[] hash; +} #endif \ No newline at end of file diff --git a/src/client_backend/scan.h b/src/client_backend/scan.h index f4bb40a..7207762 100644 --- a/src/client_backend/scan.h +++ b/src/client_backend/scan.h @@ -1,4 +1,7 @@ #pragma once #include void ListFilesRecursive(const std::string& directory,int thread_id); -int scan_hash(const std::string& filename, const std::string& searchString); \ No newline at end of file +int scan_hash(const std::string& filename, const std::string& searchString); +int scan_hash(const char* hash); +int scan_hash(const char* hash); +void action_scanfile(const char* filepath); \ No newline at end of file diff --git a/src/client_backend/settings.cpp b/src/client_backend/settings.cpp new file mode 100644 index 0000000..47fa27f --- /dev/null +++ b/src/client_backend/settings.cpp @@ -0,0 +1,127 @@ +#ifndef SETTINGS_CPP +#define SETTINGS_CPP +#include "settings.h" +#include "well_known.h" +#include "log.h" +int setting_virus_ctrl_virus_found_action = 0; +char*setting_server_server_url = new char[300]; +char exluded_folders[100][300]; +int excluded_folders_size = 0; + +void load_excluded_folders(); +int load_settings() { + FILE* fp; + + if (fopen_s(&fp, SETTINGS_DB, "r")!=0) { + log(LOGLEVEL::ERR, "[load_settings()]: Could not open settings file. ", SETTINGS_DB); + return 1; + } + else { + char*settings_cmd=new char[300]; + char*settings_arg= new char[300]; + while (!feof(fp)) { + fscanf_s(fp, "%s", settings_cmd, 295); // get the command + //now check which setting it is. + if (strcmp(settings_cmd, "virus_ctrl:virus_found:action") == 0) { + fscanf_s(fp, "%s", settings_arg, 295); // get the argument + if (strcmp(settings_arg, "remove") == 0) { + setting_virus_ctrl_virus_found_action = 1; //1=remove + } + else if (strcmp(settings_arg, "quarantine") == 0) { + setting_virus_ctrl_virus_found_action = 2; //2=quarantine + } + else if (strcmp(settings_arg, "ignore") == 0) { + setting_virus_ctrl_virus_found_action = 3; //3=ignore + } + else if (strcmp(settings_arg, "call_srv") == 0) { + setting_virus_ctrl_virus_found_action = 4; //4=call_srv <= only call the server and tell it, do not remove or quarantine + } + } + else if (strcmp(settings_cmd, "server:server_url") == 0) { + fscanf_s(fp, "%s", settings_arg, 295); // get the argument + strcpy_s(setting_server_server_url, 295, settings_arg); + } + + + } + + + delete[] settings_cmd; + delete[] settings_arg; + } + load_excluded_folders(); + return 0; +} + +//we have two different get_setting functions. One for int and one for char* return values +int get_setting(const char*setting_name) { + if (strcmp(setting_name, "virus_ctrl:virus_found:action") == 0) { + return setting_virus_ctrl_virus_found_action; + } + + return -1; +} +int get_setting(const char* setting_name,char*out) { + if (strcmp(setting_name, "server:server_url") == 0) { + strcpy_s(out, 295, setting_server_server_url); + return 0; + } + + return -1; +} + +void load_excluded_folders() { + FILE* fp; + if (fopen_s(&fp, EXCLUDED_FOLDERS, "r") != 0) { + log(LOGLEVEL::ERR, "[load_excluded_folders()]: Could not open excluded folders file. ", EXCLUDED_FOLDERS); + return; + } + else { + char* path = new char[300]; + while (!feof(fp)) { + //get the path of an excluded folder + path[0] = '\0'; + //the path is encapsulated with " + int cnt = 0; + int chr = 0; + chr = fgetc(fp); + if (chr == '\"') { + chr = 0; + while (cnt < 295 && chr != '\"') { + chr = fgetc(fp); //get a char + if (chr != '\"') + path[cnt] = chr; + path[cnt + 1] = '\0'; + cnt++; + } + //now add the path to the array + if (excluded_folders_size < 95) { + strcpy_s(exluded_folders[excluded_folders_size], 295, path); + excluded_folders_size++; + } + else { + log(LOGLEVEL::ERR, "[load_excluded_folders()]: Excluded folders array is full. Cannot add more folders."); + } + } + else { + log(LOGLEVEL::ERR, "[load_excluded_folders()]: Error while processing excluded folders database. Expected \" but got ", chr); + } + } + fclose(fp); + delete[] path; + } +} +bool is_folder_excluded(const char*path) { + for (int i = 0; i < excluded_folders_size; i++) { + if (strstr(path,exluded_folders[i]) != 0 and strcmp(exluded_folders[i],"")!=0 and strcmp(exluded_folders[i], " ") != 0 ) { + return true; + } + } + return false; +} +void print_exclusions() { + for (int i = 0; i < excluded_folders_size; i++) { + log(LOGLEVEL::INFO, "[print_exclusions()]: Excluded folder: ", exluded_folders[i]); + } +} +#endif \ No newline at end of file diff --git a/src/client_backend/settings.h b/src/client_backend/settings.h new file mode 100644 index 0000000..d3f66be --- /dev/null +++ b/src/client_backend/settings.h @@ -0,0 +1,11 @@ +#pragma once +#ifndef SETTINGS_H +#define SETTINGS_H +#include +#include +int get_setting(const char* setting_name); +int get_setting(const char* setting_name,char*out); +int load_settings(); +bool is_folder_excluded(const char* path); +void print_exclusions(); +#endif \ No newline at end of file diff --git a/src/client_backend/thread_ctrl.cpp b/src/client_backend/thread_ctrl.cpp new file mode 100644 index 0000000..abaed1d --- /dev/null +++ b/src/client_backend/thread_ctrl.cpp @@ -0,0 +1,48 @@ +#ifndef THREAD_CTRL_CPP +#define THREAD_CTRL_CPP +#include "thread_ctrl.h" + +void split(char* input,char*delimiter, char* out1, char* out2) { + //split a string at the delimiter. the delimiter only occurs once. so the first part is out1 and the second part is out2 + int i = 0; + int j = 0; + int k = 0; + while (input[i] != '\0') { + if (input[i] == delimiter[0]) { + out1[j] = '\0'; + i++; + while (input[i] != '\0') { + out2[k] = input[i]; + i++; + k++; + } + out2[k] = '\0'; + return; + } + else { + out1[j] = input[i]; + i++; + j++; + } + } +} +int start_thread(const char*command) { + char*out2= new char[100]; //for the command + char*out1 = new char[300]; //for the arguments + split((char*)command, (char*)";", (char*)out1, (char*)out2); + + //printf("out1: %s\n", out1); + //printf("out2: %s\n", out2); + //determine what should be executed + if(strcmp(out1,"scanfile")==0){ + //start a new thread with the scanfile function + //std::thread t1(scanfile, out2); + } + + + delete[] out1; + delete[] out2; + return 0; +} + +#endif \ No newline at end of file diff --git a/src/client_backend/thread_ctrl.h b/src/client_backend/thread_ctrl.h new file mode 100644 index 0000000..dd013cb --- /dev/null +++ b/src/client_backend/thread_ctrl.h @@ -0,0 +1,11 @@ +#pragma once +#ifndef THREAD_CTRL_H +#define THREAD_CTRL_H + +#include +#include +#include +#include + +int start_thread(const char*command); +#endif \ No newline at end of file diff --git a/src/client_backend/virus_ctrl.cpp b/src/client_backend/virus_ctrl.cpp new file mode 100644 index 0000000..ac052c3 --- /dev/null +++ b/src/client_backend/virus_ctrl.cpp @@ -0,0 +1,116 @@ +#ifndef VIRUS_CTRL_CPP +#define VIRUS_CTRL_CPP +#include "virus_ctrl.h" +#include "well_known.h" +#include "log.h" +#include "settings.h" +#include "connect.h" +int virus_ctrl_store(const char*path,const char*hash,const char*id) { + FILE* fp; + char *db_path = new char[300]; + strcpy_s(db_path, 295,VIRUS_CTRL_DB); + strcat_s(db_path, 295, id); + if (fopen_s(&fp, db_path, "a") != 0) { + log(LOGLEVEL::ERR, "[virus_ctrl_store()]:Failed to open virus control database to store path of infected file: ",path); + delete[] db_path; + return 1; + } + else { + fprintf(fp, "\"%s\" \"%s\"\n", path, hash); + fclose(fp); + delete[] db_path; + return 0; + } +} +int virus_ctrl_process(const char* id) { + //take actions based on settings. + //eg delete infected files, quarantine them, etc + + FILE* fp; + char* db_path = new char[300]; + strcpy_s(db_path, 295, VIRUS_CTRL_DB); + strcat_s(db_path, 295, id); + if (fopen_s(&fp, db_path, "r") != 0) { + log(LOGLEVEL::ERR, "[virus_ctrl_process()]:Failed to open virus control database to process it.", VIRUS_CTRL_DB); + delete[] db_path; + return 1; + } + else { + while (!feof(fp)) { + //get a fulll path (enclosed with "") + char* path = new char[300]; + char*hash = new char[300]; + path[0] = '\0'; + //search for starting ", then loop until ending " + int cnt = 0; + int chr = 0; + chr=fgetc(fp); + if (chr == '\"') {//get the location of the file + chr = 0; + while (cnt < 295 && chr != '\"') { + chr = fgetc(fp); //get a char + if (chr != '\"') + path[cnt] = chr; + path[cnt + 1] = '\0'; + cnt++; + } + fscanf_s(fp, "%s", hash, 295); // get the hash of the file + char* quarantine_path = new char[300]; + char* url = new char[300]; + char* url_path = new char[300]; + char* additional = new char[600]; + switch (get_setting("virus_ctrl:virus_found:action")) { + case 1://remove + if(remove(path)!=0) + log(LOGLEVEL::ERR, "[virus_ctrl_process()]:Error while removing infected file: ", path," ",hash); + break; + + case 2://quarantine + strcpy_s(quarantine_path, 295, QUARANTINE_PATH); + strcat_s(quarantine_path, 295, "\\"); + strcat_s(quarantine_path, 295, hash); + if(rename(path,quarantine_path)!=0) + log(LOGLEVEL::ERR, "[virus_ctrl_process()]:Error while quarantining infected file: ", path," ",hash); + break; + + case 3://ignore + //ignore this file and just continue. but for good measure we should log it + log(LOGLEVEL::VIRUS, "[virus_ctrl_process()]:Virus found in file: ", path, " ", hash, " but ignored due to settings"); + break; + + case 4://notify + //call the server and say him that we have found a virus. + //we shoulkd also log it + log(LOGLEVEL::VIRUS, "[virus_ctrl_process()]:Virus found in file: ", path, " ", hash, " but only notified due to settings"); + url_path[0] = '\0'; + url[0] = '\0'; + strcpy_s(url_path, 295, "/api/add_log.php?entry="); + strcpy_s(additional, 600, "Virus found in file: "); + strcat_s(additional, 600, path); + strcat_s(additional, 600, " "); + strcat_s(additional, 600, hash); + get_setting("server:server_url", url); + if(call_srv(url,url_path,additional)!=0) + log(LOGLEVEL::ERR, "[virus_ctrl_process()]:Error while notifying server about virus: ", path," ",hash); + + break; + + } + delete[] quarantine_path; + delete[] url; + delete[] url_path; + delete[] additional; + } + else { + log(LOGLEVEL::ERR, "[virus_ctrl_process()]:Error while processing virus control database. Expected \" but got ", chr); + } + delete[] path; + delete[] hash; + } + fclose(fp); + } + remove(db_path); + delete[] db_path; + return 0; +} +#endif \ No newline at end of file diff --git a/src/client_backend/virus_ctrl.h b/src/client_backend/virus_ctrl.h new file mode 100644 index 0000000..da0202e --- /dev/null +++ b/src/client_backend/virus_ctrl.h @@ -0,0 +1,8 @@ +#pragma once +#ifndef VIRUS_CTRL_H +#define VIRUS_CTRL_H +#include +#include +int virus_ctrl_store(const char*, const char*,const char* id); +int virus_ctrl_process(const char* id); +#endif diff --git a/src/client_backend/well_known.h b/src/client_backend/well_known.h index 600e1e3..020cb6e 100644 --- a/src/client_backend/well_known.h +++ b/src/client_backend/well_known.h @@ -14,4 +14,22 @@ #define INFOFILE "C:\\Program Files\\cyberhex\\secure\\log\\info.txt" #define WARNFILE "C:\\Program Files\\cyberhex\\secure\\log\\warn.txt" #define ERRORFILE "C:\\Program Files\\cyberhex\\secure\\log\\error.txt" +#define VIRUSFILE "C:\\Program Files\\cyberhex\\secure\\log\\virus.txt" +#define RISKFILE "C:\\Program Files\\cyberhex\\secure\\log\\risk.txt" + + +#define FOLDER_DATABASE_DIR "C:\\Program Files\\cyberhex\\secure\\database\\folder" + +#define DB_DIR "C:\\Program Files\\cyberhex\\secure\\database\\" + +#define VIRUS_CTRL_DB "C:\\Program Files\\cyberhex\\secure\\database\\virus_ctrl_db.txt" + +#define SETTINGS_DB "C:\\Program Files\\cyberhex\\secure\\settings\\settings_db.txt" + +#define QUARANTINE_PATH "C:\\Program Files\\cyberhex\\secure\\quarantine\\" + +#define PERIODIC_FOLDER_SCAN "C:\\Program Files\\cyberhex\\secure\\database\\folder\\periodic_folder_scan.txt" +#define PERIODIC_FOLDER_SCAN_TEMP_DB "C:\\Program Files\\cyberhex\\secure\\database\\folder\\temp_db.txt" + +#define EXCLUDED_FOLDERS "C:\\Program Files\\cyberhex\\secure\\settings\\excluded_folders.txt" #endif // !WELL_KNOWN_H \ No newline at end of file diff --git a/src/client_backend/x64/Debug/CodeAnalysisResultManifest.txt b/src/client_backend/x64/Debug/CodeAnalysisResultManifest.txt new file mode 100644 index 0000000..b6aea16 Binary files /dev/null and b/src/client_backend/x64/Debug/CodeAnalysisResultManifest.txt differ diff --git a/src/client_backend/x64/Debug/NativeCodeAnalysis.read.1.tlog b/src/client_backend/x64/Debug/NativeCodeAnalysis.read.1.tlog new file mode 100644 index 0000000..2ae0d71 --- /dev/null +++ b/src/client_backend/x64/Debug/NativeCodeAnalysis.read.1.tlog @@ -0,0 +1 @@ +C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\TEAM TOOLS\STATIC ANALYSIS TOOLS\\RULE SETS\NATIVERECOMMENDEDRULES.RULESET diff --git a/src/client_backend/x64/Debug/app_ctrl.h.ifc b/src/client_backend/x64/Debug/app_ctrl.h.ifc index 6be3074..9861a4a 100644 Binary files a/src/client_backend/x64/Debug/app_ctrl.h.ifc and b/src/client_backend/x64/Debug/app_ctrl.h.ifc differ diff --git a/src/client_backend/x64/Debug/app_ctrl.h.ifcast b/src/client_backend/x64/Debug/app_ctrl.h.ifcast new file mode 100644 index 0000000..bd5110d Binary files /dev/null and b/src/client_backend/x64/Debug/app_ctrl.h.ifcast differ diff --git a/src/client_backend/x64/Debug/app_ctrl.h.nativecodeanalysis.sarif b/src/client_backend/x64/Debug/app_ctrl.h.nativecodeanalysis.sarif new file mode 100644 index 0000000..ec9e488 --- /dev/null +++ b/src/client_backend/x64/Debug/app_ctrl.h.nativecodeanalysis.sarif @@ -0,0 +1,35 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.38.33133.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/app_ctrl.h" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "949745b3f4233286e01263aacdea68962f4ee9a816d9ff12990292b2831aaa2d" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/client_backend/x64/Debug/app_ctrl.h.nativecodeanalysis.xml b/src/client_backend/x64/Debug/app_ctrl.h.nativecodeanalysis.xml new file mode 100644 index 0000000..dcdf088 --- /dev/null +++ b/src/client_backend/x64/Debug/app_ctrl.h.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/client_backend/x64/Debug/app_ctrl.nativecodeanalysis.sarif b/src/client_backend/x64/Debug/app_ctrl.nativecodeanalysis.sarif new file mode 100644 index 0000000..c4ae0d9 --- /dev/null +++ b/src/client_backend/x64/Debug/app_ctrl.nativecodeanalysis.sarif @@ -0,0 +1,43 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.38.33133.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/app_ctrl.cpp" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "a798c47c547aef22ce331b36f1ed7db111ddaf8fb940251a70fb676845d6be76" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/app_ctrl.h" + }, + "hashes": { + "sha-256": "949745b3f4233286e01263aacdea68962f4ee9a816d9ff12990292b2831aaa2d" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/client_backend/x64/Debug/app_ctrl.nativecodeanalysis.xml b/src/client_backend/x64/Debug/app_ctrl.nativecodeanalysis.xml new file mode 100644 index 0000000..dcdf088 --- /dev/null +++ b/src/client_backend/x64/Debug/app_ctrl.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/client_backend/x64/Debug/check_dir.nativecodeanalysis.sarif b/src/client_backend/x64/Debug/check_dir.nativecodeanalysis.sarif new file mode 100644 index 0000000..e1499a5 --- /dev/null +++ b/src/client_backend/x64/Debug/check_dir.nativecodeanalysis.sarif @@ -0,0 +1,1205 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [ + { + "ruleId": "C6387", + "message": { + "text": "\"overlapped.hEvent\" könnte \"0\" sein: dies entspricht nicht der Spezifikation für Funktion \"WaitForSingleObject\". " + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 297, + "startColumn": 15, + "endLine": 297, + "endColumn": 67 + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "monitor_directory", + "decoratedName": "?monitor_directory@@YAXPEBD@Z", + "kind": "function" + } + ] + } + ], + "codeFlows": [ + { + "threadFlows": [ + { + "locations": [ + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 297, + "startColumn": 15 + } + }, + "message": { + "text": "\"overlapped\" ist ein Eingabe-/Ausgabeargument für \"WaitForSingleObject\" (in c:\\program files (x86)\\windows kits\\10\\include\\10.0.22621.0\\um\\synchapi.h:346 deklariert)" + } + }, + "kinds": [ + "declaration" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 254, + "startColumn": 12 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 264, + "startColumn": 14 + } + }, + "message": { + "text": "Diese Verzweigung überspringen (Annahme: \"hDir==(((void *)(LONG_PTR)-1))\" ist false)" + } + }, + "kinds": [ + "branch" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 270, + "startColumn": 21 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 271, + "startColumn": 10 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 274, + "startColumn": 16 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 275, + "startColumn": 11 + } + }, + "message": { + "text": "\"overlapped\" ist eine Ausgabe von \"memset\" (in c:\\program files\\microsoft visual studio\\2022\\community\\vc\\tools\\msvc\\14.38.33130\\include\\vcruntime_string.h:63 deklariert)" + } + }, + "kinds": [ + "declaration" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 276, + "startColumn": 23 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 286, + "startColumn": 15 + } + }, + "message": { + "text": "\"overlapped\" ist ein Eingabe-/Ausgabeargument für \"ReadDirectoryChangesW\" (in c:\\program files (x86)\\windows kits\\10\\include\\10.0.22621.0\\um\\winbase.h:6994 deklariert)" + } + }, + "kinds": [ + "declaration" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 286, + "startColumn": 15 + } + }, + "message": { + "text": "Diese Verzweigung überspringen (Annahme: \"\" ist false)" + } + }, + "kinds": [ + "branch" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 292, + "startColumn": 97 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 295, + "startColumn": 12 + } + }, + "message": { + "text": "In diese Schleife eintreten (Annahme: \"1\")" + } + }, + "kinds": [ + "branch" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 296, + "startColumn": 15 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 297, + "startColumn": 15 + } + }, + "message": { + "text": "\"overlapped\" ist ein Eingabe-/Ausgabeargument für \"WaitForSingleObject\" (in c:\\program files (x86)\\windows kits\\10\\include\\10.0.22621.0\\um\\synchapi.h:346 deklariert)" + } + }, + "kinds": [ + "declaration" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 297, + "startColumn": 15 + } + }, + "message": { + "text": "\"overlapped.hEvent\" sollte nicht NULL sein, da dies nicht der SAL-Anmerkung zu \"WaitForSingleObject\" entspricht." + } + }, + "kinds": [ + "usage" + ], + "importance": "essential" + } + ] + } + ] + } + ] + }, + { + "ruleId": "C6387", + "message": { + "text": "\"overlapped.hEvent\" könnte \"0\" sein: dies entspricht nicht der Spezifikation für Funktion \"ResetEvent\". In Zeile 297 finden Sie einen früheren Ort, an dem dies vorkommen kann." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 313, + "startColumn": 17, + "endLine": 313, + "endColumn": 38 + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "monitor_directory", + "decoratedName": "?monitor_directory@@YAXPEBD@Z", + "kind": "function" + } + ] + } + ], + "codeFlows": [ + { + "threadFlows": [ + { + "locations": [ + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 297, + "startColumn": 15 + } + }, + "message": { + "text": "\"overlapped\" ist ein Eingabe-/Ausgabeargument für \"WaitForSingleObject\" (in c:\\program files (x86)\\windows kits\\10\\include\\10.0.22621.0\\um\\synchapi.h:346 deklariert)" + } + }, + "kinds": [ + "declaration" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 254, + "startColumn": 12 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 264, + "startColumn": 14 + } + }, + "message": { + "text": "Diese Verzweigung überspringen (Annahme: \"hDir==(((void *)(LONG_PTR)-1))\" ist false)" + } + }, + "kinds": [ + "branch" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 270, + "startColumn": 21 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 271, + "startColumn": 10 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 274, + "startColumn": 16 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 275, + "startColumn": 11 + } + }, + "message": { + "text": "\"overlapped\" ist eine Ausgabe von \"memset\" (in c:\\program files\\microsoft visual studio\\2022\\community\\vc\\tools\\msvc\\14.38.33130\\include\\vcruntime_string.h:63 deklariert)" + } + }, + "kinds": [ + "declaration" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 276, + "startColumn": 23 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 286, + "startColumn": 15 + } + }, + "message": { + "text": "\"overlapped\" ist ein Eingabe-/Ausgabeargument für \"ReadDirectoryChangesW\" (in c:\\program files (x86)\\windows kits\\10\\include\\10.0.22621.0\\um\\winbase.h:6994 deklariert)" + } + }, + "kinds": [ + "declaration" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 286, + "startColumn": 15 + } + }, + "message": { + "text": "Diese Verzweigung überspringen (Annahme: \"\" ist false)" + } + }, + "kinds": [ + "branch" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 292, + "startColumn": 97 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 295, + "startColumn": 12 + } + }, + "message": { + "text": "In diese Schleife eintreten (Annahme: \"1\")" + } + }, + "kinds": [ + "branch" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 296, + "startColumn": 15 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 297, + "startColumn": 15 + } + }, + "message": { + "text": "\"overlapped\" ist ein Eingabe-/Ausgabeargument für \"WaitForSingleObject\" (in c:\\program files (x86)\\windows kits\\10\\include\\10.0.22621.0\\um\\synchapi.h:346 deklariert)" + } + }, + "kinds": [ + "declaration" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 299, + "startColumn": 24 + } + }, + "message": { + "text": "In diese Verzweigung eintreten (Annahme: \"waitStatus==(((((DWORD)0))+0))\")" + } + }, + "kinds": [ + "branch" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 300, + "startColumn": 36 + } + }, + "message": { + "text": "\"overlapped\" ist ein Eingabe-/Ausgabeargument für \"GetOverlappedResult\" (in c:\\program files (x86)\\windows kits\\10\\include\\10.0.22621.0\\um\\ioapiset.h:105 deklariert)" + } + }, + "kinds": [ + "declaration" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 300, + "startColumn": 36 + } + }, + "message": { + "text": "In diese Verzweigung eintreten (Annahme: \"\")" + } + }, + "kinds": [ + "branch" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 302, + "startColumn": 42 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 305, + "startColumn": 36 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 307, + "startColumn": 27 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 310, + "startColumn": 49 + } + }, + "message": { + "text": "Diese Schleife überspringen (Annahme: \"pInfo->NextEntryOffset!=0\" ist false)" + } + }, + "kinds": [ + "branch" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 313, + "startColumn": 27 + } + }, + "message": { + "text": "\"overlapped\" ist ein Eingabe-/Ausgabeargument für \"ResetEvent\" (in c:\\program files (x86)\\windows kits\\10\\include\\10.0.22621.0\\um\\synchapi.h:323 deklariert)" + } + }, + "kinds": [ + "declaration" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 313, + "startColumn": 27 + } + }, + "message": { + "text": "\"overlapped.hEvent\" sollte nicht NULL sein, da dies nicht der SAL-Anmerkung zu \"ResetEvent\" entspricht." + } + }, + "kinds": [ + "usage" + ], + "importance": "essential" + } + ] + } + ] + } + ] + }, + { + "ruleId": "C6387", + "message": { + "text": "\"overlapped.hEvent\" könnte \"0\" sein: dies entspricht nicht der Spezifikation für Funktion \"CloseHandle\". In Zeile 297 finden Sie einen früheren Ort, an dem dies vorkommen kann." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 341, + "startColumn": 5, + "endLine": 341, + "endColumn": 27 + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "monitor_directory", + "decoratedName": "?monitor_directory@@YAXPEBD@Z", + "kind": "function" + } + ] + } + ], + "codeFlows": [ + { + "threadFlows": [ + { + "locations": [ + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 297, + "startColumn": 15 + } + }, + "message": { + "text": "\"overlapped\" ist ein Eingabe-/Ausgabeargument für \"WaitForSingleObject\" (in c:\\program files (x86)\\windows kits\\10\\include\\10.0.22621.0\\um\\synchapi.h:346 deklariert)" + } + }, + "kinds": [ + "declaration" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 254, + "startColumn": 12 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 264, + "startColumn": 14 + } + }, + "message": { + "text": "Diese Verzweigung überspringen (Annahme: \"hDir==(((void *)(LONG_PTR)-1))\" ist false)" + } + }, + "kinds": [ + "branch" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 270, + "startColumn": 21 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 271, + "startColumn": 10 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 274, + "startColumn": 16 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 275, + "startColumn": 11 + } + }, + "message": { + "text": "\"overlapped\" ist eine Ausgabe von \"memset\" (in c:\\program files\\microsoft visual studio\\2022\\community\\vc\\tools\\msvc\\14.38.33130\\include\\vcruntime_string.h:63 deklariert)" + } + }, + "kinds": [ + "declaration" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 276, + "startColumn": 23 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 286, + "startColumn": 15 + } + }, + "message": { + "text": "\"overlapped\" ist ein Eingabe-/Ausgabeargument für \"ReadDirectoryChangesW\" (in c:\\program files (x86)\\windows kits\\10\\include\\10.0.22621.0\\um\\winbase.h:6994 deklariert)" + } + }, + "kinds": [ + "declaration" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 286, + "startColumn": 15 + } + }, + "message": { + "text": "Diese Verzweigung überspringen (Annahme: \"\" ist false)" + } + }, + "kinds": [ + "branch" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 292, + "startColumn": 97 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 295, + "startColumn": 12 + } + }, + "message": { + "text": "In diese Schleife eintreten (Annahme: \"1\")" + } + }, + "kinds": [ + "branch" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 296, + "startColumn": 15 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 297, + "startColumn": 15 + } + }, + "message": { + "text": "\"overlapped\" ist ein Eingabe-/Ausgabeargument für \"WaitForSingleObject\" (in c:\\program files (x86)\\windows kits\\10\\include\\10.0.22621.0\\um\\synchapi.h:346 deklariert)" + } + }, + "kinds": [ + "declaration" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 299, + "startColumn": 24 + } + }, + "message": { + "text": "Diese Verzweigung überspringen (Annahme: \"waitStatus==(((((DWORD)0))+0))\" ist false)" + } + }, + "kinds": [ + "branch" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 335, + "startColumn": 98 + } + } + }, + "importance": "unimportant" + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 341, + "startColumn": 16 + } + }, + "message": { + "text": "\"overlapped\" ist eine Eingabe für \"CloseHandle\" (in c:\\program files (x86)\\windows kits\\10\\include\\10.0.22621.0\\um\\handleapi.h:39 deklariert)" + } + }, + "kinds": [ + "usage" + ] + }, + { + "location": { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "region": { + "startLine": 341, + "startColumn": 16 + } + }, + "message": { + "text": "\"overlapped.hEvent\" sollte nicht NULL sein, da dies nicht der SAL-Anmerkung zu \"CloseHandle\" entspricht." + } + }, + "kinds": [ + "usage" + ], + "importance": "essential" + } + ] + } + ] + } + ] + } + ], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.38.33133.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///C:/Users/janis/Documents/Projekte_mit_c/ma/ma/src/client_backend/check_dir.cpp" + }, + "roles": [ + "analysisTarget", + "resultFile" + ], + "hashes": { + "sha-256": "9b8c12eefd6f5c171eef76f28a2c6522d1c621ab322b733568e96e9f17b314fd" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/check_dir.h" + }, + "hashes": { + "sha-256": "f210a5cfc0ed07c2fe76b3337d0ad6c96ed534cf7b8c7cc7031c0884e89eb3e8" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/well_known.h" + }, + "hashes": { + "sha-256": "3fc028c03de1be21fe5a60a58de0c9361001517acfceecd5809e755bdfd4cc97" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/log.h" + }, + "hashes": { + "sha-256": "f126f1a4ec55d2abe6a914bb8afe743a9715574e25c7c168dac8a7ecd908e4ae" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/md5hash.h" + }, + "hashes": { + "sha-256": "bcf666ca12d902c14ecda3ecc3ed614d1397094e13d0c4a455c186c7c7143eac" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/md5.h" + }, + "hashes": { + "sha-256": "22d8a36f6528150f4355b304477a258a6c7ab06d642f9c8e2dd9e35cd480053b" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/macros.h" + }, + "hashes": { + "sha-256": "d699d2286f1738cf935a2c6c7667be6d8a16c91874ec9cb7b93244b01526b9f2" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/opensslconf.h" + }, + "hashes": { + "sha-256": "8343f2eccc78f00a1cd05f7a994f341697213785370910afc1c7bf31cdf6fcb3" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/configuration.h" + }, + "hashes": { + "sha-256": "d7d44be54377e736d9da5f531cda3c0152abd77cbf14d9c5800047afb507fb01" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/opensslv.h" + }, + "hashes": { + "sha-256": "4283184b7b71f4694728701afbe1316821933b394c7c8e69f180d7fa8d8084ff" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/e_os2.h" + }, + "hashes": { + "sha-256": "59a517cccd94403c7037102f4beb10f33d5b8cf768a000ea8e730a23ec3e23a9" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/scan.h" + }, + "hashes": { + "sha-256": "93690402b423cab6def672ef079470b67f8986d84cc9679fb807abed5b4f0e8c" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/app_ctrl.h" + }, + "hashes": { + "sha-256": "949745b3f4233286e01263aacdea68962f4ee9a816d9ff12990292b2831aaa2d" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/virus_ctrl.h" + }, + "hashes": { + "sha-256": "370668c3f7272e3a80df4879078a37769551d11f38a94f2ffc515cc9258f219b" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/settings.h" + }, + "hashes": { + "sha-256": "4819503c32f357892d89be6f56a8b8c6626440ef20928090032995d32b271f3e" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/client_backend/x64/Debug/check_dir.nativecodeanalysis.xml b/src/client_backend/x64/Debug/check_dir.nativecodeanalysis.xml new file mode 100644 index 0000000..ce3aabf --- /dev/null +++ b/src/client_backend/x64/Debug/check_dir.nativecodeanalysis.xml @@ -0,0 +1,585 @@ + + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 297 + 14 + + 6387 + "overlapped.hEvent" könnte "0" sein: dies entspricht nicht der Spezifikation für Funktion "WaitForSingleObject". + monitor_directory + ?monitor_directory@@YAXPEBD@Z + 252 + 1 + 4 + + mspft + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 297 + 14 + + 1 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "WaitForSingleObject" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\synchapi.h:346 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 254 + 11 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 264 + 13 + + 2 + branch + Full + Diese Verzweigung überspringen (Annahme: "hDir==(((void *)(LONG_PTR)-1))" ist false) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 270 + 20 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 271 + 9 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 274 + 15 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 275 + 10 + + 3 + declaration + Full + "overlapped" ist eine Ausgabe von "memset" (in c:\program files\microsoft visual studio\2022\community\vc\tools\msvc\14.38.33130\include\vcruntime_string.h:63 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 276 + 22 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 286 + 14 + + 4 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "ReadDirectoryChangesW" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\winbase.h:6994 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 286 + 14 + + 5 + branch + Full + Diese Verzweigung überspringen (Annahme: "<Verzweigungsbedingung>" ist false) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 292 + 96 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 295 + 11 + + 6 + branch + Full + In diese Schleife eintreten (Annahme: "1") + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 296 + 14 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 297 + 14 + + 7 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "WaitForSingleObject" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\synchapi.h:346 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 297 + 14 + + 8 + usage + Essential + "overlapped.hEvent" sollte nicht NULL sein, da dies nicht der SAL-Anmerkung zu "WaitForSingleObject" entspricht. + + + + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 313 + 26 + + 6387 + "overlapped.hEvent" könnte "0" sein: dies entspricht nicht der Spezifikation für Funktion "ResetEvent". In Zeile 297 finden Sie einen früheren Ort, an dem dies vorkommen kann. + monitor_directory + ?monitor_directory@@YAXPEBD@Z + 252 + 1 + 4 + + mspft + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 297 + 14 + + 1 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "WaitForSingleObject" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\synchapi.h:346 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 254 + 11 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 264 + 13 + + 2 + branch + Full + Diese Verzweigung überspringen (Annahme: "hDir==(((void *)(LONG_PTR)-1))" ist false) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 270 + 20 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 271 + 9 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 274 + 15 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 275 + 10 + + 3 + declaration + Full + "overlapped" ist eine Ausgabe von "memset" (in c:\program files\microsoft visual studio\2022\community\vc\tools\msvc\14.38.33130\include\vcruntime_string.h:63 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 276 + 22 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 286 + 14 + + 4 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "ReadDirectoryChangesW" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\winbase.h:6994 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 286 + 14 + + 5 + branch + Full + Diese Verzweigung überspringen (Annahme: "<Verzweigungsbedingung>" ist false) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 292 + 96 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 295 + 11 + + 6 + branch + Full + In diese Schleife eintreten (Annahme: "1") + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 296 + 14 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 297 + 14 + + 7 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "WaitForSingleObject" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\synchapi.h:346 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 299 + 23 + + 8 + branch + Full + In diese Verzweigung eintreten (Annahme: "waitStatus==(((((DWORD)0))+0))") + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 300 + 35 + + 9 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "GetOverlappedResult" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\ioapiset.h:105 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 300 + 35 + + 10 + branch + Full + In diese Verzweigung eintreten (Annahme: "<Verzweigungsbedingung>") + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 302 + 41 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 305 + 35 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 307 + 26 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 310 + 48 + + 11 + branch + Full + Diese Schleife überspringen (Annahme: "pInfo->NextEntryOffset!=0" ist false) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 313 + 26 + + 12 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "ResetEvent" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\synchapi.h:323 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 313 + 26 + + 13 + usage + Essential + "overlapped.hEvent" sollte nicht NULL sein, da dies nicht der SAL-Anmerkung zu "ResetEvent" entspricht. + + + + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 341 + 15 + + 6387 + "overlapped.hEvent" könnte "0" sein: dies entspricht nicht der Spezifikation für Funktion "CloseHandle". In Zeile 297 finden Sie einen früheren Ort, an dem dies vorkommen kann. + monitor_directory + ?monitor_directory@@YAXPEBD@Z + 252 + 1 + 4 + + mspft + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 297 + 14 + + 1 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "WaitForSingleObject" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\synchapi.h:346 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 254 + 11 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 264 + 13 + + 2 + branch + Full + Diese Verzweigung überspringen (Annahme: "hDir==(((void *)(LONG_PTR)-1))" ist false) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 270 + 20 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 271 + 9 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 274 + 15 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 275 + 10 + + 3 + declaration + Full + "overlapped" ist eine Ausgabe von "memset" (in c:\program files\microsoft visual studio\2022\community\vc\tools\msvc\14.38.33130\include\vcruntime_string.h:63 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 276 + 22 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 286 + 14 + + 4 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "ReadDirectoryChangesW" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\winbase.h:6994 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 286 + 14 + + 5 + branch + Full + Diese Verzweigung überspringen (Annahme: "<Verzweigungsbedingung>" ist false) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 292 + 96 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 295 + 11 + + 6 + branch + Full + In diese Schleife eintreten (Annahme: "1") + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 296 + 14 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 297 + 14 + + 7 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "WaitForSingleObject" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\synchapi.h:346 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 299 + 23 + + 8 + branch + Full + Diese Verzweigung überspringen (Annahme: "waitStatus==(((((DWORD)0))+0))" ist false) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 335 + 97 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 341 + 15 + + 9 + usage + Full + "overlapped" ist eine Eingabe für "CloseHandle" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\handleapi.h:39 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 341 + 15 + + 10 + usage + Essential + "overlapped.hEvent" sollte nicht NULL sein, da dies nicht der SAL-Anmerkung zu "CloseHandle" entspricht. + + + + + \ No newline at end of file diff --git a/src/client_backend/x64/Debug/client_backend.Build.CppClean.log b/src/client_backend/x64/Debug/client_backend.Build.CppClean.log new file mode 100644 index 0000000..bb47200 --- /dev/null +++ b/src/client_backend/x64/Debug/client_backend.Build.CppClean.log @@ -0,0 +1,60 @@ +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\vc143.pdb +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\vc143.idb +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\app_ctrl.nativecodeanalysis.sarif +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\app_ctrl.nativecodeanalysis.xml +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\check_dir.nativecodeanalysis.sarif +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\check_dir.nativecodeanalysis.xml +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\client_backend.nativecodeanalysis.sarif +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\client_backend.nativecodeanalysis.xml +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\connect.nativecodeanalysis.sarif +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\connect.nativecodeanalysis.xml +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\local_com.nativecodeanalysis.sarif +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\local_com.nativecodeanalysis.xml +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\local_schedule.nativecodeanalysis.sarif +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\local_schedule.nativecodeanalysis.xml +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\log.nativecodeanalysis.sarif +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\log.nativecodeanalysis.xml +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\md5hash.nativecodeanalysis.sarif +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\md5hash.nativecodeanalysis.xml +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\permissions.nativecodeanalysis.sarif +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\permissions.nativecodeanalysis.xml +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\queue _ctrl.nativecodeanalysis.sarif +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\queue _ctrl.nativecodeanalysis.xml +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\scan.nativecodeanalysis.sarif +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\scan.nativecodeanalysis.xml +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\settings.nativecodeanalysis.sarif +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\settings.nativecodeanalysis.xml +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\thread_ctrl.nativecodeanalysis.sarif +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\thread_ctrl.nativecodeanalysis.xml +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\virus_ctrl.nativecodeanalysis.sarif +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\virus_ctrl.nativecodeanalysis.xml +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\virus_ctrl.obj +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\thread_ctrl.obj +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\settings.obj +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\scan.obj +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\queue _ctrl.obj +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\permissions.obj +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\md5hash.obj +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\log.obj +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\local_schedule.obj +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\local_com.obj +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\connect.obj +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\client_backend.obj +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\check_dir.obj +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\app_ctrl.obj +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\app_ctrl.h.ifc +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\app_ctrl.h.ifc.d.json +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\app_ctrl.h.ifcast +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\app_ctrl.h.nativecodeanalysis.sarif +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\app_ctrl.h.nativecodeanalysis.xml +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\app_ctrl.h.obj +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\app_ctrl.h.module.json +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\client_backend.tlog\cl.command.1.tlog +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\client_backend.tlog\cl.read.1.tlog +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\client_backend.tlog\cl.write.1.tlog +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\client_backend.tlog\link.command.1.tlog +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\client_backend.tlog\link.read.1.tlog +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\client_backend.tlog\link.write.1.tlog +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\client_backend_md.tlog\cl.command.1.tlog +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\client_backend_md.tlog\microsoft.build.cpptasks.cl.read.1.tlog +c:\users\janis\documents\projekte_mit_c\ma\ma\src\client_backend\x64\debug\client_backend_md.tlog\microsoft.build.cpptasks.cl.write.1.tlog diff --git a/src/client_backend/x64/Debug/client_backend.exe.lastcodeanalysissucceeded b/src/client_backend/x64/Debug/client_backend.exe.lastcodeanalysissucceeded new file mode 100644 index 0000000..e69de29 diff --git a/src/client_backend/x64/Debug/client_backend.ilk b/src/client_backend/x64/Debug/client_backend.ilk index bc08c72..8b8e6e4 100644 Binary files a/src/client_backend/x64/Debug/client_backend.ilk and b/src/client_backend/x64/Debug/client_backend.ilk differ diff --git a/src/client_backend/x64/Debug/client_backend.log b/src/client_backend/x64/Debug/client_backend.log index ddde04b..341dcc8 100644 --- a/src/client_backend/x64/Debug/client_backend.log +++ b/src/client_backend/x64/Debug/client_backend.log @@ -1,3 +1,60 @@  Quellen werden auf Modulabhängigkeiten überprüft... + app_ctrl.h + Kompilieren... + app_ctrl.h + app_ctrl.cpp + check_dir.cpp +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\check_dir.cpp(348,7): warning C4101: "fp": Unreferenzierte lokale Variable +C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\xstring(2749,53): warning C4244: "Argument": Konvertierung von "wchar_t" in "const _Elem", möglicher Datenverlust +C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\xstring(2749,53): warning C4244: with +C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\xstring(2749,53): warning C4244: [ +C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\xstring(2749,53): warning C4244: _Elem=char +C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\xstring(2749,53): warning C4244: ] + (Quelldatei „check_dir.cpp“ wird kompiliert) + C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\xstring(2749,53): + der Vorlageninstanziierungskontext (der älteste zuerst) ist + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\check_dir.cpp(147,29): + Siehe Verweis auf die gerade kompilierte Instanziierung "std::basic_string,std::allocator>::basic_string>>,0>(_Iter,_Iter,const _Alloc &)" der Funktions-Vorlage. + with + [ + _Elem=wchar_t, + _Iter=std::_String_iterator>>, + _Alloc=std::allocator + ] + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\check_dir.cpp(147,29): + Ersten Verweis auf "std::basic_string,std::allocator>::basic_string" in "process_changes" anzeigen + C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\xstring(2590,17): + Siehe Verweis auf die gerade kompilierte Instanziierung "void std::basic_string,std::allocator>::_Construct_from_iter(_Iter,const _Sent,_Size)" der Funktions-Vorlage. + with + [ + _Size_type=unsigned __int64, + _Iter=wchar_t *, + _Sent=wchar_t *, + _Size=unsigned __int64 + ] + client_backend.cpp +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend.cpp(63,24): warning C4244: "Argument": Konvertierung von "_Rep" in "DWORD", möglicher Datenverlust +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend.cpp(63,24): warning C4244: with +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend.cpp(63,24): warning C4244: [ +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend.cpp(63,24): warning C4244: _Rep=__int64 +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend.cpp(63,24): warning C4244: ] + connect.cpp +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\connect.cpp(92,65): warning C4267: "Argument": Konvertierung von "size_t" nach "int", Datenverlust möglich + local_com.cpp + local_schedule.cpp + log.cpp + md5hash.cpp + permissions.cpp + queue _ctrl.cpp + scan.cpp + settings.cpp + thread_ctrl.cpp + virus_ctrl.cpp + Code Analysis für C/C++ wird ausgeführt... + Code wird generiert... +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\md5hash.cpp(36): warning C4715: "md5_file": Nicht alle Codepfade geben einen Wert zurück. client_backend.vcxproj -> C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\client_backend.exe +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\check_dir.cpp(297): warning C6387: "overlapped.hEvent" könnte "0" sein: dies entspricht nicht der Spezifikation für Funktion "WaitForSingleObject". +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\check_dir.cpp(313): warning C6387: "overlapped.hEvent" könnte "0" sein: dies entspricht nicht der Spezifikation für Funktion "ResetEvent". In Zeile 297 finden Sie einen früheren Ort, an dem dies vorkommen kann. +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\check_dir.cpp(341): warning C6387: "overlapped.hEvent" könnte "0" sein: dies entspricht nicht der Spezifikation für Funktion "CloseHandle". In Zeile 297 finden Sie einen früheren Ort, an dem dies vorkommen kann. diff --git a/src/client_backend/x64/Debug/client_backend.nativecodeanalysis.sarif b/src/client_backend/x64/Debug/client_backend.nativecodeanalysis.sarif new file mode 100644 index 0000000..ec6e9ea --- /dev/null +++ b/src/client_backend/x64/Debug/client_backend.nativecodeanalysis.sarif @@ -0,0 +1,251 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.38.33133.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/client_backend.cpp" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "0b5c7b60f8f756696ef8ce6a3d6fe99be51295fb3c82296bdd92234992bf03d1" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/curl.h" + }, + "hashes": { + "sha-256": "92f1cb78f6e7bde3889da35f627d393661d65734a2226824c6b8fd814a706b85" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/curlver.h" + }, + "hashes": { + "sha-256": "beca18fe096fb23ad478cf4283acf7befda740aca7987a0ff31826eabbec39d2" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/system.h" + }, + "hashes": { + "sha-256": "c3d6c08073af28edaa73a6715afc0ac00ba0289c632d6ce6b654c5e7f98f98c2" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/easy.h" + }, + "hashes": { + "sha-256": "0890e063d2bea8ba815d747d4f665994e263e1043f0e14a85733c9445cb83a6d" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/multi.h" + }, + "hashes": { + "sha-256": "3dd2ff1eeea4298f08d0aa5c6a46140644b6ee2e710ee8bc64513e732f32975c" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/urlapi.h" + }, + "hashes": { + "sha-256": "dd631108b8503994fcf6c416eeaea2973822fc778ea2cff440c6b6e21c8712d2" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/options.h" + }, + "hashes": { + "sha-256": "5716018d27e783283825bed2a8a051190487722fdeb64b7aa2d03a997e99b8d1" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/header.h" + }, + "hashes": { + "sha-256": "614be48a86f4e5d304c5aa40ef1c85245e25b97732921c3631840146669d992f" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/websockets.h" + }, + "hashes": { + "sha-256": "b58bb1d7eda3fd2372feb4d856c256897d83006dfe7933d69be54bc4a2ba5a3f" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/md5.h" + }, + "hashes": { + "sha-256": "22d8a36f6528150f4355b304477a258a6c7ab06d642f9c8e2dd9e35cd480053b" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/macros.h" + }, + "hashes": { + "sha-256": "d699d2286f1738cf935a2c6c7667be6d8a16c91874ec9cb7b93244b01526b9f2" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/opensslconf.h" + }, + "hashes": { + "sha-256": "8343f2eccc78f00a1cd05f7a994f341697213785370910afc1c7bf31cdf6fcb3" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/configuration.h" + }, + "hashes": { + "sha-256": "d7d44be54377e736d9da5f531cda3c0152abd77cbf14d9c5800047afb507fb01" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/opensslv.h" + }, + "hashes": { + "sha-256": "4283184b7b71f4694728701afbe1316821933b394c7c8e69f180d7fa8d8084ff" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/e_os2.h" + }, + "hashes": { + "sha-256": "59a517cccd94403c7037102f4beb10f33d5b8cf768a000ea8e730a23ec3e23a9" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/app_ctrl.h" + }, + "hashes": { + "sha-256": "949745b3f4233286e01263aacdea68962f4ee9a816d9ff12990292b2831aaa2d" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/md5hash.h" + }, + "hashes": { + "sha-256": "bcf666ca12d902c14ecda3ecc3ed614d1397094e13d0c4a455c186c7c7143eac" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/connect.h" + }, + "hashes": { + "sha-256": "bad9339a042eb97ea79ae9a6b4bafe27f9c66a2c85a6f83a41e1b9194c669ea3" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/scan.h" + }, + "hashes": { + "sha-256": "93690402b423cab6def672ef079470b67f8986d84cc9679fb807abed5b4f0e8c" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/queue_ctrl.h" + }, + "hashes": { + "sha-256": "d1f0d8199a91544fced66cbbbbab8f712d5546c52155865be68abcdb07b7ebe9" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/well_known.h" + }, + "hashes": { + "sha-256": "3fc028c03de1be21fe5a60a58de0c9361001517acfceecd5809e755bdfd4cc97" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/local_com.h" + }, + "hashes": { + "sha-256": "b43737b780f66ec5117bed01096c46eccfebb70bb258505faec8cf03f43aa840" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/local_schedule.h" + }, + "hashes": { + "sha-256": "e5efa2ab8842e4c55f74723bdf41a1c961f7d335682a7148dfb2e0d9ff5f0cab" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/log.h" + }, + "hashes": { + "sha-256": "f126f1a4ec55d2abe6a914bb8afe743a9715574e25c7c168dac8a7ecd908e4ae" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/thread_ctrl.h" + }, + "hashes": { + "sha-256": "4a2e011f91a655485ade3c858ea9e2ab4bb87d558107c32cf455530e55bd4cb1" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/settings.h" + }, + "hashes": { + "sha-256": "4819503c32f357892d89be6f56a8b8c6626440ef20928090032995d32b271f3e" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/check_dir.h" + }, + "hashes": { + "sha-256": "f210a5cfc0ed07c2fe76b3337d0ad6c96ed534cf7b8c7cc7031c0884e89eb3e8" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/client_backend/x64/Debug/client_backend.nativecodeanalysis.xml b/src/client_backend/x64/Debug/client_backend.nativecodeanalysis.xml new file mode 100644 index 0000000..dcdf088 --- /dev/null +++ b/src/client_backend/x64/Debug/client_backend.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/client_backend/x64/Debug/client_backend.pdb b/src/client_backend/x64/Debug/client_backend.pdb index e121726..fec69d6 100644 Binary files a/src/client_backend/x64/Debug/client_backend.pdb and b/src/client_backend/x64/Debug/client_backend.pdb differ diff --git a/src/client_backend/x64/Debug/client_backend.tlog/CL.command.1.tlog b/src/client_backend/x64/Debug/client_backend.tlog/CL.command.1.tlog index 2a5653d..a7d399a 100644 Binary files a/src/client_backend/x64/Debug/client_backend.tlog/CL.command.1.tlog and b/src/client_backend/x64/Debug/client_backend.tlog/CL.command.1.tlog differ diff --git a/src/client_backend/x64/Debug/client_backend.tlog/CL.read.1.tlog b/src/client_backend/x64/Debug/client_backend.tlog/CL.read.1.tlog index c70efe6..e982d53 100644 Binary files a/src/client_backend/x64/Debug/client_backend.tlog/CL.read.1.tlog and b/src/client_backend/x64/Debug/client_backend.tlog/CL.read.1.tlog differ diff --git a/src/client_backend/x64/Debug/client_backend.tlog/CL.write.1.tlog b/src/client_backend/x64/Debug/client_backend.tlog/CL.write.1.tlog index fa51746..9cf353a 100644 Binary files a/src/client_backend/x64/Debug/client_backend.tlog/CL.write.1.tlog and b/src/client_backend/x64/Debug/client_backend.tlog/CL.write.1.tlog differ diff --git a/src/client_backend/x64/Debug/client_backend.tlog/Cl.items.tlog b/src/client_backend/x64/Debug/client_backend.tlog/Cl.items.tlog index 8bd88c4..9b6686e 100644 --- a/src/client_backend/x64/Debug/client_backend.tlog/Cl.items.tlog +++ b/src/client_backend/x64/Debug/client_backend.tlog/Cl.items.tlog @@ -1,5 +1,6 @@ C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\app_ctrl.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\app_ctrl.obj C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\app_ctrl.h;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\app_ctrl.h.obj +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\check_dir.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\check_dir.obj C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\client_backend.obj C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\connect.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\connect.obj C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\local_com.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\local_com.obj @@ -9,3 +10,6 @@ C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\md5hash.cpp;C:\ C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\permissions.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\permissions.obj C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\queue _ctrl.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\queue _ctrl.obj C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\scan.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\scan.obj +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\settings.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\settings.obj +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\thread_ctrl.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\thread_ctrl.obj +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\virus_ctrl.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\virus_ctrl.obj diff --git a/src/client_backend/x64/Debug/client_backend.tlog/client_backend.write.1u.tlog b/src/client_backend/x64/Debug/client_backend.tlog/client_backend.write.1u.tlog index 7c55188..aafb69e 100644 Binary files a/src/client_backend/x64/Debug/client_backend.tlog/client_backend.write.1u.tlog and b/src/client_backend/x64/Debug/client_backend.tlog/client_backend.write.1u.tlog differ diff --git a/src/client_backend/x64/Debug/client_backend.tlog/link.command.1.tlog b/src/client_backend/x64/Debug/client_backend.tlog/link.command.1.tlog index ca45d6e..f768bb5 100644 Binary files a/src/client_backend/x64/Debug/client_backend.tlog/link.command.1.tlog and b/src/client_backend/x64/Debug/client_backend.tlog/link.command.1.tlog differ diff --git a/src/client_backend/x64/Debug/client_backend.tlog/link.read.1.tlog b/src/client_backend/x64/Debug/client_backend.tlog/link.read.1.tlog index adea532..717035c 100644 Binary files a/src/client_backend/x64/Debug/client_backend.tlog/link.read.1.tlog and b/src/client_backend/x64/Debug/client_backend.tlog/link.read.1.tlog differ diff --git a/src/client_backend/x64/Debug/client_backend.tlog/link.write.1.tlog b/src/client_backend/x64/Debug/client_backend.tlog/link.write.1.tlog index c821f5e..fa6ae0a 100644 Binary files a/src/client_backend/x64/Debug/client_backend.tlog/link.write.1.tlog and b/src/client_backend/x64/Debug/client_backend.tlog/link.write.1.tlog differ diff --git a/src/client_backend/x64/Debug/client_backend.vcxproj.FileListAbsolute.txt b/src/client_backend/x64/Debug/client_backend.vcxproj.FileListAbsolute.txt index 10d4c4d..76e2f44 100644 --- a/src/client_backend/x64/Debug/client_backend.vcxproj.FileListAbsolute.txt +++ b/src/client_backend/x64/Debug/client_backend.vcxproj.FileListAbsolute.txt @@ -1,3 +1,5 @@ C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\client_backend.exe -C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\client_backend.vcxproj.CopyComplete C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\libcrypto-3-x64.dll +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\client_backend.exe.lastcodeanalysissucceeded +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\NativeCodeAnalysis.read.1.tlog +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\client_backend.vcxproj.CopyComplete diff --git a/src/client_backend/x64/Debug/client_backend_MD.tlog/CL.command.1.tlog b/src/client_backend/x64/Debug/client_backend_MD.tlog/CL.command.1.tlog index 78099ee..8412754 100644 Binary files a/src/client_backend/x64/Debug/client_backend_MD.tlog/CL.command.1.tlog and b/src/client_backend/x64/Debug/client_backend_MD.tlog/CL.command.1.tlog differ diff --git a/src/client_backend/x64/Debug/connect.nativecodeanalysis.sarif b/src/client_backend/x64/Debug/connect.nativecodeanalysis.sarif new file mode 100644 index 0000000..1a80a97 --- /dev/null +++ b/src/client_backend/x64/Debug/connect.nativecodeanalysis.sarif @@ -0,0 +1,115 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.38.33133.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/connect.cpp" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "200dddfcbc34917d89ba0e3bfacb01f053937193d5ea3a4fed31773203295d84" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/connect.h" + }, + "hashes": { + "sha-256": "bad9339a042eb97ea79ae9a6b4bafe27f9c66a2c85a6f83a41e1b9194c669ea3" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/curl.h" + }, + "hashes": { + "sha-256": "92f1cb78f6e7bde3889da35f627d393661d65734a2226824c6b8fd814a706b85" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/curlver.h" + }, + "hashes": { + "sha-256": "beca18fe096fb23ad478cf4283acf7befda740aca7987a0ff31826eabbec39d2" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/system.h" + }, + "hashes": { + "sha-256": "c3d6c08073af28edaa73a6715afc0ac00ba0289c632d6ce6b654c5e7f98f98c2" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/easy.h" + }, + "hashes": { + "sha-256": "0890e063d2bea8ba815d747d4f665994e263e1043f0e14a85733c9445cb83a6d" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/multi.h" + }, + "hashes": { + "sha-256": "3dd2ff1eeea4298f08d0aa5c6a46140644b6ee2e710ee8bc64513e732f32975c" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/urlapi.h" + }, + "hashes": { + "sha-256": "dd631108b8503994fcf6c416eeaea2973822fc778ea2cff440c6b6e21c8712d2" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/options.h" + }, + "hashes": { + "sha-256": "5716018d27e783283825bed2a8a051190487722fdeb64b7aa2d03a997e99b8d1" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/header.h" + }, + "hashes": { + "sha-256": "614be48a86f4e5d304c5aa40ef1c85245e25b97732921c3631840146669d992f" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/websockets.h" + }, + "hashes": { + "sha-256": "b58bb1d7eda3fd2372feb4d856c256897d83006dfe7933d69be54bc4a2ba5a3f" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/client_backend/x64/Debug/connect.nativecodeanalysis.xml b/src/client_backend/x64/Debug/connect.nativecodeanalysis.xml new file mode 100644 index 0000000..dcdf088 --- /dev/null +++ b/src/client_backend/x64/Debug/connect.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/client_backend/x64/Debug/local_com.nativecodeanalysis.sarif b/src/client_backend/x64/Debug/local_com.nativecodeanalysis.sarif new file mode 100644 index 0000000..6dde1e2 --- /dev/null +++ b/src/client_backend/x64/Debug/local_com.nativecodeanalysis.sarif @@ -0,0 +1,59 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.38.33133.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/local_com.cpp" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "1694750090e20779473ba6da483b0ee2831fe7afb94ae0076ac3d942887239d6" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/local_com.h" + }, + "hashes": { + "sha-256": "b43737b780f66ec5117bed01096c46eccfebb70bb258505faec8cf03f43aa840" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/queue_ctrl.h" + }, + "hashes": { + "sha-256": "d1f0d8199a91544fced66cbbbbab8f712d5546c52155865be68abcdb07b7ebe9" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/well_known.h" + }, + "hashes": { + "sha-256": "3fc028c03de1be21fe5a60a58de0c9361001517acfceecd5809e755bdfd4cc97" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/client_backend/x64/Debug/local_com.nativecodeanalysis.xml b/src/client_backend/x64/Debug/local_com.nativecodeanalysis.xml new file mode 100644 index 0000000..dcdf088 --- /dev/null +++ b/src/client_backend/x64/Debug/local_com.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/client_backend/x64/Debug/local_schedule.nativecodeanalysis.sarif b/src/client_backend/x64/Debug/local_schedule.nativecodeanalysis.sarif new file mode 100644 index 0000000..f7719e3 --- /dev/null +++ b/src/client_backend/x64/Debug/local_schedule.nativecodeanalysis.sarif @@ -0,0 +1,67 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.38.33133.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/local_schedule.cpp" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "a0923f47b8bcdd0cbfcf7c0e4c1e447eead24a0714a825d98f17878b56929cbf" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/local_schedule.h" + }, + "hashes": { + "sha-256": "e5efa2ab8842e4c55f74723bdf41a1c961f7d335682a7148dfb2e0d9ff5f0cab" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/queue_ctrl.h" + }, + "hashes": { + "sha-256": "d1f0d8199a91544fced66cbbbbab8f712d5546c52155865be68abcdb07b7ebe9" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/log.h" + }, + "hashes": { + "sha-256": "f126f1a4ec55d2abe6a914bb8afe743a9715574e25c7c168dac8a7ecd908e4ae" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/well_known.h" + }, + "hashes": { + "sha-256": "3fc028c03de1be21fe5a60a58de0c9361001517acfceecd5809e755bdfd4cc97" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/client_backend/x64/Debug/local_schedule.nativecodeanalysis.xml b/src/client_backend/x64/Debug/local_schedule.nativecodeanalysis.xml new file mode 100644 index 0000000..dcdf088 --- /dev/null +++ b/src/client_backend/x64/Debug/local_schedule.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/client_backend/x64/Debug/log.nativecodeanalysis.sarif b/src/client_backend/x64/Debug/log.nativecodeanalysis.sarif new file mode 100644 index 0000000..b9bb50b --- /dev/null +++ b/src/client_backend/x64/Debug/log.nativecodeanalysis.sarif @@ -0,0 +1,51 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.38.33133.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/log.cpp" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "47da46fe0fa2bd5079043d3c1c254b301ef0debe49abc0065d1556469590862e" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/log.h" + }, + "hashes": { + "sha-256": "f126f1a4ec55d2abe6a914bb8afe743a9715574e25c7c168dac8a7ecd908e4ae" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/well_known.h" + }, + "hashes": { + "sha-256": "3fc028c03de1be21fe5a60a58de0c9361001517acfceecd5809e755bdfd4cc97" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/client_backend/x64/Debug/log.nativecodeanalysis.xml b/src/client_backend/x64/Debug/log.nativecodeanalysis.xml new file mode 100644 index 0000000..dcdf088 --- /dev/null +++ b/src/client_backend/x64/Debug/log.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/client_backend/x64/Debug/md5hash.nativecodeanalysis.sarif b/src/client_backend/x64/Debug/md5hash.nativecodeanalysis.sarif new file mode 100644 index 0000000..b6100db --- /dev/null +++ b/src/client_backend/x64/Debug/md5hash.nativecodeanalysis.sarif @@ -0,0 +1,91 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.38.33133.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/md5hash.cpp" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "c25fd48fbf32c898f7f1e46480acef31c55550e2383484614d329f217472439a" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/md5hash.h" + }, + "hashes": { + "sha-256": "bcf666ca12d902c14ecda3ecc3ed614d1397094e13d0c4a455c186c7c7143eac" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/md5.h" + }, + "hashes": { + "sha-256": "22d8a36f6528150f4355b304477a258a6c7ab06d642f9c8e2dd9e35cd480053b" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/macros.h" + }, + "hashes": { + "sha-256": "d699d2286f1738cf935a2c6c7667be6d8a16c91874ec9cb7b93244b01526b9f2" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/opensslconf.h" + }, + "hashes": { + "sha-256": "8343f2eccc78f00a1cd05f7a994f341697213785370910afc1c7bf31cdf6fcb3" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/configuration.h" + }, + "hashes": { + "sha-256": "d7d44be54377e736d9da5f531cda3c0152abd77cbf14d9c5800047afb507fb01" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/opensslv.h" + }, + "hashes": { + "sha-256": "4283184b7b71f4694728701afbe1316821933b394c7c8e69f180d7fa8d8084ff" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/e_os2.h" + }, + "hashes": { + "sha-256": "59a517cccd94403c7037102f4beb10f33d5b8cf768a000ea8e730a23ec3e23a9" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/client_backend/x64/Debug/md5hash.nativecodeanalysis.xml b/src/client_backend/x64/Debug/md5hash.nativecodeanalysis.xml new file mode 100644 index 0000000..dcdf088 --- /dev/null +++ b/src/client_backend/x64/Debug/md5hash.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/client_backend/x64/Debug/permissions.nativecodeanalysis.sarif b/src/client_backend/x64/Debug/permissions.nativecodeanalysis.sarif new file mode 100644 index 0000000..8e23d4e --- /dev/null +++ b/src/client_backend/x64/Debug/permissions.nativecodeanalysis.sarif @@ -0,0 +1,43 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.38.33133.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/permissions.cpp" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "fca3e64e0f3385a740e829ac450f17f7e10bcb763dcaad63890e694711c820cb" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/permissions.h" + }, + "hashes": { + "sha-256": "2ba87ad7cae29b5ed6035d75517b23af7349bbcd06f6165d0b89acc9b1bd4529" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/client_backend/x64/Debug/permissions.nativecodeanalysis.xml b/src/client_backend/x64/Debug/permissions.nativecodeanalysis.xml new file mode 100644 index 0000000..dcdf088 --- /dev/null +++ b/src/client_backend/x64/Debug/permissions.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/client_backend/x64/Debug/queue _ctrl.nativecodeanalysis.sarif b/src/client_backend/x64/Debug/queue _ctrl.nativecodeanalysis.sarif new file mode 100644 index 0000000..a113794 --- /dev/null +++ b/src/client_backend/x64/Debug/queue _ctrl.nativecodeanalysis.sarif @@ -0,0 +1,43 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.38.33133.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/queue _ctrl.cpp" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "2bd34dc79d49417dd5eddc04fcbe2a6e99e7bb07bc110d6cf2ee08405dd4d723" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/queue_ctrl.h" + }, + "hashes": { + "sha-256": "d1f0d8199a91544fced66cbbbbab8f712d5546c52155865be68abcdb07b7ebe9" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/client_backend/x64/Debug/queue _ctrl.nativecodeanalysis.xml b/src/client_backend/x64/Debug/queue _ctrl.nativecodeanalysis.xml new file mode 100644 index 0000000..dcdf088 --- /dev/null +++ b/src/client_backend/x64/Debug/queue _ctrl.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/client_backend/x64/Debug/scan.nativecodeanalysis.sarif b/src/client_backend/x64/Debug/scan.nativecodeanalysis.sarif new file mode 100644 index 0000000..500b110 --- /dev/null +++ b/src/client_backend/x64/Debug/scan.nativecodeanalysis.sarif @@ -0,0 +1,123 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.38.33133.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/scan.cpp" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "f68f162ca50b11020397fc30abf12851804078b4c1d9290d1b9677e61ee6456c" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/scan.h" + }, + "hashes": { + "sha-256": "93690402b423cab6def672ef079470b67f8986d84cc9679fb807abed5b4f0e8c" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/md5.h" + }, + "hashes": { + "sha-256": "22d8a36f6528150f4355b304477a258a6c7ab06d642f9c8e2dd9e35cd480053b" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/macros.h" + }, + "hashes": { + "sha-256": "d699d2286f1738cf935a2c6c7667be6d8a16c91874ec9cb7b93244b01526b9f2" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/opensslconf.h" + }, + "hashes": { + "sha-256": "8343f2eccc78f00a1cd05f7a994f341697213785370910afc1c7bf31cdf6fcb3" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/configuration.h" + }, + "hashes": { + "sha-256": "d7d44be54377e736d9da5f531cda3c0152abd77cbf14d9c5800047afb507fb01" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/opensslv.h" + }, + "hashes": { + "sha-256": "4283184b7b71f4694728701afbe1316821933b394c7c8e69f180d7fa8d8084ff" + } + }, + { + "location": { + "uri": "file:///c:/program files/openssl-win64/include/openssl/e_os2.h" + }, + "hashes": { + "sha-256": "59a517cccd94403c7037102f4beb10f33d5b8cf768a000ea8e730a23ec3e23a9" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/md5hash.h" + }, + "hashes": { + "sha-256": "bcf666ca12d902c14ecda3ecc3ed614d1397094e13d0c4a455c186c7c7143eac" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/well_known.h" + }, + "hashes": { + "sha-256": "3fc028c03de1be21fe5a60a58de0c9361001517acfceecd5809e755bdfd4cc97" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/log.h" + }, + "hashes": { + "sha-256": "f126f1a4ec55d2abe6a914bb8afe743a9715574e25c7c168dac8a7ecd908e4ae" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/virus_ctrl.h" + }, + "hashes": { + "sha-256": "370668c3f7272e3a80df4879078a37769551d11f38a94f2ffc515cc9258f219b" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/client_backend/x64/Debug/scan.nativecodeanalysis.xml b/src/client_backend/x64/Debug/scan.nativecodeanalysis.xml new file mode 100644 index 0000000..dcdf088 --- /dev/null +++ b/src/client_backend/x64/Debug/scan.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/client_backend/x64/Debug/settings.nativecodeanalysis.sarif b/src/client_backend/x64/Debug/settings.nativecodeanalysis.sarif new file mode 100644 index 0000000..f9d0ebf --- /dev/null +++ b/src/client_backend/x64/Debug/settings.nativecodeanalysis.sarif @@ -0,0 +1,59 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.38.33133.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/settings.cpp" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "f6ae3dd8774ea6b1339a52157a9fc8d877ef9612b31ac0e203371252b04ca312" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/settings.h" + }, + "hashes": { + "sha-256": "4819503c32f357892d89be6f56a8b8c6626440ef20928090032995d32b271f3e" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/well_known.h" + }, + "hashes": { + "sha-256": "3fc028c03de1be21fe5a60a58de0c9361001517acfceecd5809e755bdfd4cc97" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/log.h" + }, + "hashes": { + "sha-256": "f126f1a4ec55d2abe6a914bb8afe743a9715574e25c7c168dac8a7ecd908e4ae" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/client_backend/x64/Debug/settings.nativecodeanalysis.xml b/src/client_backend/x64/Debug/settings.nativecodeanalysis.xml new file mode 100644 index 0000000..dcdf088 --- /dev/null +++ b/src/client_backend/x64/Debug/settings.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/client_backend/x64/Debug/thread_ctrl.nativecodeanalysis.sarif b/src/client_backend/x64/Debug/thread_ctrl.nativecodeanalysis.sarif new file mode 100644 index 0000000..3ee9a43 --- /dev/null +++ b/src/client_backend/x64/Debug/thread_ctrl.nativecodeanalysis.sarif @@ -0,0 +1,43 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.38.33133.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/thread_ctrl.cpp" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "a764266c39119186634c38806543f9318ebc89b9ccc72b8597eb088c3195aa1d" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/thread_ctrl.h" + }, + "hashes": { + "sha-256": "4a2e011f91a655485ade3c858ea9e2ab4bb87d558107c32cf455530e55bd4cb1" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/client_backend/x64/Debug/thread_ctrl.nativecodeanalysis.xml b/src/client_backend/x64/Debug/thread_ctrl.nativecodeanalysis.xml new file mode 100644 index 0000000..dcdf088 --- /dev/null +++ b/src/client_backend/x64/Debug/thread_ctrl.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/client_backend/x64/Debug/vc.nativecodeanalysis.all.xml b/src/client_backend/x64/Debug/vc.nativecodeanalysis.all.xml new file mode 100644 index 0000000..3c2ea60 --- /dev/null +++ b/src/client_backend/x64/Debug/vc.nativecodeanalysis.all.xml @@ -0,0 +1,580 @@ + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 297 + 14 + + 6387 + "overlapped.hEvent" könnte "0" sein: dies entspricht nicht der Spezifikation für Funktion "WaitForSingleObject". + monitor_directory + ?monitor_directory@@YAXPEBD@Z + 252 + 1 + 4 + + mspft + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 297 + 14 + + 1 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "WaitForSingleObject" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\synchapi.h:346 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 254 + 11 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 264 + 13 + + 2 + branch + Full + Diese Verzweigung überspringen (Annahme: "hDir==(((void *)(LONG_PTR)-1))" ist false) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 270 + 20 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 271 + 9 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 274 + 15 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 275 + 10 + + 3 + declaration + Full + "overlapped" ist eine Ausgabe von "memset" (in c:\program files\microsoft visual studio\2022\community\vc\tools\msvc\14.38.33130\include\vcruntime_string.h:63 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 276 + 22 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 286 + 14 + + 4 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "ReadDirectoryChangesW" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\winbase.h:6994 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 286 + 14 + + 5 + branch + Full + Diese Verzweigung überspringen (Annahme: "<Verzweigungsbedingung>" ist false) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 292 + 96 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 295 + 11 + + 6 + branch + Full + In diese Schleife eintreten (Annahme: "1") + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 296 + 14 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 297 + 14 + + 7 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "WaitForSingleObject" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\synchapi.h:346 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 297 + 14 + + 8 + usage + Essential + "overlapped.hEvent" sollte nicht NULL sein, da dies nicht der SAL-Anmerkung zu "WaitForSingleObject" entspricht. + + + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 313 + 26 + + 6387 + "overlapped.hEvent" könnte "0" sein: dies entspricht nicht der Spezifikation für Funktion "ResetEvent". In Zeile 297 finden Sie einen früheren Ort, an dem dies vorkommen kann. + monitor_directory + ?monitor_directory@@YAXPEBD@Z + 252 + 1 + 4 + + mspft + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 297 + 14 + + 1 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "WaitForSingleObject" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\synchapi.h:346 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 254 + 11 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 264 + 13 + + 2 + branch + Full + Diese Verzweigung überspringen (Annahme: "hDir==(((void *)(LONG_PTR)-1))" ist false) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 270 + 20 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 271 + 9 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 274 + 15 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 275 + 10 + + 3 + declaration + Full + "overlapped" ist eine Ausgabe von "memset" (in c:\program files\microsoft visual studio\2022\community\vc\tools\msvc\14.38.33130\include\vcruntime_string.h:63 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 276 + 22 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 286 + 14 + + 4 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "ReadDirectoryChangesW" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\winbase.h:6994 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 286 + 14 + + 5 + branch + Full + Diese Verzweigung überspringen (Annahme: "<Verzweigungsbedingung>" ist false) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 292 + 96 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 295 + 11 + + 6 + branch + Full + In diese Schleife eintreten (Annahme: "1") + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 296 + 14 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 297 + 14 + + 7 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "WaitForSingleObject" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\synchapi.h:346 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 299 + 23 + + 8 + branch + Full + In diese Verzweigung eintreten (Annahme: "waitStatus==(((((DWORD)0))+0))") + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 300 + 35 + + 9 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "GetOverlappedResult" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\ioapiset.h:105 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 300 + 35 + + 10 + branch + Full + In diese Verzweigung eintreten (Annahme: "<Verzweigungsbedingung>") + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 302 + 41 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 305 + 35 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 307 + 26 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 310 + 48 + + 11 + branch + Full + Diese Schleife überspringen (Annahme: "pInfo->NextEntryOffset!=0" ist false) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 313 + 26 + + 12 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "ResetEvent" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\synchapi.h:323 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 313 + 26 + + 13 + usage + Essential + "overlapped.hEvent" sollte nicht NULL sein, da dies nicht der SAL-Anmerkung zu "ResetEvent" entspricht. + + + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 341 + 15 + + 6387 + "overlapped.hEvent" könnte "0" sein: dies entspricht nicht der Spezifikation für Funktion "CloseHandle". In Zeile 297 finden Sie einen früheren Ort, an dem dies vorkommen kann. + monitor_directory + ?monitor_directory@@YAXPEBD@Z + 252 + 1 + 4 + + mspft + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 297 + 14 + + 1 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "WaitForSingleObject" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\synchapi.h:346 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 254 + 11 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 264 + 13 + + 2 + branch + Full + Diese Verzweigung überspringen (Annahme: "hDir==(((void *)(LONG_PTR)-1))" ist false) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 270 + 20 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 271 + 9 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 274 + 15 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 275 + 10 + + 3 + declaration + Full + "overlapped" ist eine Ausgabe von "memset" (in c:\program files\microsoft visual studio\2022\community\vc\tools\msvc\14.38.33130\include\vcruntime_string.h:63 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 276 + 22 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 286 + 14 + + 4 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "ReadDirectoryChangesW" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\winbase.h:6994 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 286 + 14 + + 5 + branch + Full + Diese Verzweigung überspringen (Annahme: "<Verzweigungsbedingung>" ist false) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 292 + 96 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 295 + 11 + + 6 + branch + Full + In diese Schleife eintreten (Annahme: "1") + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 296 + 14 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 297 + 14 + + 7 + declaration + Full + "overlapped" ist ein Eingabe-/Ausgabeargument für "WaitForSingleObject" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\synchapi.h:346 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 299 + 23 + + 8 + branch + Full + Diese Verzweigung überspringen (Annahme: "waitStatus==(((((DWORD)0))+0))" ist false) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 335 + 97 + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 341 + 15 + + 9 + usage + Full + "overlapped" ist eine Eingabe für "CloseHandle" (in c:\program files (x86)\windows kits\10\include\10.0.22621.0\um\handleapi.h:39 deklariert) + + + + C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\ + check_dir.cpp + 341 + 15 + + 10 + usage + Essential + "overlapped.hEvent" sollte nicht NULL sein, da dies nicht der SAL-Anmerkung zu "CloseHandle" entspricht. + + + + \ No newline at end of file diff --git a/src/client_backend/x64/Debug/vc143.idb b/src/client_backend/x64/Debug/vc143.idb index 0fd7777..ac2a5e8 100644 Binary files a/src/client_backend/x64/Debug/vc143.idb and b/src/client_backend/x64/Debug/vc143.idb differ diff --git a/src/client_backend/x64/Debug/vc143.pdb b/src/client_backend/x64/Debug/vc143.pdb index 7e7e412..8c1a940 100644 Binary files a/src/client_backend/x64/Debug/vc143.pdb and b/src/client_backend/x64/Debug/vc143.pdb differ diff --git a/src/client_backend/x64/Debug/virus_ctrl.nativecodeanalysis.sarif b/src/client_backend/x64/Debug/virus_ctrl.nativecodeanalysis.sarif new file mode 100644 index 0000000..601d8d6 --- /dev/null +++ b/src/client_backend/x64/Debug/virus_ctrl.nativecodeanalysis.sarif @@ -0,0 +1,147 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.38.33133.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/virus_ctrl.cpp" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "0323e1c21391e1d530ddade80910d6950ff168c723c057cf5f15425cb1f6d1ed" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/virus_ctrl.h" + }, + "hashes": { + "sha-256": "370668c3f7272e3a80df4879078a37769551d11f38a94f2ffc515cc9258f219b" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/well_known.h" + }, + "hashes": { + "sha-256": "3fc028c03de1be21fe5a60a58de0c9361001517acfceecd5809e755bdfd4cc97" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/log.h" + }, + "hashes": { + "sha-256": "f126f1a4ec55d2abe6a914bb8afe743a9715574e25c7c168dac8a7ecd908e4ae" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/settings.h" + }, + "hashes": { + "sha-256": "4819503c32f357892d89be6f56a8b8c6626440ef20928090032995d32b271f3e" + } + }, + { + "location": { + "uri": "file:///c:/users/janis/documents/projekte_mit_c/ma/ma/src/client_backend/connect.h" + }, + "hashes": { + "sha-256": "bad9339a042eb97ea79ae9a6b4bafe27f9c66a2c85a6f83a41e1b9194c669ea3" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/curl.h" + }, + "hashes": { + "sha-256": "92f1cb78f6e7bde3889da35f627d393661d65734a2226824c6b8fd814a706b85" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/curlver.h" + }, + "hashes": { + "sha-256": "beca18fe096fb23ad478cf4283acf7befda740aca7987a0ff31826eabbec39d2" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/system.h" + }, + "hashes": { + "sha-256": "c3d6c08073af28edaa73a6715afc0ac00ba0289c632d6ce6b654c5e7f98f98c2" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/easy.h" + }, + "hashes": { + "sha-256": "0890e063d2bea8ba815d747d4f665994e263e1043f0e14a85733c9445cb83a6d" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/multi.h" + }, + "hashes": { + "sha-256": "3dd2ff1eeea4298f08d0aa5c6a46140644b6ee2e710ee8bc64513e732f32975c" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/urlapi.h" + }, + "hashes": { + "sha-256": "dd631108b8503994fcf6c416eeaea2973822fc778ea2cff440c6b6e21c8712d2" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/options.h" + }, + "hashes": { + "sha-256": "5716018d27e783283825bed2a8a051190487722fdeb64b7aa2d03a997e99b8d1" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/header.h" + }, + "hashes": { + "sha-256": "614be48a86f4e5d304c5aa40ef1c85245e25b97732921c3631840146669d992f" + } + }, + { + "location": { + "uri": "file:///c:/vcpkg/vcpkg-2023.08.09/installed/x64-windows/include/curl/websockets.h" + }, + "hashes": { + "sha-256": "b58bb1d7eda3fd2372feb4d856c256897d83006dfe7933d69be54bc4a2ba5a3f" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/client_backend/x64/Debug/virus_ctrl.nativecodeanalysis.xml b/src/client_backend/x64/Debug/virus_ctrl.nativecodeanalysis.xml new file mode 100644 index 0000000..dcdf088 --- /dev/null +++ b/src/client_backend/x64/Debug/virus_ctrl.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/ma_installer/.vs/ma_installer/FileContentIndex/958015df-8f92-4862-80e3-f429be65c3d8.vsidx b/src/ma_installer/.vs/ma_installer/FileContentIndex/958015df-8f92-4862-80e3-f429be65c3d8.vsidx deleted file mode 100644 index dc7fc51..0000000 Binary files a/src/ma_installer/.vs/ma_installer/FileContentIndex/958015df-8f92-4862-80e3-f429be65c3d8.vsidx and /dev/null differ diff --git a/src/ma_installer/.vs/ma_installer/FileContentIndex/a8a1d79b-01fb-41ca-ab43-a977607f550c.vsidx b/src/ma_installer/.vs/ma_installer/FileContentIndex/a8a1d79b-01fb-41ca-ab43-a977607f550c.vsidx new file mode 100644 index 0000000..6ff6e9d Binary files /dev/null and b/src/ma_installer/.vs/ma_installer/FileContentIndex/a8a1d79b-01fb-41ca-ab43-a977607f550c.vsidx differ diff --git a/src/ma_installer/.vs/ma_installer/v17/.suo b/src/ma_installer/.vs/ma_installer/v17/.suo index 5807235..f6e9a8e 100644 Binary files a/src/ma_installer/.vs/ma_installer/v17/.suo and b/src/ma_installer/.vs/ma_installer/v17/.suo differ diff --git a/src/ma_installer/.vs/ma_installer/v17/Browse.VC.db b/src/ma_installer/.vs/ma_installer/v17/Browse.VC.db index 0f27212..592f868 100644 Binary files a/src/ma_installer/.vs/ma_installer/v17/Browse.VC.db and b/src/ma_installer/.vs/ma_installer/v17/Browse.VC.db differ diff --git a/src/ma_installer/ma_installer.cpp b/src/ma_installer/ma_installer.cpp index 2c4934f..3e90805 100644 --- a/src/ma_installer/ma_installer.cpp +++ b/src/ma_installer/ma_installer.cpp @@ -217,34 +217,37 @@ int main() // We're admin, so we can do admin stuff here ... printf("Creating directorys\n"); printf("Creating directory for application\n"); - error = create_insecure_folder(L"C:\\Program Files\\cyberhex"); //create main folder for cyberhex + error = create_insecure_folder(L"C:\\Program Files\\cyberhex"); //create main folder for cyberhex if (error == 0) { printf("Creating directory for communication\n"); - error = create_insecure_folder(L"C:\\Program Files\\cyberhex\\com"); //create folder for communication with desktop client + error = create_insecure_folder(L"C:\\Program Files\\cyberhex\\com"); //create folder for communication with desktop client }if (error == 0) { printf("Creating directory for desktop client\n"); - error = create_insecure_folder(L"C:\\Program Files\\cyberhex\\app"); //create folder for desktop client application + error = create_insecure_folder(L"C:\\Program Files\\cyberhex\\app"); //create folder for desktop client application }if (error == 0) { printf("Creating directory for secure files\n"); - error = create_secure_folder(L"C:\\Program Files\\cyberhex\\secure"); //create secure folder + error = create_secure_folder(L"C:\\Program Files\\cyberhex\\secure"); //create secure folder }if (error == 0){ printf("Creating directory for database\n"); - error = create_secure_folder(L"C:\\Program Files\\cyberhex\\secure\\database"); //create secure folder for hash database + error = create_secure_folder(L"C:\\Program Files\\cyberhex\\secure\\database"); //create secure folder for hash database + }if (error == 0) { + printf("Creating directory for folder database\n"); + error = create_secure_folder(L"C:\\Program Files\\cyberhex\\secure\\database\\folder"); //create secure folder for hash database }if (error == 0){ printf("Creating directory for settings\n"); - error = create_secure_folder(L"C:\\Program Files\\cyberhex\\secure\\settings"); //create secure folder for settings + error = create_secure_folder(L"C:\\Program Files\\cyberhex\\secure\\settings"); //create secure folder for settings }if (error == 0){ printf("Creating directory for quarantined files\n"); - error = create_secure_folder(L"C:\\Program Files\\cyberhex\\secure\\quarantine"); //create secure folder for quarantined files = viruses + error = create_secure_folder(L"C:\\Program Files\\cyberhex\\secure\\quarantine"); //create secure folder for quarantined files = viruses }if (error == 0){ printf("Creating directory for log files\n"); - error = create_secure_folder(L"C:\\Program Files\\cyberhex\\secure\\log"); //create secure folder for log files + error = create_secure_folder(L"C:\\Program Files\\cyberhex\\secure\\log"); //create secure folder for log files }if (error == 0){ printf("Creating directory for communication\n"); - error = create_secure_folder(L"C:\\Program Files\\cyberhex\\secure\\com"); //create secure folder for communication with server + error = create_secure_folder(L"C:\\Program Files\\cyberhex\\secure\\com"); //create secure folder for communication with server }if (error == 0) { printf("Creating directory for application\n"); - error = create_secure_folder(L"C:\\Program Files\\cyberhex\\secure\\app"); //create secure folder for application files + error = create_secure_folder(L"C:\\Program Files\\cyberhex\\secure\\app"); //create secure folder for application files } //download files from server