diff --git a/src/client_backend/.vs/client_backend/v17/.suo b/src/client_backend/.vs/client_backend/v17/.suo index 0cb3fbb..885e892 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 ff3cd79..def0043 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/.vs/client_backend/v17/DocumentLayout.json b/src/client_backend/.vs/client_backend/v17/DocumentLayout.json index 2a6a568..c7e0c1d 100644 --- a/src/client_backend/.vs/client_backend/v17/DocumentLayout.json +++ b/src/client_backend/.vs/client_backend/v17/DocumentLayout.json @@ -3,20 +3,60 @@ "WorkspaceRootPath": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\", "Documents": [ { - "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", - "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:update.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\thread_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:thread_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, + { + "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:local_com.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, + { + "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:local_com.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, + { + "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\deepscan.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:deepscan.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, + { + "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\deepscan.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:deepscan.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, { "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\client_backend.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:client_backend.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, + { + "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:utils.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, + { + "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_dir.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:check_dir.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, + { + "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_process.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:check_process.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, + { + "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:scan.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, { "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:utils.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, { - "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", - "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:utils.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:scan.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, + { + "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\well_known.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:well_known.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, + { + "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:update.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, { "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", @@ -34,14 +74,6 @@ "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\security.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:security.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, - { - "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", - "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:scan.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" - }, - { - "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\well_known.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", - "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:well_known.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" - }, { "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\security.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:security.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" @@ -54,22 +86,10 @@ "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\settings.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:settings.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, - { - "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\thread_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", - "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:thread_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" - }, - { - "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_dir.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", - "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:check_dir.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" - }, { "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_schedule.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:local_schedule.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, - { - "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_process.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", - "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:check_process.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" - }, { "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\app_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:app_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" @@ -82,14 +102,6 @@ "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:virus_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, - { - "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", - "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:scan.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" - }, - { - "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", - "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:local_com.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" - }, { "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:connect.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" @@ -98,10 +110,6 @@ "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:connect.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, - { - "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\log.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", - "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:log.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" - }, { "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\queue _ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:queue _ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" @@ -114,10 +122,6 @@ "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\queue_ctrl.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:queue_ctrl.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, - { - "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", - "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:local_com.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" - }, { "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:virus_ctrl.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" @@ -130,23 +134,37 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 25, + "SelectedChildIndex": 10, "Children": [ { "$type": "Document", - "DocumentIndex": 6, - "Title": "zip.h", - "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\zip.h", - "RelativeDocumentMoniker": "zip.h", - "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\zip.h", - "RelativeToolTip": "zip.h", - "ViewState": "AQIAAAAAAAAAAAAAAAAAAAEAAAARAAAA", + "DocumentIndex": 4, + "Title": "deepscan.h", + "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\deepscan.h", + "RelativeDocumentMoniker": "deepscan.h", + "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\deepscan.h", + "RelativeToolTip": "deepscan.h", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAAcAAAA6AAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-29T07:57:13.208Z" + "WhenOpened": "2024-03-31T08:30:49.097Z", + "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 5, + "DocumentIndex": 3, + "Title": "deepscan.cpp", + "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\deepscan.cpp", + "RelativeDocumentMoniker": "deepscan.cpp", + "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\deepscan.cpp", + "RelativeToolTip": "deepscan.cpp", + "ViewState": "AQIAAKoAAAAAAAAAAAAuwHYAAABpAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", + "WhenOpened": "2024-03-31T08:30:41.528Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 15, "Title": "zip.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\zip.cpp", "RelativeDocumentMoniker": "zip.cpp", @@ -158,7 +176,7 @@ }, { "$type": "Document", - "DocumentIndex": 10, + "DocumentIndex": 18, "Title": "security.h", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\security.h", "RelativeDocumentMoniker": "security.h", @@ -170,7 +188,7 @@ }, { "$type": "Document", - "DocumentIndex": 7, + "DocumentIndex": 17, "Title": "security.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\security.cpp", "RelativeDocumentMoniker": "security.cpp", @@ -182,7 +200,7 @@ }, { "$type": "Document", - "DocumentIndex": 11, + "DocumentIndex": 19, "Title": "md5hash.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\md5hash.cpp", "RelativeDocumentMoniker": "md5hash.cpp", @@ -194,31 +212,33 @@ }, { "$type": "Document", - "DocumentIndex": 20, + "DocumentIndex": 11, "Title": "scan.h", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.h", "RelativeDocumentMoniker": "scan.h", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.h", "RelativeToolTip": "scan.h", - "ViewState": "AQIAAA0AAAAAAAAAAAAAABUAAAADAAAA", + "ViewState": "AQIAAAAAAAAAAAAAAAAAABEAAAAuAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-13T06:41:43.701Z" + "WhenOpened": "2024-03-13T06:41:43.701Z", + "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 8, + "DocumentIndex": 9, "Title": "scan.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.cpp", "RelativeDocumentMoniker": "scan.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.cpp", "RelativeToolTip": "scan.cpp", - "ViewState": "AQIAAHYAAAAAAAAAAAAawJEAAAAKAAAA", + "ViewState": "AQIAAN4AAAAAAAAAAAAawPYAAABTAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-01-28T20:40:06.248Z" + "WhenOpened": "2024-01-28T20:40:06.248Z", + "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 22, + "DocumentIndex": 25, "Title": "connect.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.cpp", "RelativeDocumentMoniker": "connect.cpp", @@ -230,44 +250,46 @@ }, { "$type": "Document", - "DocumentIndex": 1, + "DocumentIndex": 5, "Title": "client_backend.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\client_backend.cpp", "RelativeDocumentMoniker": "client_backend.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\client_backend.cpp", "RelativeToolTip": "client_backend.cpp", - "ViewState": "AQIAABYAAAAAAAAAAAAqwD8AAAAGAAAA", + "ViewState": "AQIAAEUAAAAAAAAAAAAAAHIAAAACAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "WhenOpened": "2024-01-28T20:40:06.279Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 13, + "DocumentIndex": 0, "Title": "thread_ctrl.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\thread_ctrl.cpp", "RelativeDocumentMoniker": "thread_ctrl.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\thread_ctrl.cpp", "RelativeToolTip": "thread_ctrl.cpp", - "ViewState": "AQIAAAAAAAAAAAAAAAAAABUAAAAqAAAA", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAAgAAAAVAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-03-13T06:52:01.533Z" + "WhenOpened": "2024-03-13T06:52:01.533Z", + "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 21, + "DocumentIndex": 1, "Title": "local_com.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.cpp", "RelativeDocumentMoniker": "local_com.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.cpp", "RelativeToolTip": "local_com.cpp", - "ViewState": "AQIAAAAAAAAAAAAAAAAAAAsAAAAXAAAA", + "ViewState": "AQIAAAMAAAAAAAAAAAAAAAsAAAAXAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-03-17T16:34:14.678Z" + "WhenOpened": "2024-03-17T16:34:14.678Z", + "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 19, + "DocumentIndex": 24, "Title": "virus_ctrl.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.cpp", "RelativeDocumentMoniker": "virus_ctrl.cpp", @@ -279,7 +301,7 @@ }, { "$type": "Document", - "DocumentIndex": 29, + "DocumentIndex": 30, "Title": "virus_ctrl.h", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.h", "RelativeDocumentMoniker": "virus_ctrl.h", @@ -291,31 +313,20 @@ }, { "$type": "Document", - "DocumentIndex": 24, - "Title": "log.h", - "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\log.h", - "RelativeDocumentMoniker": "log.h", - "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\log.h", - "RelativeToolTip": "log.h", - "ViewState": "AQIAAEwAAAAAAAAAAABBwG4AAAA2AAAA", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-13T06:47:02.038Z" - }, - { - "$type": "Document", - "DocumentIndex": 3, + "DocumentIndex": 6, "Title": "utils.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.cpp", "RelativeDocumentMoniker": "utils.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.cpp", "RelativeToolTip": "utils.cpp", - "ViewState": "AQIAAI0AAAAAAAAAAAAAAKcAAAAAAAAA", + "ViewState": "AQIAAJYAAAAAAAAAAAAAAMEAAABnAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-03-14T15:55:22.469Z" + "WhenOpened": "2024-03-14T15:55:22.469Z", + "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 18, + "DocumentIndex": 23, "Title": "app_ctrl.h", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\app_ctrl.h", "RelativeDocumentMoniker": "app_ctrl.h", @@ -327,31 +338,33 @@ }, { "$type": "Document", - "DocumentIndex": 28, + "DocumentIndex": 2, "Title": "local_com.h", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.h", "RelativeDocumentMoniker": "local_com.h", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.h", "RelativeToolTip": "local_com.h", - "ViewState": "AQIAAAAAAAAAAAAAAAAAAAYAAABSAAAA", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAAYAAAAXAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-13T06:49:41.823Z" + "WhenOpened": "2024-03-13T06:49:41.823Z", + "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 14, + "DocumentIndex": 7, "Title": "check_dir.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_dir.cpp", "RelativeDocumentMoniker": "check_dir.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_dir.cpp", "RelativeToolTip": "check_dir.cpp", - "ViewState": "AQIAAAYAAAAAAAAAAAAAACMAAAAGAAAA", + "ViewState": "AQIAAAYAAAAAAAAAAAAAADAAAABQAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-03-13T06:48:31.009Z" + "WhenOpened": "2024-03-13T06:48:31.009Z", + "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 12, + "DocumentIndex": 20, "Title": "settings.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\settings.cpp", "RelativeDocumentMoniker": "settings.cpp", @@ -363,19 +376,20 @@ }, { "$type": "Document", - "DocumentIndex": 9, + "DocumentIndex": 12, "Title": "well_known.h", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\well_known.h", "RelativeDocumentMoniker": "well_known.h", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\well_known.h", "RelativeToolTip": "well_known.h", - "ViewState": "AQIAACYAAAAAAAAAAAAawEIAAABbAAAA", + "ViewState": "AQIAAAgAAAAAAAAAAAAawC4AAAAZAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-14T13:20:06.953Z" + "WhenOpened": "2024-03-14T13:20:06.953Z", + "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 4, + "DocumentIndex": 14, "Title": "update.h", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.h", "RelativeDocumentMoniker": "update.h", @@ -387,7 +401,7 @@ }, { "$type": "Document", - "DocumentIndex": 25, + "DocumentIndex": 27, "Title": "queue _ctrl.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\queue _ctrl.cpp", "RelativeDocumentMoniker": "queue _ctrl.cpp", @@ -399,7 +413,7 @@ }, { "$type": "Document", - "DocumentIndex": 27, + "DocumentIndex": 29, "Title": "queue_ctrl.h", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\queue_ctrl.h", "RelativeDocumentMoniker": "queue_ctrl.h", @@ -411,7 +425,7 @@ }, { "$type": "Document", - "DocumentIndex": 23, + "DocumentIndex": 26, "Title": "connect.h", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.h", "RelativeDocumentMoniker": "connect.h", @@ -423,19 +437,45 @@ }, { "$type": "Document", - "DocumentIndex": 16, + "DocumentIndex": 8, "Title": "check_process.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_process.cpp", "RelativeDocumentMoniker": "check_process.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_process.cpp", "RelativeToolTip": "check_process.cpp", - "ViewState": "AQIAAAkAAAAAAAAAAAAAACsAAABtAAAA", + "ViewState": "AQIAAAwAAAAAAAAAAAAAADoAAABhAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-03-14T13:35:33.369Z" + "WhenOpened": "2024-03-14T13:35:33.369Z", + "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 0, + "DocumentIndex": 10, + "Title": "utils.h", + "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.h", + "RelativeDocumentMoniker": "utils.h", + "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.h", + "RelativeToolTip": "utils.h", + "ViewState": "AQIAAAAAAAAAAAAAAAAAABAAAAAVAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", + "WhenOpened": "2024-03-14T15:55:30.524Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 16, + "Title": "zip.h", + "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\zip.h", + "RelativeDocumentMoniker": "zip.h", + "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\zip.h", + "RelativeToolTip": "zip.h", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAAEAAAARAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", + "WhenOpened": "2024-03-29T07:57:13.208Z" + }, + { + "$type": "Document", + "DocumentIndex": 13, "Title": "update.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.cpp", "RelativeDocumentMoniker": "update.cpp", @@ -443,24 +483,11 @@ "RelativeToolTip": "update.cpp", "ViewState": "AQIAAEUAAAAAAAAAAAAAAFcAAAAvAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-01-28T20:40:06.248Z", - "EditorCaption": "" + "WhenOpened": "2024-01-28T20:40:06.248Z" }, { "$type": "Document", - "DocumentIndex": 2, - "Title": "utils.h", - "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.h", - "RelativeDocumentMoniker": "utils.h", - "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.h", - "RelativeToolTip": "utils.h", - "ViewState": "AQIAAAAAAAAAAAAAAAAAAA0AAAA4AAAA", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-14T15:55:30.524Z" - }, - { - "$type": "Document", - "DocumentIndex": 26, + "DocumentIndex": 28, "Title": "settings.h", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\settings.h", "RelativeDocumentMoniker": "settings.h", @@ -472,7 +499,7 @@ }, { "$type": "Document", - "DocumentIndex": 17, + "DocumentIndex": 22, "Title": "app_ctrl.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\app_ctrl.cpp", "RelativeDocumentMoniker": "app_ctrl.cpp", @@ -484,7 +511,7 @@ }, { "$type": "Document", - "DocumentIndex": 15, + "DocumentIndex": 21, "Title": "local_schedule.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_schedule.cpp", "RelativeDocumentMoniker": "local_schedule.cpp", diff --git a/src/client_backend/check_dir.cpp b/src/client_backend/check_dir.cpp index fe83576..c51fbc0 100644 --- a/src/client_backend/check_dir.cpp +++ b/src/client_backend/check_dir.cpp @@ -46,7 +46,7 @@ void process_changes(const FILE_NOTIFY_INFORMATION* pInfo) { } else { int thread_timeout = 0; - while (get_num_threads() >= std::thread::hardware_concurrency()) { + while (get_num_threads()-1 >= std::thread::hardware_concurrency()) { Sleep(10); thread_timeout++; if (thread_timeout == 100 * 60) {//if there is for more than 30 seconds no thread available, chances are high, that the threads did not temrinate correctly but aren t running anymore. so set the counter to 0 because else it might just stop the scan. diff --git a/src/client_backend/check_process.cpp b/src/client_backend/check_process.cpp index f3c1a36..e0a7906 100644 --- a/src/client_backend/check_process.cpp +++ b/src/client_backend/check_process.cpp @@ -56,7 +56,7 @@ void monitor_processes() { } else { int thread_timeout = 0; - while (get_num_threads() >= std::thread::hardware_concurrency()) { + while (get_num_threads()-1 >= std::thread::hardware_concurrency()) { Sleep(10); thread_timeout++; if (thread_timeout == 100 * 60) {//if there is for more than 30 seconds no thread available, chances are high, that the threads did not temrinate correctly but aren t running anymore. so set the counter to 0 because else it might just stop the scan. diff --git a/src/client_backend/client_backend.cpp b/src/client_backend/client_backend.cpp index c55f0c1..a42384c 100644 --- a/src/client_backend/client_backend.cpp +++ b/src/client_backend/client_backend.cpp @@ -3,7 +3,7 @@ #include #include #include -//#include +#include #include "app_ctrl.h" #include "md5hash.h" #include "connect.h" @@ -20,14 +20,18 @@ #include "update.h" #include "check_process.h" #include "utils.h" -int main(int argc, char*argv[]) { +#include "deepscan.h" +int main(int argc, char* argv[]) { //log(LOGLEVEL::INFO, "[main()]:Starting main thread."); //return 0; + //runner(); + //printf("done\n"); + log(LOGLEVEL::INFO_NOSEND, "[main()]:Starting main thread."); int err = 0; - printf("welcome to the jakach security tool main thread\n"); + printf("welcome to the jakach security tool main thread\n"); //exit(0); if (load_settings() == 0) {//load the settings from the settings file if (argc != 2) { @@ -47,18 +51,18 @@ int main(int argc, char*argv[]) { } } else { - log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not load settings from file."); + log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not load settings from file."); log(LOGLEVEL::PANIC_NOSEND, "[main()]:Panic, no settings file loaded, terminating process!"); Sleep(1000); //wait for the log to be written exit(1); - } + } //do self check - if ((err=selfcheck())!=0) { + if ((err = selfcheck()) != 0) { log(LOGLEVEL::PANIC, "[main()]:This installation of cyberhex failed the self check! Application may be tampered with!", err); - log(LOGLEVEL::PANIC, "[main()]:Panic, self check failed, terminating process!"); + log(LOGLEVEL::PANIC, "[main()]:Panic, self check failed, terminating process!"); Sleep(1000); //wait for the log to be written and swnt to the server - exit(1); - } + exit(1); + } //printf("self check passed\n"); //update_db2(DB_DIR); //printf("db update finished\n"); @@ -67,12 +71,13 @@ int main(int argc, char*argv[]) { //init debug mode if needed if (argc == 2) { if (strcmp(argv[1], "-d") == 0) { - debug_mode_init(); - } - } + debug_mode_init(); + } + } // Initialize hash databases err = initialize(DB_DIR); + log(LOGLEVEL::INFO_NOSEND, "[main()]:Hash databases initialized."); if (err != 0) { switch (err) { case 1: @@ -102,6 +107,15 @@ int main(int argc, char*argv[]) { process_scanner_thread.detach(); } + + //initialize the deep scan database + yr_initialize(); + init_yara_rules(YARA_DB_DIR); + log(LOGLEVEL::INFO_NOSEND, "[main()]:Yara rules initialized."); +// std::string a("C:\\users\\janis\\documents"); +// deepscan_folder(a); + + // // Main thread loop while (!app_stop()) { auto start = std::chrono::high_resolution_clock::now(); @@ -131,6 +145,6 @@ int main(int argc, char*argv[]) { if (duration.count() < 1000) Sleep(1000 - duration.count()); } - + yr_finalize(); return 0; } diff --git a/src/client_backend/client_backend.vcxproj b/src/client_backend/client_backend.vcxproj index 0af9af5..56f2374 100644 --- a/src/client_backend/client_backend.vcxproj +++ b/src/client_backend/client_backend.vcxproj @@ -142,6 +142,7 @@ + @@ -161,6 +162,7 @@ + diff --git a/src/client_backend/client_backend.vcxproj.filters b/src/client_backend/client_backend.vcxproj.filters index f2b1455..3610b91 100644 --- a/src/client_backend/client_backend.vcxproj.filters +++ b/src/client_backend/client_backend.vcxproj.filters @@ -75,6 +75,9 @@ Headerdateien + + Headerdateien + @@ -134,6 +137,9 @@ Headerdateien + + Headerdateien + diff --git a/src/client_backend/client_backend/x64/Debug/client_backend.ilk b/src/client_backend/client_backend/x64/Debug/client_backend.ilk index f55a9cd..bd77e23 100644 Binary files a/src/client_backend/client_backend/x64/Debug/client_backend.ilk and b/src/client_backend/client_backend/x64/Debug/client_backend.ilk differ diff --git a/src/client_backend/client_backend/x64/Debug/client_backend.log b/src/client_backend/client_backend/x64/Debug/client_backend.log index f0f89af..8f34749 100644 --- a/src/client_backend/client_backend/x64/Debug/client_backend.log +++ b/src/client_backend/client_backend/x64/Debug/client_backend.log @@ -1,11 +1,13 @@  Quellen werden auf Modulabhängigkeiten überprüft... client_backend.cpp -C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend.cpp(132,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(132,24): warning C4244: with -C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend.cpp(132,24): warning C4244: [ -C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend.cpp(132,24): warning C4244: _Rep=__int64 -C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend.cpp(132,24): warning C4244: ] - update.cpp +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend.cpp(146,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(146,24): warning C4244: with +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend.cpp(146,24): warning C4244: [ +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend.cpp(146,24): warning C4244: _Rep=__int64 +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend.cpp(146,24): warning C4244: ] + deepscan.cpp +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\deepscan.cpp(119,46): warning C4018: ">=": Konflikt zwischen "signed" und "unsigned" + thread_ctrl.cpp Code wird generiert... client_backend.vcxproj -> C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\client_backend.exe C:\vcpkg\vcpkg-2023.08.09\scripts\buildsystems\msbuild\vcpkg.targets(228,5): warning : [vcpkg] Failed to gather app local DLL dependencies, program may not run. Set VcpkgApplocalDeps to false in your project file to suppress this warning. PowerShell arguments: -ExecutionPolicy Bypass -noprofile -File "C:\vcpkg\vcpkg-2023.08.09\scripts\buildsystems\msbuild\applocal.ps1" "C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\client_backend.exe" "C:\vcpkg\vcpkg-2023.08.09\installed\x64-windows\debug\bin" "client_backend\x64\Debug\client_backend.tlog\client_backend.write.1u.tlog" "client_backend\x64\Debug\vcpkg.applocal.log" diff --git a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.command.1.tlog b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.command.1.tlog index 4fce760..929ce5f 100644 Binary files a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.command.1.tlog and b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.command.1.tlog differ diff --git a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.read.1.tlog b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.read.1.tlog index 93860ae..d9a6cab 100644 Binary files a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.read.1.tlog and b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.read.1.tlog differ diff --git a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.write.1.tlog b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.write.1.tlog index 2354d50..d2d3ebb 100644 Binary files a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.write.1.tlog and b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.write.1.tlog differ diff --git a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/Cl.items.tlog b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/Cl.items.tlog index 742679c..2a3b1cc 100644 --- a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/Cl.items.tlog +++ b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/Cl.items.tlog @@ -4,6 +4,7 @@ C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\check_dir.cpp;C C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\check_process.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend\x64\Debug\check_process.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\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\client_backend\x64\Debug\connect.obj +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\deepscan.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend\x64\Debug\deepscan.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\client_backend\x64\Debug\local_com.obj C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\local_schedule.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend\x64\Debug\local_schedule.obj C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\log.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend\x64\Debug\log.obj diff --git a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/link.command.1.tlog b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/link.command.1.tlog index 38cb3b1..3eddbdb 100644 Binary files a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/link.command.1.tlog and b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/link.command.1.tlog differ diff --git a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/link.read.1.tlog b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/link.read.1.tlog index f423dbe..873ac9e 100644 Binary files a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/link.read.1.tlog and b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/link.read.1.tlog differ diff --git a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/link.secondary.1.tlog b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/link.secondary.1.tlog index 7d178e6..ae478df 100644 --- a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/link.secondary.1.tlog +++ b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/link.secondary.1.tlog @@ -1,2 +1,2 @@ -^C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\APP_CTRL.H.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\APP_CTRL.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\CHECK_DIR.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\CHECK_PROCESS.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\CLIENT_BACKEND.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\CLIENT_BACKEND.RES|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\CONNECT.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\LOCAL_COM.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\LOCAL_SCHEDULE.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\LOG.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\MD5HASH.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\PERMISSIONS.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\QUEUE _CTRL.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\SCAN.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\SECURITY.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\SETTINGS.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\THREAD_CTRL.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\UPDATE.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\UTILS.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\VIRUS_CTRL.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\ZIP.OBJ +^C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\APP_CTRL.H.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\APP_CTRL.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\CHECK_DIR.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\CHECK_PROCESS.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\CLIENT_BACKEND.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\CLIENT_BACKEND.RES|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\CONNECT.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\DEEPSCAN.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\LOCAL_COM.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\LOCAL_SCHEDULE.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\LOG.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\MD5HASH.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\PERMISSIONS.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\QUEUE _CTRL.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\SCAN.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\SECURITY.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\SETTINGS.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\THREAD_CTRL.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\UPDATE.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\UTILS.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\VIRUS_CTRL.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_BACKEND\CLIENT_BACKEND\X64\DEBUG\ZIP.OBJ C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend\x64\Debug\client_backend.ilk diff --git a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/link.write.1.tlog b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/link.write.1.tlog index 6549b95..d695b52 100644 Binary files a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/link.write.1.tlog and b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/link.write.1.tlog differ diff --git a/src/client_backend/client_backend/x64/Debug/vc143.idb b/src/client_backend/client_backend/x64/Debug/vc143.idb index b2c9a75..22f1fa9 100644 Binary files a/src/client_backend/client_backend/x64/Debug/vc143.idb and b/src/client_backend/client_backend/x64/Debug/vc143.idb differ diff --git a/src/client_backend/client_backend/x64/Debug/vc143.pdb b/src/client_backend/client_backend/x64/Debug/vc143.pdb index 594c348..4b16116 100644 Binary files a/src/client_backend/client_backend/x64/Debug/vc143.pdb and b/src/client_backend/client_backend/x64/Debug/vc143.pdb differ diff --git a/src/client_backend/deepscan.cpp b/src/client_backend/deepscan.cpp new file mode 100644 index 0000000..60af01a --- /dev/null +++ b/src/client_backend/deepscan.cpp @@ -0,0 +1,251 @@ +#include "deepscan.h" +#include "virus_ctrl.h" +#include "md5hash.h" +#include "well_known.h" +#include "log.h" +#include "utils.h" +#include "scan.h" +#include "app_ctrl.h" +#include +#include +#include +#include +#include +#include +#include +#include + +std::vector compiled_rules; //global variable to store the compiled rules +std::mutex yara_scan_mutex; +int deep_cnt = 0; +int deep_all_files = 0; +int action_deepscan_is_virus = 0; //flag that is set by the callback function to tell the action_deepscan function if the file is a virus or not. this is needed to talk to the desktop client +//scan with yara rules +//functions to create: action_deepscanfile +//deepscan_file_t +//action_deepscanfolder +//deepscan_folder + + +YR_RULES* load_yara_rules(const char* ruleFilePath, YR_RULES* compiledRules = nullptr) { + // Create a new compiler + YR_COMPILER* compiler; + if (yr_compiler_create(&compiler) != ERROR_SUCCESS) { + std::cerr << "Failed to create YARA compiler." << std::endl; + return nullptr; + } + + FILE* file; + fopen_s(&file, ruleFilePath, "r"); + if (file == nullptr) { + yr_compiler_destroy(compiler); + return nullptr; + } + int result = yr_compiler_add_file(compiler, file, nullptr, ruleFilePath); + if (result != ERROR_SUCCESS) { + //std::cerr << "Failed to compile YARA rules from file: " << ruleFilePath << std::endl; + log(LOGLEVEL::ERR_NOSEND, "[load_yara_rules()]: Failed to compile YARA rules from file: ", ruleFilePath); + yr_compiler_destroy(compiler); + return nullptr; + } + + // Get rules from compiler and add them to the compiledRules object + yr_compiler_get_rules(compiler, &compiledRules); + + // Destroy the compiler + yr_compiler_destroy(compiler); + + return compiledRules; +} +void init_yara_rules(const char* folderPath) { + + // Stack to store directories to be traversed iteratively + std::stack directories; + directories.push(folderPath); + + while (!directories.empty()) { + std::string currentDir = directories.top(); + directories.pop(); + + for (const auto& entry : std::filesystem::directory_iterator(currentDir)) { + if (entry.is_regular_file()) { + std::string filePath = entry.path().string(); + if (filePath.ends_with(".yar") || filePath.ends_with(".yara")) { + YR_RULES* rules = load_yara_rules(filePath.c_str()); + if (rules != nullptr) { + compiled_rules.push_back(rules); + } + } + } + else if (entry.is_directory()) { + directories.push(entry.path().string()); + } + } + } +} + + +std::stack deep_directories; // Stack to store directories to be scanned + +void deepscan_folder(const std::string& directory) { + deep_directories.push(directory); + + while (!deep_directories.empty()) { + std::string current_dir = deep_directories.top(); + deep_directories.pop(); + + std::string search_path = current_dir + "\\*.*"; + WIN32_FIND_DATA find_file_data; + HANDLE hFind = FindFirstFile(search_path.c_str(), &find_file_data); + + if (hFind != INVALID_HANDLE_VALUE) { + do { + if (strcmp(find_file_data.cFileName, ".") == 0 || strcmp(find_file_data.cFileName, "..") == 0) { + continue; // Skip the current and parent directories + } + + const std::string full_path = current_dir + "\\" + find_file_data.cFileName; + if (find_file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + // If it's a directory, add it to the stack + deep_directories.push(full_path); + } + else { + if (debug_mode()) + log(LOGLEVEL::INFO_NOSEND, "[deepscan_folder()]: Scanning file: ", full_path); + + // Do multithreading here + int thread_timeout = 0; + //log(LOGLEVEL::INFO_NOSEND, "[scan_folder()]: Scanning file: ", full_path); + while (get_num_threads() >= std::thread::hardware_concurrency() && thread_safety()) { + Sleep(10); + thread_timeout++; + //printf("Thread timeout: %d\n", thread_timeout); + if (thread_timeout == 100 * 20) { + // If there is no available thread for more than 30 seconds, reset the thread counter + set_num_threads(0); + } + } + //log(LOGLEVEL::INFO_NOSEND, "[scan_folder()]: Scanning file: ", full_path); + if (is_valid_path(full_path)) { // Filter out invalid paths and paths with weird characters + std::uintmax_t fileSize = std::filesystem::file_size(full_path); + if (fileSize > 4000000000) { // 4GB + log(LOGLEVEL::INFO_NOSEND, "[deepscan_folder()]: File too large to scan: ", full_path); + } + else { + std::thread scan_thread(deepscan_file_t, full_path); + scan_thread.detach(); + } + } + else { + log(LOGLEVEL::INFO_NOSEND, "[deepscan_folder()]: Invalid path: ", full_path); + } + deep_cnt++; + if (deep_cnt % 100 == 0) { + printf("Processed %d files;\n", deep_cnt); + //printf("Number of threads: %d\n", num_threads); + } + if (deep_cnt % 1000 == 0) { + int actual_threads = get_num_running_threads(); + if (get_num_threads() > actual_threads) + set_num_threads(actual_threads);//correct value of threads + printf("Number of threads: %d\n", get_num_threads()); + //send progress to com file + std::ofstream answer_com(ANSWER_COM_PATH, std::ios::app); + if (answer_com.is_open()) { + answer_com << "progress " << (deep_cnt * 100 / (deep_all_files + 1)) << "\n"; + answer_com.close(); + } + } + } + } while (FindNextFile(hFind, &find_file_data) != 0); + FindClose(hFind); + } + else { + log(LOGLEVEL::ERR_NOSEND, "[deepscan_folder()]: Could not open directory: ", current_dir, " while scanning files inside directory."); + } + } +} + + +struct Callback_data { + std::string filepath; + // You can add more data members here if needed +}; +int process_callback(YR_SCAN_CONTEXT* context,int message, void* message_data, void* user_data) { + switch (message) { + case CALLBACK_MSG_RULE_MATCHING: + { + // Access filepath from CallbackData + Callback_data* callback_data = (Callback_data*)user_data; + + // Access filepath from CallbackData + std::string filepath = callback_data->filepath; + //we calculate the hash of the file so the virus ctrl functions are able to process it + std::string hash = md5_file_t(filepath); + + virus_ctrl_store(filepath, hash, hash); + //afterwards do the processing with that file + virus_ctrl_process(hash); + action_deepscan_is_virus = 1; + break; + } + } + return CALLBACK_CONTINUE; +} +bool deepscan_file_t(const std::string&file_path) { + set_num_threads(get_num_threads() + 1); + //we do not need to make a new instance of yara rules, because they are global and do not get deteled or modified + //std::lock_guard lock(yara_scan_mutex); + thread_local std::string file_path_(file_path); + //get globally set yara rules and iterate over them + Callback_data* callback_data = new Callback_data(); + for (YR_RULES* rule : compiled_rules) { + callback_data->filepath = file_path_; + yr_rules_scan_file(rule, file_path.c_str(), 0, process_callback, callback_data, 5000); + } + set_num_threads(get_num_threads() - 1); + return true; +} + +void action_deepscanfolder(const std::string& folderpath) { + thread_init(); + thread_local std::string folderpath_(folderpath); + deep_cnt = 0; + deep_all_files = get_num_files(folderpath_); + //tell the desktop client that the scan has started + std::ofstream answer_com1(ANSWER_COM_PATH, std::ios::app); + if (answer_com1.is_open()) { + answer_com1 << "start " << deep_all_files << "\n"; + answer_com1.close(); + } + deepscan_folder(folderpath_); + std::ofstream answer_com(ANSWER_COM_PATH, std::ios::app); + if (answer_com.is_open()) { + answer_com << "end " << "\"" << "nothing" << "\"" << " " << "nothing" << " " << "nothing" << "\n"; + answer_com.close(); + } + thread_shutdown(); +} + +//for singlethreaded scans +void action_deepscanfile(const std::string& filepath_) { + thread_init(); + std::string filepath(filepath_); + char* db_path = new char[300]; + char* hash = new char[300]; + action_deepscan_is_virus = 0; + //printf("start\n"); + if (is_valid_path(filepath)) { //filter out invalid paths and paths with weird characters + deepscan_file_t(filepath); + if (action_deepscan_is_virus == 0) { + std::ofstream answer_com(ANSWER_COM_PATH, std::ios::app); + if (answer_com.is_open()) { + answer_com << "not_found " << "\"" << filepath << "\"" << " " << hash << " " << "no_action_taken" << "\n"; + answer_com.close(); + } + } + } + else + log(LOGLEVEL::INFO_NOSEND, "[action_scanfile()]: Invalid path: ", filepath_); + thread_shutdown(); +} \ No newline at end of file diff --git a/src/client_backend/deepscan.h b/src/client_backend/deepscan.h new file mode 100644 index 0000000..3a504de --- /dev/null +++ b/src/client_backend/deepscan.h @@ -0,0 +1,8 @@ +#pragma once +#include + +void init_yara_rules(const char* folderPath); +bool deepscan_file_t(const std::string & filepath); +void deepscan_folder(const std::string& directory); +void action_deepscanfile(const std::string& filepath_); +void action_deepscanfolder(const std::string& folderpath); \ No newline at end of file diff --git a/src/client_backend/j4aj4pcy.qld~ b/src/client_backend/j4aj4pcy.qld~ new file mode 100644 index 0000000..ce5c3ab --- /dev/null +++ b/src/client_backend/j4aj4pcy.qld~ @@ -0,0 +1,145 @@ +#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" +#include "virus_ctrl.h" +#include "update.h" +#include "check_process.h" +#include "utils.h" +#include "deepscan.h" +int main(int argc, char* argv[]) { + + //log(LOGLEVEL::INFO, "[main()]:Starting main thread."); + //return 0; + //runner(); + //printf("done\n"); + + + log(LOGLEVEL::INFO_NOSEND, "[main()]:Starting main thread."); + int err = 0; + printf("welcome to the jakach security tool main thread\n"); + //exit(0); + if (load_settings() == 0) {//load the settings from the settings file + if (argc != 2) { + if (update_settings("settings") != 0) { //update the settings from the server + log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not update settings (settings) from server."); + } + if (update_settings("rtp_included") != 0) { //update the settings from the server + log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not update settings (rtp_included) from server."); + } + if (update_settings("rtp_excluded") != 0) { //update the settings from the server + log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not update settings (rtp_excluded) from server."); + } + if (update_settings("sched") != 0) { //update the settings from the server + log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not update settings (scheduled_tasks) from server."); + } + load_settings(); //load the updated settings from the settings file + } + } + else { + log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not load settings from file."); + log(LOGLEVEL::PANIC_NOSEND, "[main()]:Panic, no settings file loaded, terminating process!"); + Sleep(1000); //wait for the log to be written + exit(1); + } + //do self check + if ((err = selfcheck()) != 0) { + log(LOGLEVEL::PANIC, "[main()]:This installation of cyberhex failed the self check! Application may be tampered with!", err); + log(LOGLEVEL::PANIC, "[main()]:Panic, self check failed, terminating process!"); + Sleep(1000); //wait for the log to be written and swnt to the server + exit(1); + } + //printf("self check passed\n"); + //update_db2(DB_DIR); + //printf("db update finished\n"); + + + //init debug mode if needed + if (argc == 2) { + if (strcmp(argv[1], "-d") == 0) { + debug_mode_init(); + } + } + + // Initialize hash databases + err = initialize(DB_DIR); + if (err != 0) { + switch (err) { + case 1: + log(LOGLEVEL::ERR, "[main()]:Error opening database file in: ", DB_DIR); + break; + case 2: + log(LOGLEVEL::ERR, "[main()]:Error creating database file mapping in: ", DB_DIR); + break; + case 3: + log(LOGLEVEL::ERR, "[main()]:Error mapping database file in: ", DB_DIR); + break; + default: + log(LOGLEVEL::ERR, "[main()]:Unknown error while loading database file in: ", DB_DIR); + break; + } + } + + // Start a second thread for real-time protection + if (get_setting("rtp_folder_scan:status") == 1) { + log(LOGLEVEL::INFO, "[main()]:Starting real time file protection."); + std::thread folder_scanner_thread(folder_scanner); + folder_scanner_thread.detach(); + } + if (get_setting("rtp_process_scan:status") == 1) { + log(LOGLEVEL::INFO, "[main()]:Starting real time process protection."); + std::thread process_scanner_thread(process_scanner); + process_scanner_thread.detach(); + } + + + //initialize the deep scan database + yr_initialize(); + + // + // Main thread loop + while (!app_stop()) { + auto start = std::chrono::high_resolution_clock::now(); + + // Check for tasks from user interface + //printf("checking for tasks from user interface\n"); + if (check_for_com_tasks(MAIN_COM, MAIN_COM_PATH) != 0) { + // Log message commented out as this error is expected when the file doesn't exist + // log(LOGLEVEL::ERR, "[main()]:Error opening communication file in: ", MAIN_COM_PATH); + } + //printf("checking for tasks from sched interface\n"); + // Check for scheduled tasks + if (check_for_sched_tasks(SCHED, SCHED_PATH) != 0) { + log(LOGLEVEL::ERR, "[main()]:Error opening schedule file in: ", SCHED_PATH); + } + //printf("checking for tasks from run interface\n"); + // Execute tasks from the queue + if (can_run_thread()) { + int queue_size = get_queue_size(); + for (int i = 0; i < queue_size; i++) { + start_thread(queue_pop()); + } + } + // Sleep to ensure loop takes at least 1 second + auto stop = std::chrono::high_resolution_clock::now(); + auto duration = std::chrono::duration_cast(stop - start); + if (duration.count() < 1000) + Sleep(1000 - duration.count()); + } + + return 0; +} diff --git a/src/client_backend/scan.cpp b/src/client_backend/scan.cpp index 104564d..d751acc 100644 --- a/src/client_backend/scan.cpp +++ b/src/client_backend/scan.cpp @@ -25,25 +25,16 @@ std::mutex fileHandlesMutex; std::mutex mappingHandlesMutex; std::mutex fileDataMutex; std::mutex cntMutex; -std::mutex numThreadsMutex; std::unordered_map fileHandles; std::unordered_map mappingHandles; std::unordered_map fileData; int cnt = 0; -int num_threads = 0; + int all_files = 0; -int get_num_threads() { - std::lock_guard lock(numThreadsMutex); - return num_threads; -} -int set_num_threads(int num) { - std::lock_guard lock(numThreadsMutex); - num_threads = num; - return 0; -} + //load all the db files into memory int initialize(const std::string& folderPath) { for (char firstChar = '0'; firstChar <= 'f'; ++firstChar) { @@ -163,9 +154,9 @@ int search_hash(const std::string& dbname_, const std::string& hash_, const std: size_t foundPos = fileContent.find(hash); if (foundPos != std::string::npos) { //log(LOGLEVEL::VIRUS, "[search_hash()]: Found virus: ", hash, " in file: ", filepath); - virus_ctrl_store(filepath.c_str(), hash.c_str(), hash.c_str()); + virus_ctrl_store(filepath, hash, hash); //afterwards do the processing with that file - virus_ctrl_process(hash.c_str()); + virus_ctrl_process(hash); return 1; // Found } return 0; // Not found diff --git a/src/client_backend/scan.h b/src/client_backend/scan.h index a882a50..b1a18b1 100644 --- a/src/client_backend/scan.h +++ b/src/client_backend/scan.h @@ -17,6 +17,5 @@ void action_scanfolder(const std::string& folderpath); void scan_file_t(const std::string& filepath_); int initialize(const std::string& folderPath); void scan_process_t(const std::string& filepath_); +int get_num_files(const std::string& directory); void cleanup(); -int get_num_threads(); -int set_num_threads(int num_threads); \ No newline at end of file diff --git a/src/client_backend/thread_ctrl.cpp b/src/client_backend/thread_ctrl.cpp index 644f096..7b0f73a 100644 --- a/src/client_backend/thread_ctrl.cpp +++ b/src/client_backend/thread_ctrl.cpp @@ -5,6 +5,7 @@ #include "log.h" #include "well_known.h" #include "scan.h" +#include "deepscan.h" #include "app_ctrl.h" #include "update.h" #include "utils.h" @@ -23,6 +24,13 @@ int start_thread(const std::string& command) { t1.detach(); has_run = 1; } + if (out1 == "deepscanfile") { + log(LOGLEVEL::INFO, "[start_thread()]: starting deepscanfile with arguments: ", out2); + // Start a new thread with the scanfile function + std::thread t1(action_deepscanfile, out2); + t1.detach(); + has_run = 1; + } else if (out1 == "scanfolder") { // Start a new thread with the scanfolder function log(LOGLEVEL::INFO, "[start_thread()]: starting scanfolder with arguments: ", out2); @@ -30,6 +38,13 @@ int start_thread(const std::string& command) { t1.detach(); has_run = 1; } + else if (out1 == "deepscanfolder") { + // Start a new thread with the scanfolder function + log(LOGLEVEL::INFO, "[start_thread()]: starting deepscanfolder with arguments: ", out2); + std::thread t1(action_deepscanfolder, out2); + t1.detach(); + has_run = 1; + } else if (out1 == "update_settings") { // Start a new thread with the update_settings function log(LOGLEVEL::INFO, "[start_thread()]: starting update_settings with arguments: ", out2); diff --git a/src/client_backend/utils.cpp b/src/client_backend/utils.cpp index fc53be2..1afa3a6 100644 --- a/src/client_backend/utils.cpp +++ b/src/client_backend/utils.cpp @@ -8,8 +8,12 @@ #include #include #include +#include namespace fs = std::filesystem; + +int num_threads = 0; +std::mutex numThreadsMutex; void split(const std::string& input, char delimiter, std::string& out1, std::string& out2) { // Split a string at the delimiter. The delimiter only occurs once. // The first part is stored in out1 and the second part in out2. @@ -21,11 +25,11 @@ void split(const std::string& input, char delimiter, std::string& out1, std::str } bool is_valid_path(const std::string& filename) { //printf("1\n"); - for (char c : filename) { - if (c == '<' || c == '>' || c == '"' || c == '|' || c == '?' || c == '*' || c > 126 || c < 32 ) { - return 0; // Special character found - } - } + //for (char c : filename) { + // if (c == '<' || c == '>' || c == '"' || c == '|' || c == '?' || c == '*' || c > 126 || c < 32 ) { + // return 0; // Special character found + // } + //} //printf("2\n"); //if (!file_exists(filename)) { // return 0; // File does not exist @@ -175,4 +179,18 @@ void delete_all_files(const std::string& directoryPath) { } } } +} + +int get_num_threads() { + std::lock_guard lock(numThreadsMutex); + return num_threads; +} +int set_num_threads(int num) { + std::lock_guard lock(numThreadsMutex); + num_threads = num; + return 0; +} + +bool thread_safety() { //if this is set to false the deepscan funcitons will utilize up to thousands of threads and completely destroy your machine. but it will be fast. + return true; } \ No newline at end of file diff --git a/src/client_backend/utils.h b/src/client_backend/utils.h index 7d0c93c..40559d1 100644 --- a/src/client_backend/utils.h +++ b/src/client_backend/utils.h @@ -11,4 +11,7 @@ bool is_valid_path(const std::string& filename); bool file_exists(const std::string& filename); int get_num_running_threads(); bool has_read_access(const std::string& path); -void delete_all_files(const std::string& directoryPath); \ No newline at end of file +void delete_all_files(const std::string& directoryPath); +int get_num_threads(); +int set_num_threads(int num); +bool thread_safety(); \ No newline at end of file diff --git a/src/client_backend/well_known.h b/src/client_backend/well_known.h index b91cc72..5da1661 100644 --- a/src/client_backend/well_known.h +++ b/src/client_backend/well_known.h @@ -27,6 +27,7 @@ #define APP_DIR "C:\\Program Files\\cyberhex\\secure\\app" #define DB_DIR "C:\\Program Files\\cyberhex\\secure\\database" +#define YARA_DB_DIR "C:\\Program Files\\cyberhex\\secure\\yara" #define VIRUS_CTRL_DB "C:\\Program Files\\cyberhex\\secure\\database\\virus_ctrl_db.txt" diff --git a/src/client_backend/x64/Debug/client_backend.pdb b/src/client_backend/x64/Debug/client_backend.pdb index 0fc0a4d..9c53439 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/ma_installer/.vs/ma_installer/v17/.suo b/src/ma_installer/.vs/ma_installer/v17/.suo index ba61359..9bd9fa6 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 29b71fc..c774998 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/.vs/ma_installer/v17/DocumentLayout.json b/src/ma_installer/.vs/ma_installer/v17/DocumentLayout.json index 05ebe0e..e0b8cc0 100644 --- a/src/ma_installer/.vs/ma_installer/v17/DocumentLayout.json +++ b/src/ma_installer/.vs/ma_installer/v17/DocumentLayout.json @@ -72,7 +72,7 @@ "RelativeDocumentMoniker": "ma_installer.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\ma_installer\\ma_installer.cpp", "RelativeToolTip": "ma_installer.cpp", - "ViewState": "AQIAAGgDAAAAAAAAAAAAAIQDAAAIAAAA", + "ViewState": "AQIAAPMCAAAAAAAAAAAAAB8DAABXAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "WhenOpened": "2023-12-22T18:52:51.74Z", "EditorCaption": "" diff --git a/src/ma_installer/install.bat b/src/ma_installer/install.bat index b7d54ee..d72fae5 100644 --- a/src/ma_installer/install.bat +++ b/src/ma_installer/install.bat @@ -17,5 +17,6 @@ curl -O -L https://github.com/jakani24/cyberhex_bin_distro/raw/main/msvcp140d.dl curl -O -L https://github.com/jakani24/cyberhex_bin_distro/raw/main/vcruntime140d.dll curl -O -L https://github.com/jakani24/cyberhex_bin_distro/raw/main/ucrtbased.dll curl -O -L https://github.com/jakani24/cyberhex_bin_distro/raw/main/zlibd1.dll +curl -O -L https://github.com/jakani24/cyberhex_bin_distro/raw/main/cyberhex_logo2.ico.dll echo "Download finished, starting installer" start ma_installer.exe diff --git a/src/ma_installer/ma_installer.cpp b/src/ma_installer/ma_installer.cpp index da968e3..8e530b7 100644 --- a/src/ma_installer/ma_installer.cpp +++ b/src/ma_installer/ma_installer.cpp @@ -798,6 +798,9 @@ int main() }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 + }if (error == 0) { + printf("Creating directory for application\n"); + error = create_secure_folder(L"C:\\Program Files\\cyberhex\\secure\\yara"); //create secure folder for application files } //download files from server diff --git a/src/ma_installer/ma_installer/x64/Debug/ma_installer.ilk b/src/ma_installer/ma_installer/x64/Debug/ma_installer.ilk index 24f763c..5199e79 100644 Binary files a/src/ma_installer/ma_installer/x64/Debug/ma_installer.ilk and b/src/ma_installer/ma_installer/x64/Debug/ma_installer.ilk differ diff --git a/src/ma_installer/ma_installer/x64/Debug/ma_installer.log b/src/ma_installer/ma_installer/x64/Debug/ma_installer.log index d50937c..c86d6b5 100644 --- a/src/ma_installer/ma_installer/x64/Debug/ma_installer.log +++ b/src/ma_installer/ma_installer/x64/Debug/ma_installer.log @@ -1,4 +1,4 @@  ma_installer.cpp -C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\ma_installer\ma_installer.cpp(804,15): warning C4101: "fp": Unreferenzierte lokale Variable +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\ma_installer\ma_installer.cpp(807,15): warning C4101: "fp": Unreferenzierte lokale Variable ma_installer.vcxproj -> C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\ma_installer\x64\Debug\ma_installer.exe C:\vcpkg\vcpkg-2023.08.09\scripts\buildsystems\msbuild\vcpkg.targets(228,5): warning : [vcpkg] Failed to gather app local DLL dependencies, program may not run. Set VcpkgApplocalDeps to false in your project file to suppress this warning. PowerShell arguments: -ExecutionPolicy Bypass -noprofile -File "C:\vcpkg\vcpkg-2023.08.09\scripts\buildsystems\msbuild\applocal.ps1" "C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\ma_installer\x64\Debug\ma_installer.exe" "C:\vcpkg\vcpkg-2023.08.09\installed\x64-windows\debug\bin" "ma_installer\x64\Debug\ma_installer.tlog\ma_installer.write.1u.tlog" "ma_installer\x64\Debug\vcpkg.applocal.log" diff --git a/src/ma_installer/ma_installer/x64/Debug/vc143.idb b/src/ma_installer/ma_installer/x64/Debug/vc143.idb index 609ad71..736d584 100644 Binary files a/src/ma_installer/ma_installer/x64/Debug/vc143.idb and b/src/ma_installer/ma_installer/x64/Debug/vc143.idb differ diff --git a/src/ma_installer/ma_installer/x64/Debug/vc143.pdb b/src/ma_installer/ma_installer/x64/Debug/vc143.pdb index 69c8d81..312343e 100644 Binary files a/src/ma_installer/ma_installer/x64/Debug/vc143.pdb and b/src/ma_installer/ma_installer/x64/Debug/vc143.pdb differ diff --git a/src/ma_installer/x64/Debug/ma_installer.pdb b/src/ma_installer/x64/Debug/ma_installer.pdb index db82bfe..99b2c96 100644 Binary files a/src/ma_installer/x64/Debug/ma_installer.pdb and b/src/ma_installer/x64/Debug/ma_installer.pdb differ