trying to debug the buffer overflow which sometimes happens

This commit is contained in:
jakani24
2024-03-11 20:04:18 +01:00
parent cd0c707291
commit 7b54ae3a23
22 changed files with 340 additions and 106 deletions

View File

@@ -2,14 +2,6 @@
"Version": 1,
"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\\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\\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.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}"
@@ -19,21 +11,57 @@
"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\\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}"
"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\\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\\check_process.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:check_process.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\\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\\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\\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}"
},
{
"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_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_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\\md5hash.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:md5hash.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.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\\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}"
},
{
"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}"
@@ -46,38 +74,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.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:settings.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\\md5hash.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:md5hash.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.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:check_process.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}"
},
{
"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\\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\\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\\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}"
@@ -90,11 +90,11 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 10,
"SelectedChildIndex": 13,
"Children": [
{
"$type": "Document",
"DocumentIndex": 4,
"DocumentIndex": 14,
"Title": "virus_ctrl.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.h",
"RelativeDocumentMoniker": "virus_ctrl.h",
@@ -102,12 +102,11 @@
"RelativeToolTip": "virus_ctrl.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAkAAAATAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-11T12:26:05.127Z",
"EditorCaption": ""
"WhenOpened": "2024-03-11T12:26:05.127Z"
},
{
"$type": "Document",
"DocumentIndex": 13,
"DocumentIndex": 4,
"Title": "check_process.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_process.h",
"RelativeDocumentMoniker": "check_process.h",
@@ -115,24 +114,25 @@
"RelativeToolTip": "check_process.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAYAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-10T14:40:13.284Z"
"WhenOpened": "2024-03-10T14:40:13.284Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 5,
"DocumentIndex": 3,
"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": "AQIAAAYAAAAAAAAAAAAAADQAAAAcAAAA",
"ViewState": "AQIAAAYAAAAAAAAAAAAAADQAAAAtAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-03-10T14:40:03.094Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 12,
"DocumentIndex": 11,
"Title": "md5hash.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\md5hash.cpp",
"RelativeDocumentMoniker": "md5hash.cpp",
@@ -140,11 +140,12 @@
"RelativeToolTip": "md5hash.cpp",
"ViewState": "AQIAAAAAAAAAAAAAAAAAACwAAAAnAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-03-09T19:22:09.647Z"
"WhenOpened": "2024-03-09T19:22:09.647Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 10,
"DocumentIndex": 17,
"Title": "settings.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\settings.h",
"RelativeDocumentMoniker": "settings.h",
@@ -156,7 +157,7 @@
},
{
"$type": "Document",
"DocumentIndex": 16,
"DocumentIndex": 18,
"Title": "connect.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.h",
"RelativeDocumentMoniker": "connect.h",
@@ -168,20 +169,20 @@
},
{
"$type": "Document",
"DocumentIndex": 6,
"DocumentIndex": 10,
"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": "AQIAABUAAAAAAAAAAAAAABwAAABSAAAA",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAB8AAAAnAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-02-25T13:36:05.414Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 8,
"DocumentIndex": 15,
"Title": "log.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\log.h",
"RelativeDocumentMoniker": "log.h",
@@ -193,7 +194,7 @@
},
{
"$type": "Document",
"DocumentIndex": 9,
"DocumentIndex": 16,
"Title": "log.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\log.cpp",
"RelativeDocumentMoniker": "log.cpp",
@@ -205,100 +206,103 @@
},
{
"$type": "Document",
"DocumentIndex": 14,
"DocumentIndex": 8,
"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": "AQIAAAAAAAAAAAAAAAAAAAQAAAAXAAAA",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAcAAAAeAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.217Z"
"WhenOpened": "2024-01-28T20:40:06.217Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"DocumentIndex": 5,
"Title": "settings.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\settings.cpp",
"RelativeDocumentMoniker": "settings.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\settings.cpp",
"RelativeToolTip": "settings.cpp",
"ViewState": "AQIAACQAAAAAAAAAAAAAAFAAAABPAAAA",
"ViewState": "AQIAALIAAAAAAAAAAAAkwNUAAAACAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.264Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 7,
"DocumentIndex": 13,
"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": "AQIAABUAAAAAAAAAAAAAADoAAAAqAAAA",
"ViewState": "AQIAABgAAAAAAAAAAAAAADUAAAAoAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.264Z",
"EditorCaption": ""
"WhenOpened": "2024-01-28T20:40:06.264Z"
},
{
"$type": "Document",
"DocumentIndex": 11,
"DocumentIndex": 6,
"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": "AQIAACQAAAAAAAAAAAAAAEUAAAA1AAAA",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABkAAABBAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.279Z"
"WhenOpened": "2024-01-28T20:40:06.279Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"DocumentIndex": 0,
"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": "AQIAALEAAAAAAAAAAAAkwNsAAAAVAAAA",
"ViewState": "AQIAAKwAAAAAAAAAAAAkwN8AAAArAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.248Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 17,
"DocumentIndex": 12,
"Title": "update.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.cpp",
"RelativeDocumentMoniker": "update.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.cpp",
"RelativeToolTip": "update.cpp",
"ViewState": "AQIAABMAAAAAAAAAAAAkwEQAAABzAAAA",
"ViewState": "AQIAACwAAAAAAAAAAAAkwFIAAAAWAAAA",
"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": 18,
"DocumentIndex": 9,
"Title": "local_schedule.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_schedule.cpp",
"RelativeDocumentMoniker": "local_schedule.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_schedule.cpp",
"RelativeToolTip": "local_schedule.cpp",
"ViewState": "AQIAAEgAAAAAAAAAAAAAAFoAAAAKAAAA",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAFcAAAAvAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.279Z"
"WhenOpened": "2024-01-28T20:40:06.279Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"DocumentIndex": 1,
"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": "AQIAAAAAAAAAAAAAAAAAABIAAAAEAAAA",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABIAAAAyAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-01-28T20:40:06.295Z",
"EditorCaption": ""
@@ -317,25 +321,26 @@
},
{
"$type": "Document",
"DocumentIndex": 15,
"DocumentIndex": 7,
"Title": "connect.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.cpp",
"RelativeDocumentMoniker": "connect.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.cpp",
"RelativeToolTip": "connect.cpp",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABkAAAADAAAA",
"ViewState": "AQIAABIAAAAAAAAAAAAAAG0AAAAbAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.315Z"
"WhenOpened": "2024-01-28T20:40:06.315Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"DocumentIndex": 2,
"Title": "virus_ctrl.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.cpp",
"RelativeDocumentMoniker": "virus_ctrl.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.cpp",
"RelativeToolTip": "virus_ctrl.cpp",
"ViewState": "AQIAAGYAAAAAAAAAAAAAAI4AAAAHAAAA",
"ViewState": "AQIAAHsAAAAAAAAAAAAAAJMAAAAkAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-02-18T12:49:41.861Z",
"EditorCaption": ""

View File

@@ -28,7 +28,7 @@ void process_changes(const FILE_NOTIFY_INFORMATION* pInfo) {
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_included(filename_str.c_str()) or is_directory(filename_str.c_str()) or is_folder_excluded(filename_str.c_str())) {
if (!is_folder_included(filename_str.c_str()) or is_directory(filename_str) or is_folder_excluded(filename_str.c_str())) {
//dont scan excluded files or folders
return;
}

View File

@@ -17,6 +17,7 @@ void monitor_processes() {
DWORD numProcesses = bytesReturned / sizeof(DWORD);
// Check for new processes
//log(LOGLEVEL::INFO_NOSEND, "[monitor_processes()]: Checking for new processes; having ",numProcesses, " currently running");
for (DWORD i = 0; i < numProcesses; ++i) {
DWORD processId = processIds[i];
BOOL isNewProcess = TRUE;
@@ -35,14 +36,14 @@ void monitor_processes() {
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processId);
if (hProcess != NULL) {
// Get the full path of the executable
TCHAR exePath[MAX_PATH];
char path[MAX_PATH+1];
if (GetModuleFileNameEx(hProcess, NULL, exePath, MAX_PATH) > 0) {
TCHAR exePath[500];
char path[500+1];
if (GetModuleFileNameEx(hProcess, NULL, exePath, 500) > 0) {
// Print the full path of the executable
strcpy_s(path, MAX_PATH, exePath);
strcpy_s(path, 500, exePath);
//convert to lower case
for(int i=0;i<strlen(path);i++)
path[i] = tolower(path[i]);
for(int z=0;z<strlen(path);z++)
path[z] = tolower(path[z]);
//scan the file
if (!is_folder_included(path) or is_folder_excluded(path)) {
//dont scan excluded files or folders

View File

@@ -0,0 +1,76 @@
#include "check_process.h"
#include "log.h"
#include "well_known.h"
#include "scan.h"
#include "app_ctrl.h"
#include "settings.h"
#include "scan.h"
void monitor_processes() {
static DWORD previousProcessIds[1024] = { 0 }; // Previous snapshot of process IDs
DWORD processIds[1024];
DWORD bytesReturned;
// Get the list of process IDs
if (EnumProcesses(processIds, sizeof(processIds), &bytesReturned)) {
// Calculate how many process IDs were returned
DWORD numProcesses = bytesReturned / sizeof(DWORD);
// Check for new processes
log(LOGLEVEL::INFO_NOSEND, "[monitor_processes()]: Checking for new processes; having ",numProcesses, " currently running");
for (DWORD i = 0; i < numProcesses; ++i) {
DWORD processId = processIds[i];
BOOL isNewProcess = TRUE;
// Check if the process is new
for (DWORD j = 0; j < 1024; ++j) {
if (processId == previousProcessIds[j]) {
isNewProcess = FALSE;
break;
}
}
// If the process is new, get its executable path and print it
if (isNewProcess) {
// Open the process
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processId);
if (hProcess != NULL) {
// Get the full path of the executable
TCHAR exePath[MAX_PATH];
char path[MAX_PATH+1];
if (GetModuleFileNameEx(hProcess, NULL, exePath, MAX_PATH) > 0) {
// Print the full path of the executable
strcpy_s(path, MAX_PATH, exePath);
//convert to lower case
for(int z=0;z<strlen(path);z++)
path[z] = tolower(path[z]);
//scan the file
if (!is_folder_included(path) or is_folder_excluded(path)) {
//dont scan excluded files or folders
}
else {
//log(LOGLEVEL::INFO, "[monitor_processes()]: New Process to scan: ", path, " while monitoring processes");
std::thread scan_thread(scan_process_t, path);
scan_thread.detach();
}
}
// Close the process handle
CloseHandle(hProcess);
}
}
}
// Update the previous snapshot of process IDs
memcpy(previousProcessIds, processIds, sizeof(DWORD) * 1024);
}
else {
log(LOGLEVEL::ERR, "[monitor_processes()]: Error enumerating processes");
}
}
void process_scanner() {
//we are in a thread so we can do this, unlimited resources wuhuiii
while (!app_stop()) {
monitor_processes();
Sleep(1000); // Sleep for 1 second
}
}

View File

@@ -0,0 +1,116 @@
#pragma warning(disable:4996)
#include <iostream>
#include <thread>
#include <curl/curl.h>
#include <openssl/md5.h>
//#include <yara.h>
#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"
int main() {
//log(LOGLEVEL::INFO, "[main()]:Starting main thread.");
//return 0;
log(LOGLEVEL::INFO_NOSEND, "[main()]:Starting main thread.");
int err = 0;
printf("welcome to the jakach security tool main thread\n");
if (load_settings() == 0) {//load the settings from the settings file
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!");
exit(1);
}
// 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();
}
// Main thread loop
while (!app_stop()) {
auto start = std::chrono::high_resolution_clock::now();
// Check for tasks from user interface
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);
}
// Check for scheduled tasks
if (check_for_sched_tasks(SCHED, SCHED_PATH) != 0) {
log(LOGLEVEL::ERR, "[main()]:Error opening schedule file in: ", SCHED_PATH);
}
// Execute tasks from the queue
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);
start_thread(queue_entry);
delete[] queue_entry;
}
}
// Sleep to ensure loop takes at least 1 second
auto stop = std::chrono::high_resolution_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(stop - start);
if (duration.count() < 1000)
Sleep(1000 - duration.count());
}
return 0;
}

View File

@@ -42,6 +42,5 @@ C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend.
C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\client_backend.cpp(112,24): warning C4244: ]
scan.cpp
thread_ctrl.cpp
virus_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

View File

@@ -87,6 +87,8 @@ int download_file_from_srv(const char* url, const char* output_file_path, bool i
output_file = fopen(temp_path, "wb");
if (!output_file) {
curl_easy_cleanup(curl);
delete [] temp_path;
delete[] buf;
return 2;
}
@@ -99,29 +101,40 @@ int download_file_from_srv(const char* url, const char* output_file_path, bool i
// Perform the download
res = curl_easy_perform(curl);
if (res != CURLE_OK) {
fclose(output_file);
delete[] temp_path;
delete[] buf;
return 3;
}
// Cleanup and close the file
curl_easy_cleanup(curl);
fclose(output_file);
if ((output_file = fopen(temp_path, "r")) == 0) {
delete[] temp_path;
delete[] buf;
return 4;
}
else {
fscanf(output_file, "%500s", buf);
if (strcmp(buf, "no_auth") == 0) {
fclose(output_file);
delete[] temp_path;
delete[] buf;
return 5;
}
else if(check_cert(buf, SECRETS)==0){
remove(output_file_path);//remove old file, so it can be overwritten
fclose(output_file);
if (rename(temp_path, output_file_path)!=0) {
delete[] temp_path;
delete[] buf;
return 6;
}
}else {
fclose(output_file);
return 7;
delete[] temp_path;
delete[] buf;
return 7;
}
}
delete[] buf;
@@ -194,5 +207,6 @@ int upload_to_srv(const char* url, const char* filepath,bool ignore_insecure) {
return 1;
}
}
return 2;
}
#endif

View File

@@ -178,6 +178,7 @@ void action_scanfile(const char*filepath) {
//log(LOGLEVEL::INFO, "[action_scanfile_t()]: Scanning file: ", filepath);
if (strlen(filepath) == 0 or strcmp("", filepath) == 0 or file_exists(filepath) == false) {
thread_shutdown();
delete[] db_path;
return; //no filepath given or file not accessible
}
else {
@@ -209,20 +210,21 @@ void scan_file_t(const std::string& filepath_) {
search_hash(db_path, hash, filepath);
num_threads--;
}
void scan_process_t(const char* filepath) {
char* db_path = new char[300];
char* hash = new char[300];
strcpy_s(hash, 295, md5_file_t(filepath).c_str());
sprintf_s(db_path, 295, "%s\\%c%c.jdbf", DB_DIR, hash[0], hash[1]);
if (search_hash(db_path, hash, filepath)==1) {
void scan_process_t(const std::string& filepath_) {
num_threads++;
thread_local const std::string filepath(filepath_);
thread_local char* db_path = new char[300];
thread_local char* hash = new char[300];
strcpy_s(hash, 295, md5_file_t(filepath).c_str());
sprintf_s(db_path, 295, "%s\\%c%c.jdbf", DB_DIR, hash[0], hash[1]);
if (search_hash(db_path, hash, filepath) == 1) {
//check if need to kill process
if (get_setting("virus_ctrl:virus_process_found:kill") == 1) {
//kill the process
log(LOGLEVEL::VIRUS, "[scan_process_t()]: Killing process: ", filepath);
kill_process(filepath);
}
//kill the process
kill_process(filepath.c_str());
log(LOGLEVEL::VIRUS, "[scan_process_t()]: Killing process: ", filepath);
}
}
delete[] db_path;
delete[] hash;
num_threads--;
}
#endif

View File

@@ -16,5 +16,5 @@ void action_scanfolder(const char* folderpath);
//void action_scanfile_t(const char* filepath);
void scan_file_t(const std::string& filepath_);
int initialize(const std::string& folderPath);
void scan_process_t(const char* filepath);
void scan_process_t(const std::string& filepath_);
void cleanup();

View File

@@ -124,6 +124,27 @@ int virus_ctrl_process( const char* id) {
delete[] db_path;
return 0;
}
const char* get_filename(const char* path) {
const char* fileName = strrchr(path, '\\');
if (fileName == NULL) {
// No directory separator found, return the original path
return path;
}
else {
// Return the substring after the last directory separator
return fileName + 1;
}
}
int strcasecmp(const char* s1, const char* s2) {
while (*s1 && *s2) {
int diff = tolower(*s1) - tolower(*s2);
if (diff != 0)
return diff;
s1++;
s2++;
}
return 0;
}
void kill_process(const char*path) {
HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, NULL);
PROCESSENTRY32 pEntry;
@@ -131,7 +152,7 @@ void kill_process(const char*path) {
BOOL hRes = Process32First(hSnapShot, &pEntry);
while (hRes)
{
if (strcmp(pEntry.szExeFile, path) == 0)
if (strcasecmp(pEntry.szExeFile, get_filename(path)) == 0)
{
HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, 0,
(DWORD)pEntry.th32ProcessID);