fixing bugs, changing some code from char arrays to c++ std::string

This commit is contained in:
jakani24
2024-03-13 19:10:31 +01:00
parent 717c7956f5
commit 41e0889a6e
38 changed files with 1242 additions and 1038 deletions

View File

@@ -2,77 +2,77 @@
"Version": 1, "Version": 1,
"WorkspaceRootPath": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\", "WorkspaceRootPath": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\",
"Documents": [ "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\\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_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_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}" "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\\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\\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\\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}" "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\\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\\connect.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}" "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_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\\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\\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\\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\\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\\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\\log.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:log.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\\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\\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}"
},
{
"AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\permissions.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:permissions.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}", "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}" "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\\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\\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\\queue _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\\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}" "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:queue _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\\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_schedule.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}" "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\\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\\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\\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\\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\\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\\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\\update.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:update.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}"
} }
], ],
"DocumentGroupContainers": [ "DocumentGroupContainers": [
@@ -82,79 +82,45 @@
"DocumentGroups": [ "DocumentGroups": [
{ {
"DockedWidth": 200, "DockedWidth": 200,
"SelectedChildIndex": 17, "SelectedChildIndex": 0,
"Children": [ "Children": [
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 11, "DocumentIndex": 0,
"Title": "security.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\security.cpp",
"RelativeDocumentMoniker": "security.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\security.cpp",
"RelativeToolTip": "security.cpp",
"ViewState": "AQIAABsAAAAAAAAAAAAAADoAAAA2AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-03-12T10:18:22.033Z"
},
{
"$type": "Document",
"DocumentIndex": 14,
"Title": "permissions.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\permissions.cpp",
"RelativeDocumentMoniker": "permissions.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\permissions.cpp",
"RelativeToolTip": "permissions.cpp",
"ViewState": "AQIAAAQAAAAAAAAAAAAIwDsAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-03-12T10:18:17.369Z"
},
{
"$type": "Document",
"DocumentIndex": 13,
"Title": "app_ctrl.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\app_ctrl.cpp",
"RelativeDocumentMoniker": "app_ctrl.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\app_ctrl.cpp",
"RelativeToolTip": "app_ctrl.cpp",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAwAAAAPAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-03-12T10:10:59.685Z"
},
{
"$type": "Document",
"DocumentIndex": 12,
"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": "AQIAAAAAAAAAAAAAAAAAAAYAAAARAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-03-10T14:40:03.094Z"
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "md5hash.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\md5hash.cpp",
"RelativeDocumentMoniker": "md5hash.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\md5hash.cpp",
"RelativeToolTip": "md5hash.cpp",
"ViewState": "AQIAACQAAAAAAAAAAAAAADUAAAA1AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-03-09T19:22:09.647Z"
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "check_dir.cpp", "Title": "check_dir.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_dir.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_dir.cpp",
"RelativeDocumentMoniker": "check_dir.cpp", "RelativeDocumentMoniker": "check_dir.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_dir.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_dir.cpp",
"RelativeToolTip": "check_dir.cpp", "RelativeToolTip": "check_dir.cpp",
"ViewState": "AQIAAAQAAAAAAAAAAAAIwAkAAAARAAAA", "ViewState": "AQIAAEsAAAAAAAAAAAAAAHkAAAAwAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-02-25T13:36:05.414Z", "WhenOpened": "2024-03-13T06:48:31.009Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 9,
"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": "AQIAAAAAAAAAAAAAAAAAABgAAABuAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-03-13T06:52:01.533Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 16,
"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",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:49:41.823Z",
"EditorCaption": "" "EditorCaption": ""
}, },
{ {
@@ -165,69 +131,127 @@
"RelativeDocumentMoniker": "log.h", "RelativeDocumentMoniker": "log.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\log.h", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\log.h",
"RelativeToolTip": "log.h", "RelativeToolTip": "log.h",
"ViewState": "AQIAAFMAAAAAAAAAAAAkwFsAAAAjAAAA", "ViewState": "AQIAAE8AAAAAAAAAAAD4v2YAAAARAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-02-25T09:02:55.874Z" "WhenOpened": "2024-03-13T06:47:02.038Z",
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 10, "DocumentIndex": 17,
"Title": "log.cpp", "Title": "virus_ctrl.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\log.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.h",
"RelativeDocumentMoniker": "log.cpp", "RelativeDocumentMoniker": "virus_ctrl.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\log.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.h",
"RelativeToolTip": "log.cpp", "RelativeToolTip": "virus_ctrl.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAB8AAAAFAAAA", "ViewState": "AQIAAAAAAAAAAAAAAAAAABAAAAAuAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:45:51.845Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 13,
"Title": "connect.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.h",
"RelativeDocumentMoniker": "connect.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.h",
"RelativeToolTip": "connect.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAA4AAABZAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:44:13.879Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 12,
"Title": "queue_ctrl.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\queue_ctrl.h",
"RelativeDocumentMoniker": "queue_ctrl.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\queue_ctrl.h",
"RelativeToolTip": "queue_ctrl.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAUAAAAYAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:43:48.22Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 7,
"Title": "queue _ctrl.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\queue _ctrl.cpp",
"RelativeDocumentMoniker": "queue _ctrl.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\queue _ctrl.cpp",
"RelativeToolTip": "queue _ctrl.cpp",
"ViewState": "AQIAAAAAAAAAAAAAAAAAACAAAAArAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-02-25T09:08:59.07Z" "WhenOpened": "2024-01-28T20:40:06.295Z",
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 9, "DocumentIndex": 15,
"Title": "local_com.cpp", "Title": "update.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.h",
"RelativeDocumentMoniker": "local_com.cpp", "RelativeDocumentMoniker": "update.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.h",
"RelativeToolTip": "local_com.cpp", "RelativeToolTip": "update.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAADYAAAAYAAAA", "ViewState": "AQIAAAAAAAAAAAAAAAAAAAgAAAAXAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-01-28T20:40:06.217Z" "WhenOpened": "2024-03-13T06:42:28.196Z",
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 8, "DocumentIndex": 6,
"Title": "settings.cpp", "Title": "settings.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\settings.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\settings.cpp",
"RelativeDocumentMoniker": "settings.cpp", "RelativeDocumentMoniker": "settings.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\settings.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\settings.cpp",
"RelativeToolTip": "settings.cpp", "RelativeToolTip": "settings.cpp",
"ViewState": "AQIAAMwAAAAAAAAAAAAIwAMBAAAAAAAA", "ViewState": "AQIAAAAAAAAAAAAAAAAAAD0AAAA1AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.264Z" "WhenOpened": "2024-03-13T06:48:40.364Z",
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 6, "DocumentIndex": 10,
"Title": "thread_ctrl.cpp", "Title": "settings.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\thread_ctrl.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\settings.h",
"RelativeDocumentMoniker": "thread_ctrl.cpp", "RelativeDocumentMoniker": "settings.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\thread_ctrl.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\settings.h",
"RelativeToolTip": "thread_ctrl.cpp", "RelativeToolTip": "settings.h",
"ViewState": "AQIAABUAAAAAAAAAAAAAADMAAAAFAAAA", "ViewState": "AQIAAAAAAAAAAAAAAAAAABEAAAAiAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-01-28T20:40:06.264Z" "WhenOpened": "2024-03-13T06:42:03.328Z",
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 7, "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": "AQIAAAAAAAAAAAAAAAAAAAwAAAAvAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:41:43.701Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 14,
"Title": "scan.cpp", "Title": "scan.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.cpp",
"RelativeDocumentMoniker": "scan.cpp", "RelativeDocumentMoniker": "scan.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.cpp",
"RelativeToolTip": "scan.cpp", "RelativeToolTip": "scan.cpp",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAKEAAAAAAAAA", "ViewState": "AQIAANQAAAAAAAAAAAAkwPAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.248Z" "WhenOpened": "2024-01-28T20:40:06.248Z",
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
@@ -237,67 +261,59 @@
"RelativeDocumentMoniker": "client_backend.cpp", "RelativeDocumentMoniker": "client_backend.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\client_backend.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\client_backend.cpp",
"RelativeToolTip": "client_backend.cpp", "RelativeToolTip": "client_backend.cpp",
"ViewState": "AQIAADMAAAAAAAAAAAAAAFsAAAAhAAAA", "ViewState": "AQIAAC0AAAAAAAAAAAAAADwAAAAoAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.279Z" "WhenOpened": "2024-01-28T20:40:06.279Z",
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 15, "DocumentIndex": 4,
"Title": "update.cpp", "Title": "update.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.cpp",
"RelativeDocumentMoniker": "update.cpp", "RelativeDocumentMoniker": "update.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.cpp",
"RelativeToolTip": "update.cpp", "RelativeToolTip": "update.cpp",
"ViewState": "AQIAACwAAAAAAAAAAAAkwFIAAAAWAAAA", "ViewState": "AQIAABAAAAAAAAAAAAAkwDcAAAAkAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.248Z" "WhenOpened": "2024-01-28T20:40:06.248Z",
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 4, "DocumentIndex": 8,
"Title": "local_schedule.cpp", "Title": "local_schedule.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_schedule.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_schedule.cpp",
"RelativeDocumentMoniker": "local_schedule.cpp", "RelativeDocumentMoniker": "local_schedule.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_schedule.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_schedule.cpp",
"RelativeToolTip": "local_schedule.cpp", "RelativeToolTip": "local_schedule.cpp",
"ViewState": "AQIAAGYAAAAAAAAAAAAAAJoAAAAaAAAA", "ViewState": "AQIAAFUAAAAAAAAAAAAkwIYAAAAiAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.279Z" "WhenOpened": "2024-01-28T20:40:06.279Z",
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 16, "DocumentIndex": 3,
"Title": "queue _ctrl.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\queue _ctrl.cpp",
"RelativeDocumentMoniker": "queue _ctrl.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\queue _ctrl.cpp",
"RelativeToolTip": "queue _ctrl.cpp",
"ViewState": "AQIAAAAAAAAAAAAAAAAAACsAAAABAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.295Z"
},
{
"$type": "Document",
"DocumentIndex": 17,
"Title": "connect.cpp", "Title": "connect.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.cpp",
"RelativeDocumentMoniker": "connect.cpp", "RelativeDocumentMoniker": "connect.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.cpp",
"RelativeToolTip": "connect.cpp", "RelativeToolTip": "connect.cpp",
"ViewState": "AQIAABQAAAAAAAAAAAAkwEAAAAAVAAAA", "ViewState": "AQIAAD4AAAAAAAAAAAAkwE8AAAAQAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.315Z" "WhenOpened": "2024-01-28T20:40:06.315Z",
"EditorCaption": ""
}, },
{ {
"$type": "Document", "$type": "Document",
"DocumentIndex": 0, "DocumentIndex": 1,
"Title": "virus_ctrl.cpp", "Title": "virus_ctrl.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.cpp",
"RelativeDocumentMoniker": "virus_ctrl.cpp", "RelativeDocumentMoniker": "virus_ctrl.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.cpp",
"RelativeToolTip": "virus_ctrl.cpp", "RelativeToolTip": "virus_ctrl.cpp",
"ViewState": "AQIAAFEAAAAAAAAAAAAIwGgAAAAmAAAA", "ViewState": "AQIAAEMAAAAAAAAAAAD4v2sAAAAaAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-02-18T12:49:41.861Z", "WhenOpened": "2024-02-18T12:49:41.861Z",
"EditorCaption": "" "EditorCaption": ""

View File

@@ -0,0 +1,326 @@
{
"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\\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\\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\\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\\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\\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\\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\\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}"
},
{
"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\\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\\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\\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\\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\\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\\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\\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\\update.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:update.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}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 17,
"Children": [
{
"$type": "Document",
"DocumentIndex": 8,
"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": "AQIAAAAAAAAAAAAAAAAAABgAAABuAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-03-13T06:52:01.533Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 16,
"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",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:49:41.823Z",
"EditorCaption": ""
},
{
"$type": "Document",
"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": "AQIAAAwAAAAAAAAAAAAAACwAAAAKAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-03-13T06:48:31.009Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"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": "AQIAAE8AAAAAAAAAAAD4v2YAAAARAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:47:02.038Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 17,
"Title": "virus_ctrl.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.h",
"RelativeDocumentMoniker": "virus_ctrl.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.h",
"RelativeToolTip": "virus_ctrl.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABAAAAAuAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:45:51.845Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 13,
"Title": "connect.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.h",
"RelativeDocumentMoniker": "connect.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.h",
"RelativeToolTip": "connect.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAA4AAABZAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:44:13.879Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 12,
"Title": "queue_ctrl.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\queue_ctrl.h",
"RelativeDocumentMoniker": "queue_ctrl.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\queue_ctrl.h",
"RelativeToolTip": "queue_ctrl.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAUAAAAYAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:43:48.22Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 6,
"Title": "queue _ctrl.cpp",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\queue _ctrl.cpp",
"RelativeDocumentMoniker": "queue _ctrl.cpp",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\queue _ctrl.cpp",
"RelativeToolTip": "queue _ctrl.cpp",
"ViewState": "AQIAAAAAAAAAAAAAAAAAACAAAAArAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.295Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 15,
"Title": "update.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.h",
"RelativeDocumentMoniker": "update.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.h",
"RelativeToolTip": "update.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAgAAAAXAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:42:28.196Z",
"EditorCaption": ""
},
{
"$type": "Document",
"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": "AQIAAAAAAAAAAAAAAAAAAD0AAAA1AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-03-13T06:48:40.364Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 9,
"Title": "settings.h",
"DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\settings.h",
"RelativeDocumentMoniker": "settings.h",
"ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\settings.h",
"RelativeToolTip": "settings.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABEAAAAiAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:42:03.328Z",
"EditorCaption": ""
},
{
"$type": "Document",
"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": "AQIAAAAAAAAAAAAAAAAAAAwAAAAvAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-13T06:41:43.701Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 14,
"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": "AQIAANQAAAAAAAAAAAAkwPAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.248Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"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": "AQIAAC0AAAAAAAAAAAAAADwAAAAoAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.279Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"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": "AQIAABAAAAAAAAAAAAAkwDcAAAAkAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.248Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 7,
"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": "AQIAAFUAAAAAAAAAAAAkwIYAAAAiAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.279Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"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": "AQIAAD4AAAAAAAAAAAAkwE8AAAAQAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-01-28T20:40:06.315Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"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": "AQIAAEAAAAAAAAAAAAD4v2YAAAA8AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
"WhenOpened": "2024-02-18T12:49:41.861Z",
"EditorCaption": ""
}
]
}
]
}
]
}

View File

@@ -7,9 +7,11 @@
#include "scan.h" #include "scan.h"
#include "app_ctrl.h" #include "app_ctrl.h"
#include "virus_ctrl.h" #include "virus_ctrl.h"
#include "scan.h"
#include "settings.h" #include "settings.h"
#include <mutex> // Include the mutex header #include <mutex> // Include the mutex header
#include <algorithm> // Include the algorithm header
#include <string> // Include the string header
#include <iostream> // Include the iostream header
// Define a mutex for thread synchronization // Define a mutex for thread synchronization
std::mutex monitorMutex; std::mutex monitorMutex;
@@ -117,7 +119,7 @@ void monitor_directory(LPCSTR directory) {
buffer, buffer,
bufferSize, bufferSize,
TRUE, TRUE,
FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_LAST_WRITE |FILE_NOTIFY_CHANGE_CREATION|FILE_NOTIFY_CHANGE_SIZE, FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_CREATION,
NULL, NULL,
&overlapped, &overlapped,
NULL) == 0) { NULL) == 0) {

View File

@@ -6,6 +6,8 @@
#include "settings.h" #include "settings.h"
#include "scan.h" #include "scan.h"
#include <mutex> // Include the mutex header #include <mutex> // Include the mutex header
#include <thread> // Include the thread header
#include <Windows.h> // Include the Windows header
std::mutex mtx; // Declare a mutex for thread synchronization std::mutex mtx; // Declare a mutex for thread synchronization
@@ -44,7 +46,7 @@ void monitor_processes() {
char path[MAX_PATH]; char path[MAX_PATH];
if (GetModuleFileNameEx(hProcess, NULL, exePath, MAX_PATH) > 0) { if (GetModuleFileNameEx(hProcess, NULL, exePath, MAX_PATH) > 0) {
strcpy_s(path, MAX_PATH, exePath); strcpy_s(path, MAX_PATH, exePath);
for (int z = 0; z < strlen(path); z++) for (size_t z = 0; z < strlen(path); z++)
path[z] = tolower(path[z]); path[z] = tolower(path[z]);
if (!is_folder_included(path) || is_folder_excluded(path)) { if (!is_folder_included(path) || is_folder_excluded(path)) {
@@ -70,10 +72,11 @@ void monitor_processes() {
log(LOGLEVEL::ERR, "[monitor_processes()]: Error enumerating processes"); log(LOGLEVEL::ERR, "[monitor_processes()]: Error enumerating processes");
} }
} }
void process_scanner() { void process_scanner() {
//we are in a thread so we can do this, unlimited resources wuhuiii // We are in a thread so we can do this, unlimited resources
while (!app_stop()) { while (!app_stop()) {
monitor_processes(); monitor_processes();
Sleep(1000); // Sleep for 1 second Sleep(1000); // Sleep for 1 second
} }
} }

View File

@@ -26,6 +26,7 @@ int main() {
log(LOGLEVEL::INFO_NOSEND, "[main()]:Starting main thread."); log(LOGLEVEL::INFO_NOSEND, "[main()]:Starting main thread.");
int err = 0; 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 (load_settings() == 0) {//load the settings from the settings file
if (update_settings("settings")!=0) { //update the settings from the server if (update_settings("settings")!=0) { //update the settings from the server
log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not update settings (settings) from server."); log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not update settings (settings) from server.");
@@ -46,7 +47,6 @@ int main() {
log(LOGLEVEL::PANIC_NOSEND, "[main()]:Panic, no settings file loaded, terminating process!"); log(LOGLEVEL::PANIC_NOSEND, "[main()]:Panic, no settings file loaded, terminating process!");
exit(1); exit(1);
} }
// Initialize hash databases // Initialize hash databases
err = initialize(DB_DIR); err = initialize(DB_DIR);
if (err != 0) { if (err != 0) {
@@ -97,11 +97,7 @@ int main() {
if (can_run_thread()) { if (can_run_thread()) {
int queue_size = get_queue_size(); int queue_size = get_queue_size();
for (int i = 0; i < queue_size; i++) { for (int i = 0; i < queue_size; i++) {
char* queue_entry = new char[300 * 2 + 5]; start_thread(queue_pop());
queue_entry[0] = '\0';
queue_pop(queue_entry);
start_thread(queue_entry);
delete[] queue_entry;
} }
} }

View File

@@ -1,3 +1,36 @@
 Quellen werden auf Modulabhängigkeiten überprüft...  Quellen werden auf Modulabhängigkeiten überprüft...
virus_ctrl.cpp check_dir.cpp
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\xutility(4537,18): warning C4244: "=": Konvertierung von "wchar_t" in "char", möglicher Datenverlust
(Quelldatei „check_dir.cpp“ wird kompiliert)
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\xutility(4537,18):
der Vorlageninstanziierungskontext (der älteste zuerst) ist
C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\check_dir.cpp(35,29):
Siehe Verweis auf die gerade kompilierte Instanziierung "std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string<std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,0>(_Iter,_Iter,const _Alloc &)" der Funktions-Vorlage.
with
[
_Elem=wchar_t,
_Iter=std::_String_iterator<std::_String_val<std::_Simple_types<wchar_t>>>,
_Alloc=std::allocator<char>
]
C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\check_dir.cpp(35,29):
Ersten Verweis auf "std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string" in "process_changes" anzeigen
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\xstring(2600,17):
Siehe Verweis auf die gerade kompilierte Instanziierung "void std::basic_string<char,std::char_traits<char>,std::allocator<char>>::_Construct_from_iter<wchar_t*,wchar_t*,_Size_type>(_Iter,const _Sent,_Size)" der Funktions-Vorlage.
with
[
_Size_type=unsigned __int64,
_Iter=wchar_t *,
_Sent=wchar_t *,
_Size=unsigned __int64
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\xstring(2756,18):
Siehe Verweis auf die gerade kompilierte Instanziierung "_OutIt *std::_Copy_n_unchecked4<wchar_t*,_Size,char*>(_InIt,_SizeTy,_OutIt)" der Funktions-Vorlage.
with
[
_OutIt=char *,
_Size=unsigned __int64,
_InIt=wchar_t *,
_SizeTy=unsigned __int64
]
client_backend.vcxproj -> C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\client_backend.exe client_backend.vcxproj -> C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\client_backend.exe

View File

@@ -1,61 +1,63 @@
#pragma warning(disable:4996) #pragma warning(disable:4996)
#ifndef CONNECT_CPP #ifndef CONNECT_CPP
#define CONNECT_CPP #define CONNECT_CPP
#include "connect.h" #include "connect.h"
#include "well_known.h" #include "well_known.h"
#include "security.h" #include "security.h"
#include <curl/curl.h>
#include <string>
int fast_send(const std::string& url, bool ignore_insecure) {
int fast_send(const char * url,bool ignore_insecure) {
//send get rewuest to server, and cloe connection after maximum 1 second
CURL* curl; CURL* curl;
CURLcode res; CURLcode res;
curl = curl_easy_init(); curl = curl_easy_init();
if (curl) { if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
if(ignore_insecure==true) if (ignore_insecure)
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 1L); curl_easy_setopt(curl, CURLOPT_TIMEOUT, 1L);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
if (res == CURLE_OK) { if (res == CURLE_OK) {
return 0; return 0;
} }
else { else {
return res; return res;
} }
} }
return 1; return 1;
} }
static size_t write_callback_connect(void* contents, size_t size, size_t nmemb, void* userp)
{ static size_t write_callback_connect(void* contents, size_t size, size_t nmemb, void* userp) {
((std::string*)userp)->append((char*)contents, size * nmemb); ((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb; return size * nmemb;
} }
int connect_to_srv(const char*url,char*out,int max_len, bool ignore_insecure) { int connect_to_srv(const std::string& url, char* out, int max_len, bool ignore_insecure) {
CURL* curl; CURL* curl;
CURLcode res; CURLcode res;
std::string readBuffer; std::string readBuffer;
curl = curl_easy_init(); curl = curl_easy_init();
if (curl) { if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback_connect); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback_connect);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
if(ignore_insecure==true) if (ignore_insecure)
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
if (max_len > (int)strlen(readBuffer.c_str())) { if (max_len > (int)readBuffer.length()) {
strcpy(out, readBuffer.c_str()); strcpy(out, readBuffer.c_str());
return 0; return 0;
} }
else else
return 1; return 1;
} }
return 2; return 2;
} }
size_t write_callback_download(void* contents, size_t size, size_t nmemb, void* userp) { size_t write_callback_download(void* contents, size_t size, size_t nmemb, void* userp) {
size_t totalSize = size * nmemb; size_t totalSize = size * nmemb;
FILE* file = (FILE*)userp; FILE* file = (FILE*)userp;
@@ -65,12 +67,11 @@ size_t write_callback_download(void* contents, size_t size, size_t nmemb, void*
return totalSize; return totalSize;
} }
int download_file_from_srv(const char* url, const char* output_file_path, bool ignore_insecure) { int download_file_from_srv(const std::string& url, const std::string& output_file_path, bool ignore_insecure) {
//use curl to download a file from a server char* temp_path = new char[output_file_path.size() + 6];
char*temp_path = new char[515]; strcpy(temp_path, output_file_path.c_str());
char* buf = new char[505]; strcat(temp_path, ".temp");
strcpy_s(temp_path,495, output_file_path);
strcat_s(temp_path,505, ".temp");
CURL* curl; CURL* curl;
CURLcode res; CURLcode res;
FILE* output_file; FILE* output_file;
@@ -78,137 +79,111 @@ int download_file_from_srv(const char* url, const char* output_file_path, bool i
curl = curl_easy_init(); curl = curl_easy_init();
if (!curl) { if (!curl) {
delete[] temp_path; delete[] temp_path;
delete[] buf;
return 1; return 1;
} }
// Set the URL to download curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_URL, url);
// Create a file to write the downloaded data
output_file = fopen(temp_path, "wb"); output_file = fopen(temp_path, "wb");
if (!output_file) { if (!output_file) {
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
delete [] temp_path; delete[] temp_path;
delete[] buf;
return 2; return 2;
} }
// Set the write callback function
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback_download); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback_download);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, output_file); curl_easy_setopt(curl, CURLOPT_WRITEDATA, output_file);
if (ignore_insecure == true) if (ignore_insecure)
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
// Perform the download
res = curl_easy_perform(curl); res = curl_easy_perform(curl);
if (res != CURLE_OK) { if (res != CURLE_OK) {
fclose(output_file); fclose(output_file);
delete[] temp_path; delete[] temp_path;
delete[] buf;
return 3; return 3;
} }
// Cleanup and close the file
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
fclose(output_file); fclose(output_file);
if ((output_file = fopen(temp_path, "r")) == 0) { if ((output_file = fopen(temp_path, "r")) == 0) {
delete[] temp_path; delete[] temp_path;
delete[] buf;
return 4; return 4;
} }
else { else {
char buf[501];
fscanf(output_file, "%500s", buf); fscanf(output_file, "%500s", buf);
if (strcmp(buf, "no_auth") == 0) { if (strcmp(buf, "no_auth") == 0) {
fclose(output_file); fclose(output_file);
delete[] temp_path; delete[] temp_path;
delete[] buf;
return 5; return 5;
} }
else if(check_cert(buf, SECRETS)==0){ else if (check_cert(buf, SECRETS) == 0) {
remove(output_file_path);//remove old file, so it can be overwritten remove(output_file_path.c_str());
fclose(output_file); fclose(output_file);
if (rename(temp_path, output_file_path)!=0) { if (rename(temp_path, output_file_path.c_str()) != 0) {
delete[] temp_path; delete[] temp_path;
delete[] buf; return 6;
return 6;
} }
}else { }
fclose(output_file); else {
delete[] temp_path; fclose(output_file);
delete[] buf; delete[] temp_path;
return 7; return 7;
} }
} }
delete[] buf;
delete[] temp_path; delete[] temp_path;
return 0; return 0;
} }
char* url_encode(const char* input) { std::string url_encode(const std::string& input) {
// Allocate memory for the encoded string (worst case: every character needs encoding) static const char* const safe_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~";
size_t input_len = strlen(input); std::string encoded;
char* encoded = (char*)malloc(input_len * 3 + 1); // +1 for null terminator for (char c : input) {
if (!encoded) { if (std::strchr(safe_chars, c) != nullptr) {
fprintf(stderr, "Memory allocation failed\n"); encoded += c;
exit(EXIT_FAILURE);
}
// Define the characters that don't need encoding
const char* safe_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~";
// Initialize variables for input and output string indices
size_t i = 0; // index for input string
size_t j = 0; // index for output string
// Loop through each character in the input string
while (input[i]) {
// Check if the character is a safe character
if (strchr(safe_chars, input[i]) != NULL) {
encoded[j++] = input[i++]; // Copy safe character as is
} }
else { else {
// Encode non-safe character as percent-encoded representation char temp[4];
sprintf(encoded + j, "%%%02X", (unsigned char)input[i]); sprintf(temp, "%%%02X", (unsigned char)c);
j += 3; // Increment output index by 3 to account for encoding (%XX) encoded += temp;
i++; // Move to the next character in the input string
} }
} }
// Null-terminate the encoded string
encoded[j] = '\0';
return encoded; return encoded;
} }
int upload_to_srv(const char* url, const char* filepath,bool ignore_insecure) { int upload_to_srv(const std::string& url, const std::string& filepath, bool ignore_insecure) {
//upload a file to the server
CURL* curl; CURL* curl;
CURLcode res; CURLcode res;
struct curl_httppost* formpost = NULL; struct curl_httppost* formpost = nullptr;
struct curl_httppost* lastptr = NULL; struct curl_httppost* lastptr = nullptr;
struct curl_slist* headerlist = NULL; struct curl_slist* headerlist = nullptr;
static const char buf[] = "Expect:"; static const char buf[] = "Expect:";
curl_global_init(CURL_GLOBAL_ALL); curl_global_init(CURL_GLOBAL_ALL);
curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "file", CURLFORM_FILE, filepath, CURLFORM_END); curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "file", CURLFORM_FILE, filepath.c_str(), CURLFORM_END);
curl = curl_easy_init(); curl = curl_easy_init();
if (curl) { if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
if(ignore_insecure==true) if (ignore_insecure)
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
headerlist = curl_slist_append(headerlist, buf); headerlist = curl_slist_append(headerlist, buf);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
curl_formfree(formpost); curl_formfree(formpost);
curl_slist_free_all(headerlist); curl_slist_free_all(headerlist);
if (res == CURLE_OK) { if (res == CURLE_OK) {
return 0; return 0;
} }
else { else {
return 1; return 1;
} }
} }
return 2; return 2;
} }
#endif
#endif

View File

@@ -5,8 +5,14 @@
#include <locale> #include <locale>
#include <string> #include <string>
#include <curl/curl.h> #include <curl/curl.h>
int connect_to_srv(const char* url, char* out, int max_len, bool ignore_insecure); //int connect_to_srv(const char* url, char* out, int max_len, bool ignore_insecure);
int download_file_from_srv(const char* url, const char* outputFileName,bool ignore_insecure); //int download_file_from_srv(const char* url, const char* outputFileName,bool ignore_insecure);
int fast_send(const char* url, bool ignore_insecure); //int fast_send(const char* url, bool ignore_insecure);
char* url_encode(const char* input); //char* url_encode(const char* input);
int upload_to_srv(const char* url, const char* filepath, bool ignore_insecure); //int upload_to_srv(const char* url, const char* filepath, bool ignore_insecure);
int fast_send(const std::string& url, bool ignore_insecure);
int connect_to_srv(const std::string& url, char* out, int max_len, bool ignore_insecure);
int download_file_from_srv(const std::string& url, const std::string& outputFileName, bool ignore_insecure);
int upload_to_srv(const std::string& url, const std::string& filepath, bool ignore_insecure);
std::string url_encode(const std::string& input);

View File

@@ -2,54 +2,33 @@
#define LOCAL_COM_CPP #define LOCAL_COM_CPP
#include "local_com.h" #include "local_com.h"
int check_for_com_tasks(const char* com_name, const char* com_path) { #include <iostream>
//check for new tasks in com file and add them into the queue #include <fstream>
FILE* fp=nullptr; #include <string>
char* command=new char [300];
if ((fopen_s(&fp,com_path, "r")) != 0) {
//no com file found = no communication needed
delete[] command;
return 1;
}
else {
while (!feof(fp)) {
fscanf_s(fp, "%s", command, 295); // get the command
if (!feof(fp)) { //last line =\n we dont want to process that
//we scanned the command, now we will scan the path. If the process does not need a path the path will be nopath. (set from client)
//get a full path. => " = start, second "= end
char* path = new char[300];
path[0] = '\0';
//search for starting ", then loop until ending "
int cnt = 0;
int chr = 0;
fgetc(fp);
fgetc(fp);
while (cnt < 295 && chr != '\"') {
chr = fgetc(fp); //get a char
if(chr!='\"')
path[cnt] = chr;
path[cnt+1] = '\0';
cnt++;
}
//printf("%s\n", path);
//we now have the command and the path. Now we will add it to the queue
char* queue_entry = new char[300*2+5]; //to enshure we have enough space
queue_entry[0] = '\0';
strcpy_s(queue_entry,600, command); //copy the command
strcat_s(queue_entry, 600, ";"); //add a ; to seperate command and path
strcat_s(queue_entry, 600, path); //add the path
queue_push(queue_entry); int check_for_com_tasks(const std::string& com_name, const std::string& com_path) {
//(queue_entry); std::ifstream file(com_path);
delete[] queue_entry;
delete[] path;
}
}
}
remove(com_path); if (!file.is_open()) {
fclose(fp); // No com file found = no communication needed
delete[] command; return 1;
return 0; }
std::string command;
while (file >> command) {
// Scan the command
std::string path;
file >> path; // Scan the path
// Add command and path to the queue
std::string queue_entry = command + ";" + path;
queue_push(queue_entry.c_str());
}
// Remove the com file after processing
file.close();
std::remove(com_path.c_str());
return 0;
} }
#endif // !LOCAL_COM_CPP #endif // !LOCAL_COM_CPP

View File

@@ -4,4 +4,4 @@
#include "queue_ctrl.h" #include "queue_ctrl.h"
#include "well_known.h" #include "well_known.h"
int check_for_com_tasks(const char* com_name, const char* com_path); int check_for_com_tasks(const std::string& com_name, const std::string& com_path);

View File

@@ -1,16 +1,16 @@
#ifndef LOCAL_SCHEDULE_CPP #ifndef LOCAL_SCHEDULE_CPP
#define LOCAL_SCHEDULE_CPP #define LOCAL_SCHEDULE_CPP
#include "local_schedule.h" #include "local_schedule.h"
#include "queue_ctrl.h" #include "queue_ctrl.h"
#include "log.h" #include "log.h"
/* #include <map>
* To do: #include <vector>
* read scheduled tasks form file #include <sstream>
* process time and date to determine if task should be executed #include <iostream>
* add task to queue #include <ctime>
*/ #include <cstdio>
// Map to store task execution states
std::map<std::string, bool> task_states; std::map<std::string, bool> task_states;
bool is_valid_field(const std::string& field, int value) { bool is_valid_field(const std::string& field, int value) {
@@ -18,22 +18,18 @@ bool is_valid_field(const std::string& field, int value) {
return true; // Wildcard matches any value return true; // Wildcard matches any value
} }
// Parse the field and check for matches
std::istringstream iss(field); std::istringstream iss(field);
std::vector<std::string> tokens;
std::string token; std::string token;
while (std::getline(iss, token, ',')) { while (std::getline(iss, token, ',')) {
if (std::find(token.begin(), token.end(), '-') != token.end()) { if (token.find('-') != std::string::npos) {
// Range of values
int start, end; int start, end;
if (sscanf_s(token.c_str(), "%d-%d", &start, &end) == 2 && value >= start && value <= end) { if (sscanf_s(token.c_str(), "%d-%d", &start, &end) == 2 && value >= start && value <= end) {
return true; return true;
} }
} }
else { else {
// Single value
int singleValue; int singleValue;
if (sscanf_s(token.c_str(), "%d", &singleValue) == 1 && value == singleValue) { if (std::istringstream(token) >> singleValue && value == singleValue) {
return true; return true;
} }
} }
@@ -50,136 +46,101 @@ bool is_task_due(const std::string& task_name, const std::string& cron_expressio
fields.push_back(field); fields.push_back(field);
} }
// Check if the 'fields' vector has at least 5 elements
if (fields.size() < 5) { if (fields.size() < 5) {
// Handle the case where the cron expression is not well-formed
return false; return false;
} }
// Check if the task should be executed
if (is_valid_field(fields[0], current_time.tm_min) && if (is_valid_field(fields[0], current_time.tm_min) &&
is_valid_field(fields[1], current_time.tm_hour) && is_valid_field(fields[1], current_time.tm_hour) &&
is_valid_field(fields[2], current_time.tm_mday) && is_valid_field(fields[2], current_time.tm_mday) &&
is_valid_field(fields[3], current_time.tm_mon + 1) && is_valid_field(fields[3], current_time.tm_mon + 1) &&
is_valid_field(fields[4], current_time.tm_wday + 1)) { is_valid_field(fields[4], current_time.tm_wday + 1)) {
// Check if the task has not already been executed
if (!task_states[task_name]) { if (!task_states[task_name]) {
// Set the flag to indicate that the task has been executed
task_states[task_name] = true; task_states[task_name] = true;
return true; return true;
} }
} }
else { else {
// Reset the flag
task_states[task_name] = false; task_states[task_name] = false;
} }
return false; return false;
} }
void unlock_task(const std::string& task_name) { void unlock_task(const std::string& task_name) {
// Unlock the task by setting its state to false
task_states[task_name] = false; task_states[task_name] = false;
} }
int check_for_sched_tasks(const char* sched_name, const char* sched_path) { int check_for_sched_tasks(const char* sched_name, const char* sched_path) {
FILE* fp = nullptr; FILE* fp = nullptr;
char* command = new char[505]; char command[505];
if ((fopen_s(&fp, sched_path, "r")) != 0) { if (fopen_s(&fp, sched_path, "r") != 0) {
//panic, create log entry, return 1;
//no schedule file found. this is not normal
//log(LOGLEVEL::ERR, "[check_for_sched_tasks()]: Error opening schedule file: ", sched_path, " while checking for scheduled tasks; aborting");
delete[] command; delete[] command;
return 1; return 1;
} }
else { else {
fscanf_s(fp, "%s", command, 500); //the cert is always the firs tline fscanf_s(fp, "%s", command, _countof(command));
fgetc(fp); //get the newline fgetc(fp);
while (!feof(fp)) { while (!feof(fp)) {
if (!feof(fp)) { if (!feof(fp)) {
//read date-time config. it starts with " and ends with " char datetime[300] = { '\0' };
char* datetime = new char[300];
datetime[0] = '\0';
//search for datetime, starting ", then loop until ending "
int cnt = 0; int cnt = 0;
int chr = 0; int chr = 0;
chr = fgetc(fp);//read in the first ", or at least try it chr = fgetc(fp);
//printf("%c\n", chr);
if (chr == '\"') { if (chr == '\"') {
chr = 0; chr = 0;
while (cnt < 295 && chr != '\"') { while (cnt < 295 && chr != '\"') {
chr = fgetc(fp); //get a char chr = fgetc(fp);
if (chr != '\"') if (chr != '\"')
datetime[cnt] = chr; datetime[cnt] = chr;
datetime[cnt + 1] = '\0'; datetime[cnt + 1] = '\0';
cnt++; cnt++;
//printf("scanning...\n");
} }
} }
//now we had datetime. we can scan the command and the path now
fscanf_s(fp, "%s", command, 295); // get the command fscanf_s(fp, "%s", command, _countof(command));
char* path = new char[300]; char path[300] = { '\0' };
path[0] = '\0';
//search for arg, starting ", then loop until ending "
cnt = 0; cnt = 0;
chr = 0; chr = 0;
fgetc(fp); //get th ewhitespoace after the command fgetc(fp);
chr = fgetc(fp);//read in the first ", or at least try it chr = fgetc(fp);
if (chr == '\"') { if (chr == '\"') {
chr = 0; chr = 0;
while (cnt < 295 && chr != '\"') { while (cnt < 295 && chr != '\"') {
chr = fgetc(fp); //get a char chr = fgetc(fp);
if (chr != '\"') if (chr != '\"')
path[cnt] = chr; path[cnt] = chr;
path[cnt + 1] = '\0'; path[cnt + 1] = '\0';
cnt++; cnt++;
} }
} }
//now get the taskname
char* taskname = new char[300]; char taskname[300] = { '\0' };
taskname[0] = '\0'; fscanf_s(fp, "%s", taskname, _countof(taskname));
fscanf_s(fp, "%s", taskname, 295); // get the taskname fgetc(fp);
fgetc(fp); //get the newline
//lets check if the command should be executed
//get the current time
std::time_t t = std::time(nullptr); std::time_t t = std::time(nullptr);
struct std::tm current_time; struct std::tm current_time;
localtime_s(&current_time, &t); localtime_s(&current_time, &t);
//printf("%s\n", datetime); if (strcmp(datetime, "") != 0 && strcmp(command, "") != 0 && strcmp(taskname, "") != 0) {
//log(LOGLEVEL::INFO, "[check_for_sched_tasks()]: Checking task: ", taskname, " with schedule: ", datetime);
if (strcmp(datetime, "") != 0 && strcmp(command, "") != 0 && strcmp(taskname, "") != 0) {
//log(LOGLEVEL::INFO, "[check_for_sched_tasks()]: Checking task: ", taskname, " with schedule: ", datetime);
if (is_task_due(taskname, datetime, current_time)) { if (is_task_due(taskname, datetime, current_time)) {
//printf("command:%s\n", command); char queue_entry[600];
//printf("path:%s\n", path);
//now we can build up the command for the queue
char* queue_entry = new char[300 * 2 + 5]; //to enshure we have enough space
queue_entry[0] = '\0'; queue_entry[0] = '\0';
strcpy_s(queue_entry, 600, command); //copy the command strcpy_s(queue_entry, command);
strcat_s(queue_entry, 600, ";"); //add a ; to seperate command and path strcat_s(queue_entry, ";");
strcat_s(queue_entry, 600, path); //add the path strcat_s(queue_entry, path);
log(LOGLEVEL::INFO_NOSEND, "[check_for_sched_tasks()]:Pushing task to queue: ", queue_entry);
queue_push(queue_entry); queue_push(queue_entry);
delete[] queue_entry;
} }
} }
//else {
// printf("datetime:%s\n", datetime);
// printf("command:%s\n", command);
// printf("path:%s\n", path);
// printf("taskname:%s\n", taskname);
// log(LOGLEVEL::ERR, "[check_for_sched_tasks()]: Error reading schedule file: ", sched_path, " while checking for scheduled tasks (malformat); aborting");
//}
delete[] datetime;
delete[] path;
delete[] taskname;
} }
} }
} }
delete[] command;
fclose(fp); fclose(fp);
return 0; return 0;
} }
#endif // !LOCAL_SCHEDULE_CPP
#endif // !LOCAL_SCHEDULE_CPP

View File

@@ -6,10 +6,12 @@
#include <ctime> #include <ctime>
#include <iomanip> #include <iomanip>
#include <sstream> #include <sstream>
#include <string>
#include "connect.h" #include "connect.h"
#include "well_known.h" #include "well_known.h"
#include "settings.h" #include "settings.h"
#include "security.h" #include "security.h"
enum class LOGLEVEL { enum class LOGLEVEL {
INFO, INFO,
WARN, WARN,
@@ -27,7 +29,7 @@ std::string get_loglevel(LOGLEVEL level);
template <typename... Args> template <typename... Args>
void log(LOGLEVEL level, const std::string& message, Args&&... args) { void log(LOGLEVEL level, const std::string& message, Args&&... args) {
log_timeout_reset_set(log_timeout_reset_get()+1); log_timeout_reset_set(log_timeout_reset_get() + 1);
std::string prefix = get_loglevel(level); std::string prefix = get_loglevel(level);
std::time_t now = std::time(nullptr); std::time_t now = std::time(nullptr);
std::tm tm; std::tm tm;
@@ -42,11 +44,9 @@ void log(LOGLEVEL level, const std::string& message, Args&&... args) {
((to_srv << ' ' << std::forward<Args>(args)), ...); ((to_srv << ' ' << std::forward<Args>(args)), ...);
} }
logStream << std::endl; logStream << std::endl;
//to_srv << std::endl;
std::string logString = logStream.str(); std::string logString = logStream.str();
std::string to_srv_string = to_srv.str(); std::string to_srv_string = to_srv.str();
printf("info from logger: %s", logString.c_str()); printf("info from logger: %s", logString.c_str());
// Open the file based on log level
FILE* fp; FILE* fp;
switch (level) { switch (level) {
case LOGLEVEL::INFO: case LOGLEVEL::INFO:
@@ -81,78 +81,67 @@ void log(LOGLEVEL level, const std::string& message, Args&&... args) {
break; break;
} }
if (error != 0) { if (error != 0) {
//panic, create log entry, return 1;
return; return;
} }
else { else {
//write log entry to disk
fprintf_s(fp, "%s", logString.c_str()); fprintf_s(fp, "%s", logString.c_str());
fclose(fp); fclose(fp);
//write to general log file
if (fopen_s(&fp, LOGFILE, "a") == 0) { if (fopen_s(&fp, LOGFILE, "a") == 0) {
fprintf_s(fp, "%s", logString.c_str()); fprintf_s(fp, "%s", logString.c_str());
fclose(fp); fclose(fp);
} }
//write to server log file only if we werent able to send the logs directly. this file will store them until we can upload them if (fopen_s(&fp, SRV_LOGFILE, "a") == 0 && log_timeout_get() >= 5) {
if (fopen_s(&fp, SRV_LOGFILE, "a") == 0 && log_timeout_get() >= 5) { //if server already did not respon over 5 times, we add it to the log file
fprintf_s(fp, "%s\n", to_srv_string.c_str()); fprintf_s(fp, "%s\n", to_srv_string.c_str());
fclose(fp); fclose(fp);
} }
} }
//send log so srv if (level != LOGLEVEL::INFO_NOSEND && level != LOGLEVEL::WARN_NOSEND && level != LOGLEVEL::ERR_NOSEND && level != LOGLEVEL::PANIC_NOSEND/* && log_timeout_get() < 5*/) {
//build up the log string: loglevel&logtext&machineid&date std::string url;
//to_srv_string=includes the log message
//we now need to build up the request string and append the machineid
if (level!=LOGLEVEL::INFO_NOSEND && level!=LOGLEVEL::WARN_NOSEND && level!=LOGLEVEL::ERR_NOSEND && level!=LOGLEVEL::PANIC_NOSEND && log_timeout_get()<5) {
char* url = new char[3000];
int res = 0; int res = 0;
if (get_setting("server:server_url", url) == 0 or strcmp(url, "nan") == 0) { url = get_setting_string("server:server_url");
strcat_s(url, 3000, "/api/php/log/add_entry.php?logtext=");//need to add machine_id and apikey if (url!="" && url!="nan") {
strcat_s(url, 3000, url_encode(to_srv_string.c_str())); url += "/api/php/log/add_entry.php?logtext=";
strcat_s(url, 3000, "&machine_id="); url += url_encode(to_srv_string);
strcat_s(url, 3000, get_machineid(SECRETS)); url += "&machine_id=";
strcat_s(url, 3000, "&apikey="); url += get_machineid(SECRETS);
strcat_s(url, 3000, get_apikey(SECRETS)); url += "&apikey=";
res=fast_send(url, get_setting("communication:unsafe_tls")); url += get_apikey(SECRETS);
res = fast_send(url, get_setting("communication:unsafe_tls"));
//log(LOGLEVEL::INFO_NOSEND, "[log()]: sending log to server:", url, " ", res);
if (res != 0) { if (res != 0) {
//we know that the server might be down, so we will increment the timeout counter //log(LOGLEVEL::ERR_NOSEND, "[log()]: Error while sending log to server: ", url);
log_timeout_set(log_timeout_get() + 1); log_timeout_set(log_timeout_get() + 1);
} }
//we might not want to log an error occuring here because it will create a loop }//else
} //log(LOGLEVEL::ERR_NOSEND, "[log()]: Error while sending log to server: ", url);
delete[] url; }
}//else we do not send the log to the server
if (log_timeout_reset_get() > 100) if (log_timeout_reset_get() > 100)
{ {
log_timeout_reset_set(0); log_timeout_reset_set(0);
log_timeout_set(0); log_timeout_set(0);
} }
//!!!i disabled this temporarely, because it does not really work and as long as the client is in lan the other code works anyway /*if (log_timeout_reset_get() > 100 && 1 == 0) {
if(log_timeout_reset_get()>100 && 1==0) { //after 100 log entrys, we cna try again to reach out ot the server.
log_timeout_reset_set(0); log_timeout_reset_set(0);
log_timeout_set(0); log_timeout_set(0);
//try to upload the server_log file, where we stored the logs which we could not upload. std::string url;
char* url = new char[3000];
int res = 0; int res = 0;
if (get_setting("server:server_url", url) == 0 or strcmp(url, "nan") == 0) { url = get_setting("server:server_url");
strcat_s(url, 3000, "/api/php/log/add_log.php?machine_id="); ifif(url != "" && url != "nan") {
strcat_s(url, 3000, get_machineid(SECRETS)); url += "/api/php/log/add_log.php?machine_id=";
strcat_s(url, 3000, "&apikey="); url += get_machineid(SECRETS);
strcat_s(url, 3000, get_apikey(SECRETS)); url += "&apikey=";
res=upload_to_srv(SRV_LOGFILE, url, get_setting("communication:unsafe_tls")); url += get_apikey(SECRETS);
res = upload_to_srv(SRV_LOGFILE, url, get_setting("communication:unsafe_tls"));
if (res != 0) { if (res != 0) {
//we know that the server might be down, so we will increment the timeout counter log_timeout_set(log_timeout_get() + 1);
log_timeout_set(log_timeout_get() + 1);
} }
else { else {
//remove the logfile
remove(SRV_LOGFILE); remove(SRV_LOGFILE);
} }
} }
delete [] url; }*/
}
} }
#endif // LOGGER_H #endif // LOGGER_H

View File

@@ -4,6 +4,8 @@
#pragma comment(lib, "advapi32.lib") #pragma comment(lib, "advapi32.lib")
#include "permissions.h" #include "permissions.h"
#include <mutex> // Include mutex for synchronization #include <mutex> // Include mutex for synchronization
#include <Windows.h>
#include <io.h> // Include for _chmod function
// Mutex for synchronizing file operations // Mutex for synchronizing file operations
std::mutex fileMutex; std::mutex fileMutex;
@@ -15,19 +17,19 @@ file cannot be deleted or modified by anyone. admin can delete
*/ */
//mark as readonly // Mark as read-only
int protect_file(char* path) { int protect_file(const char* path) {
std::lock_guard<std::mutex> lock(fileMutex); // Lock the mutex std::lock_guard<std::mutex> lock(fileMutex); // Lock the mutex
return _chmod(path, _S_IREAD); return _chmod(path, _S_IREAD);
} }
//mark as readwrite // Mark as read-write
int unprotect_file(char* path) { int unprotect_file(const char* path) {
std::lock_guard<std::mutex> lock(fileMutex); // Lock the mutex std::lock_guard<std::mutex> lock(fileMutex); // Lock the mutex
return _chmod(path, _S_IWRITE | _S_IREAD); return _chmod(path, _S_IWRITE | _S_IREAD);
} }
//deny all access and only grant access to admins // Deny all access and only grant access to admins
BOOL create_file_protection(SECURITY_ATTRIBUTES* pSA) BOOL create_file_protection(SECURITY_ATTRIBUTES* pSA)
{ {
// Define the SDDL for the DACL. This example sets // Define the SDDL for the DACL. This example sets
@@ -41,10 +43,9 @@ BOOL create_file_protection(SECURITY_ATTRIBUTES* pSA)
LPCSTR szSD = TEXT("D:") LPCSTR szSD = TEXT("D:")
TEXT("(D;OICI;GA;;;BG)") // Deny access to guest users TEXT("(D;OICI;GA;;;BG)") // Deny access to guest users
TEXT("(D;OICI;GA;;;AN)") // Deny access to unauthenticated users TEXT("(D;OICI;GA;;;AN)") // Deny access to unauthenticated users
//TEXT("(D;OICI;GA;;;AU)") // Deny access to authenticated users do not execute else not even admins have rights anymore :( //TEXT("(D;OICI;GA;;;AU)") // Deny access to authenticated users do not execute else not even admins have rights anymore :(
TEXT("(A;OICI;GA;;;BA)"); // Allow full control to builtin administrators TEXT("(A;OICI;GA;;;BA)"); // Allow full control to builtin administrators
TEXT("(A;OICI;GA;;;AA)"); // Allow full control to normal administrators TEXT("(A;OICI;GA;;;AA)"); // Allow full control to normal administrators
if (NULL == pSA) if (NULL == pSA)
return FALSE; return FALSE;

View File

@@ -13,5 +13,5 @@
#include <windows.h> #include <windows.h>
#include <sddl.h> #include <sddl.h>
#include <stdio.h> #include <stdio.h>
int protect_file(char* path); int protect_file(const char* path);
int unprotect_file(char* path); int unprotect_file(const char* path);

View File

@@ -1,45 +1,44 @@
#ifndef QUEUE_CTRL_CPP #ifndef QUEUE_CTRL_CPP
#define QUEUE_CTRL_CPP #define QUEUE_CTRL_CPP
#include "queue_ctrl.h" #include "queue_ctrl.h"
#include <string.h> #include <cstring>
#define queue_limit 1000 #include <string>
#define command_limit 3000 #include <array>
char queue[queue_limit][command_limit];
constexpr int queue_limit = 1000;
std::array<std::string, queue_limit> queue;
int queue_size = 0; int queue_size = 0;
int queue_start = 0; int queue_start = 0;
int queue_end = 0; int queue_end = 0;
int queue_push(char* str) {
if (queue_size == queue_limit) { int queue_push(const std::string& str) {
return 1; if (queue_size == queue_limit) {
} return 1; // Queue full
else if (strlen(str) >= command_limit) { }
return 2; else {
} queue[queue_end] = str;
else { queue_end = (queue_end + 1) % queue_limit;
strcpy_s(queue[queue_end], str); queue_size++;
queue_end++; return 0; // Success
queue_size++; }
if (queue_end == queue_limit) {
queue_end = 0;
}
return 0;
}
} }
int queue_pop(char* str) {
if (queue_size == 0) { std::string queue_pop() {
return 1; if (queue_size == 0) {
} return "nan"; // Queue empty
else { }
strcpy_s(str, 100, queue[queue_start]); else {
queue_start++; std::string ret = queue[queue_end-1];
queue_size--; queue_end = (queue_end - 1) % queue_limit;
if (queue_start == queue_limit) { queue_size--;
queue_start = 0; return ret; // Success
} }
return 0;
}
} }
int get_queue_size() { int get_queue_size() {
return queue_size; return queue_size;
} }
#endif // !QUEUE_CTRL_CPP #endif // !QUEUE_CTRL_CPP

View File

@@ -1,9 +1,9 @@
#pragma once #pragma once
#ifndef QUEUE_CTRL_H #ifndef QUEUE_CTRL_H
#define QUEUE_CTRL_H #define QUEUE_CTRL_H
#include <string>
int queue_push(char* str); int queue_push(const std::string& str);
int queue_pop(char* str); std::string queue_pop();
int get_queue_size(); int get_queue_size();
#endif // !QUEUE_CTRL_H #endif // !QUEUE_CTRL_H

View File

@@ -222,28 +222,23 @@ void scan_folder(const std::string& directory) {
//for singlethreaded scans //for singlethreaded scans
void action_scanfile(const char* filepath) { void action_scanfile(const std::string& filepath_) {
thread_init(); thread_init();
const std::string filepath(filepath_);
char* db_path = new char[300]; char* db_path = new char[300];
char* hash = new char[300];
//log(LOGLEVEL::INFO, "[action_scanfile_t()]: Scanning file: ", filepath); std::string hash_(md5_file_t(filepath));
if (strlen(filepath) == 0 or strcmp("", filepath) == 0 or file_exists(filepath) == false) { if (strlen(hash_.c_str()) < 290)
thread_shutdown(); strcpy_s(hash, 295, hash_.c_str());
delete[] db_path;
return; //no filepath given or file not accessible
}
else { else {
char* hash = new char[300]; strcpy_s(hash, 295, "");
hash[0] = '\0'; log(LOGLEVEL::ERR_NOSEND, "[scan_file_t()]: Could not calculate hash for file: ", filepath);
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]);
search_hash(db_path, hash, filepath);
delete[] hash;
} }
delete[] db_path; sprintf_s(db_path, 295, "%s\\%c%c.jdbf", DB_DIR, hash[0], hash[1]);
search_hash(db_path, hash, filepath);
thread_shutdown(); thread_shutdown();
} }
void action_scanfolder(const char* folderpath) { void action_scanfolder(const std::string& folderpath) {
thread_init(); thread_init();
cnt = 0; cnt = 0;
thread_local std::string folderpath_(folderpath); thread_local std::string folderpath_(folderpath);

View File

@@ -11,8 +11,8 @@
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
void scan_folder(const std::string& directory); void scan_folder(const std::string& directory);
void action_scanfile(const char* filepath); void action_scanfile(const std::string& filepath);
void action_scanfolder(const char* folderpath); void action_scanfolder(const std::string& folderpath);
//void action_scanfile_t(const char* filepath); //void action_scanfile_t(const char* filepath);
void scan_file_t(const std::string& filepath_); void scan_file_t(const std::string& filepath_);
int initialize(const std::string& folderPath); int initialize(const std::string& folderPath);

View File

@@ -1,72 +1,65 @@
#include "security.h" #include "security.h"
#include <mutex> // Include the mutex header #include <mutex> // Include the mutex header
#include <string> // Include the string header
#include <fstream> // Include the file stream header
std::mutex fileMutex_sec; // Mutex to synchronize file access std::mutex fileMutex_sec; // Mutex to synchronize file access
int check_cert(const char* cert, const char* secrets_path) { int check_cert(const std::string& cert, const std::string& secrets_path) {
FILE* fp; std::ifstream file(secrets_path);
if (fopen_s(&fp, secrets_path, "r") != 0) { if (!file.is_open()) {
return 1; return 1;
} }
else { else {
char secrets[505]; // Allocate memory on the stack std::string secrets;
std::lock_guard<std::mutex> lock(fileMutex_sec); // Lock file access std::lock_guard<std::mutex> lock(fileMutex_sec); // Lock file access
while (!feof(fp)) { while (file >> secrets) {
fscanf_s(fp, "%s", secrets, 500); // get the secret if (secrets == "cert") {
if (strcmp("cert", secrets) == 0) { file >> secrets; // Get the secret
fscanf_s(fp, "%s", secrets, 500); // get the secret if (cert == secrets) {
if (strcmp(cert, secrets) == 0) {
fclose(fp);
return 0; return 0;
} }
} }
} }
fclose(fp);
return 2; return 2;
} }
} }
char* get_apikey(const char* secrets_path) { std::string get_apikey(const std::string& secrets_path) {
FILE* fp; std::ifstream file(secrets_path);
if (fopen_s(&fp, secrets_path, "r") != 0) { if (!file.is_open()) {
return nullptr; return "";
} }
else { else {
char secrets[505]; // Allocate memory on the stack std::string secrets;
std::lock_guard<std::mutex> lock(fileMutex_sec); // Lock file access std::lock_guard<std::mutex> lock(fileMutex_sec); // Lock file access
while (!feof(fp)) { while (file >> secrets) {
fscanf_s(fp, "%s", secrets, 500); // get the secret if (secrets == "apikey") {
if (strcmp("apikey", secrets) == 0) { file >> secrets; // Get the secret
fscanf_s(fp, "%s", secrets, 500); // get the secret return secrets; // Return the secret
fclose(fp);
return secrets; // Return a dynamically allocated copy
} }
} }
fclose(fp); return "";
return nullptr;
} }
} }
char* get_machineid(const char* secrets_path) { std::string get_machineid(const std::string& secrets_path) {
FILE* fp; std::ifstream file(secrets_path);
if (fopen_s(&fp, secrets_path, "r") != 0) { if (!file.is_open()) {
return nullptr; return "";
} }
else { else {
char secrets[300]; // Allocate memory on the stack std::string secrets;
std::lock_guard<std::mutex> lock(fileMutex_sec); // Lock file access std::lock_guard<std::mutex> lock(fileMutex_sec); // Lock file access
while (!feof(fp)) { while (file >> secrets) {
fscanf_s(fp, "%s", secrets, 295); // get the secret if (secrets == "machineid") {
if (strcmp("machineid", secrets) == 0) { file >> secrets; // Get the secret
fscanf_s(fp, "%s", secrets, 295); // get the secret return secrets; // Return the secret
fclose(fp);
return secrets; // Return a dynamically allocated copy
} }
} }
fclose(fp); return "";
return nullptr;
} }
} }

View File

@@ -4,7 +4,7 @@
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
int check_cert(const char* cert,const char* secrets_path); int check_cert(const std::string& cert, const std::string& secrets_path);
char*get_apikey(const char*secrets_path); std::string get_apikey(const std::string& secrets_path);
char* get_machineid(const char*secrets_path); std::string get_machineid(const std::string& secrets_path);
#endif // !SECURITY_H #endif // !SECURITY_H

View File

@@ -1,5 +1,6 @@
#ifndef SETTINGS_CPP #ifndef SETTINGS_CPP
#define SETTINGS_CPP #define SETTINGS_CPP
#include "settings.h" #include "settings.h"
#include "well_known.h" #include "well_known.h"
#include "log.h" #include "log.h"
@@ -10,15 +11,15 @@ std::mutex settingsMutex;
std::mutex logMutex; std::mutex logMutex;
int setting_virus_ctrl_virus_found_action = 0; int setting_virus_ctrl_virus_found_action = 0;
char* setting_server_server_url = new char[300]; std::string setting_server_server_url = "nan";
char excluded_folders[100][300]; std::string excluded_folders[1000];
int excluded_folders_size = 0; int excluded_folders_size = 0;
char included_folders[100][300]; std::string included_folders[1000];
int included_folders_size = 0; int included_folders_size = 0;
bool setting_rtp_folder_scan_status = 1; //0=off, 1=on bool setting_rtp_folder_scan_status = true; // 0=off, 1=on
bool setting_rtp_process_scan_status = 1; //0=off, 1=on bool setting_rtp_process_scan_status = true; // 0=off, 1=on
bool setting_virus_ctrl_virus_process_found_kill = 1; //0=do not kill, 1=kill bool setting_virus_ctrl_virus_process_found_kill = true; // 0=do not kill, 1=kill
bool setting_communication_unsafe_tls = 0; //0=do not allow communication via unsafe, self-signed certs, 1=allow communication via unsafe, self-signed certs bool setting_communication_unsafe_tls = false; // 0=do not allow communication via unsafe, self-signed certs, 1=allow communication via unsafe, self-signed certs
int srv_log_timeout = 0; int srv_log_timeout = 0;
int log_timeout_reset = 0; int log_timeout_reset = 0;
@@ -26,198 +27,163 @@ void load_included_folders();
void load_excluded_folders(); void load_excluded_folders();
int load_settings() { int load_settings() {
FILE* fp; //std::lock_guard<std::mutex> lock(settingsMutex); // Lock access to settings file operations
std::lock_guard<std::mutex> lock(settingsMutex); // Lock access to settings file operations std::ifstream file(SETTINGS_DB);
if (fopen_s(&fp, SETTINGS_DB, "r") != 0) { if (!file.is_open()) {
log(LOGLEVEL::ERR, "[load_settings()]: Could not open settings file. ", SETTINGS_DB); log(LOGLEVEL::ERR, "[load_settings()]: Could not open settings file. ", SETTINGS_DB);
strcpy_s(setting_server_server_url, 295, "nan"); setting_server_server_url = "nan";
return 1; return 1;
} }
else {
char* settings_cmd = new char[505]; std::string settings_cmd, settings_arg;
char* settings_arg = new char[300]; file>>settings_cmd;//the firs tline is our cert
fscanf_s(fp, "%s", settings_cmd, 500); //the cert is always the first line while (file >> settings_cmd) {
while (!feof(fp)) { file >> settings_arg;
fscanf_s(fp, "%s", settings_cmd, 295); // get the command
//now check which setting it is. // Process settings
if (strcmp(settings_cmd, "virus_ctrl:virus_found:action") == 0) { //printf("aaaaaaaa,%s::,%s\n",settings_cmd.c_str(), settings_arg.c_str());
fscanf_s(fp, "%s", settings_arg, 295); // get the argument if (settings_cmd == "virus_ctrl:virus_found:action") {
if (strcmp(settings_arg, "remove") == 0) { if (settings_arg == "remove") {
setting_virus_ctrl_virus_found_action = 1; //1=remove setting_virus_ctrl_virus_found_action = 1;
}
else if (strcmp(settings_arg, "quarantine") == 0) {
setting_virus_ctrl_virus_found_action = 2; //2=quarantine
}
else if (strcmp(settings_arg, "ignore") == 0) {
setting_virus_ctrl_virus_found_action = 3; //3=ignore
}
else if (strcmp(settings_arg, "call_srv") == 0) {
setting_virus_ctrl_virus_found_action = 4; //4=call_srv <= only call the server and tell it, do not remove or quarantine
}
} }
else if (strcmp(settings_cmd, "server:server_url") == 0) { else if (settings_arg == "quarantine") {
fscanf_s(fp, "%s", settings_arg, 295); // get the argument setting_virus_ctrl_virus_found_action = 2;
strcpy_s(setting_server_server_url, 295, settings_arg);
} }
else if (strcmp(settings_cmd, "rtp_folder_scan:status") == 0) { else if (settings_arg == "ignore") {
fscanf_s(fp, "%s", settings_arg, 295); // get the argument setting_virus_ctrl_virus_found_action = 3;
setting_rtp_folder_scan_status = (strcmp(settings_arg, "true") == 0); //1=on, 0=off
} }
else if (strcmp(settings_cmd, "rtp_process_scan:status") == 0) { else if (settings_arg == "call_srv") {
fscanf_s(fp, "%s", settings_arg, 295); // get the argument setting_virus_ctrl_virus_found_action = 4;
setting_rtp_process_scan_status = (strcmp(settings_arg, "true") == 0); //1=on, 0=off
}
else if (strcmp(settings_cmd, "communication:unsafe_tls") == 0) {
fscanf_s(fp, "%s", settings_arg, 295); // get the argument
setting_communication_unsafe_tls = (strcmp(settings_arg, "allow") == 0); //1=allow, 0=block
}
else if (strcmp(settings_cmd, "virus_ctrl:virus_process_found:kill") == 0) {
fscanf_s(fp, "%s", settings_arg, 295); // get the argument
setting_virus_ctrl_virus_process_found_kill = (strcmp(settings_arg, "true") == 0); //1=kill, 0=do not kill
} }
} }
else if (settings_cmd == "server:server_url") {
delete[] settings_cmd; setting_server_server_url = settings_arg;
delete[] settings_arg; }
else if (settings_cmd == "rtp_folder_scan:status") {
setting_rtp_folder_scan_status = (settings_arg == "true");
}
else if (settings_cmd == "rtp_process_scan:status") {
setting_rtp_process_scan_status = (settings_arg == "true");
}
else if (settings_cmd == "communication:unsafe_tls") {
setting_communication_unsafe_tls = (settings_arg == "allow");
}
else if (settings_cmd == "virus_ctrl:virus_process_found:kill") {
setting_virus_ctrl_virus_process_found_kill = (settings_arg == "true");
}
} }
file.close();
load_included_folders(); load_included_folders();
load_excluded_folders(); load_excluded_folders();
fclose(fp);
return 0; return 0;
} }
// We have two different get_setting functions. One for int and one for char* return values // We have two different get_setting functions. One for int and one for std::string return values
int get_setting(const char* setting_name) { int get_setting(const std::string& setting_name) {
std::lock_guard<std::mutex> lock(settingsMutex); // Lock access to settings variables std::lock_guard<std::mutex> lock(settingsMutex); // Lock access to settings variables
if (strcmp(setting_name, "virus_ctrl:virus_found:action") == 0) { if (setting_name == "virus_ctrl:virus_found:action") {
return setting_virus_ctrl_virus_found_action; return setting_virus_ctrl_virus_found_action;
} }
if (strcmp(setting_name, "virus_ctrl:virus_process_found:kill") == 0) { if (setting_name == "virus_ctrl:virus_process_found:kill") {
return setting_virus_ctrl_virus_process_found_kill; return setting_virus_ctrl_virus_process_found_kill;
} }
else if (strcmp(setting_name, "rtp_folder_scan:status") == 0) { else if (setting_name == "rtp_folder_scan:status") {
return setting_rtp_folder_scan_status; return setting_rtp_folder_scan_status;
} }
else if (strcmp(setting_name, "rtp_process_scan:status") == 0) { else if (setting_name == "rtp_process_scan:status") {
return setting_rtp_process_scan_status; return setting_rtp_process_scan_status;
} }
else if (strcmp(setting_name, "communication:unsafe_tls") == 0) { else if (setting_name == "communication:unsafe_tls") {
return setting_communication_unsafe_tls; return setting_communication_unsafe_tls;
} }
return -1; return -1;
} }
int get_setting(const char* setting_name, char* out) { std::string get_setting_string(const std::string& setting_name) {
std::lock_guard<std::mutex> lock(settingsMutex); // Lock access to settings variables std::lock_guard<std::mutex> lock(settingsMutex); // Lock access to settings variables
if (strcmp(setting_name, "server:server_url") == 0) { if (setting_name == "server:server_url") {
strcpy_s(out, 295, setting_server_server_url); return setting_server_server_url;
return 0;
} }
return -1; return "nan";
} }
void load_included_folders() { void load_included_folders() {
FILE* fp; std::lock_guard<std::mutex> lock(settingsMutex); // Lock access to settings variables
if (fopen_s(&fp, INCLUDED_FOLDERS, "r") != 0) {
std::ifstream file(INCLUDED_FOLDERS);
if (!file.is_open()) {
log(LOGLEVEL::ERR, "[load_included_files()]: Could not open included folders file. ", INCLUDED_FOLDERS); log(LOGLEVEL::ERR, "[load_included_files()]: Could not open included folders file. ", INCLUDED_FOLDERS);
return; return;
} }
else {
char* path = new char[505]; std::string line;
fscanf_s(fp, "%s", path, 500); //the cert is always the first line std::getline(file, line); // Skip the first line
while (!feof(fp)) { while (std::getline(file, line)) {
//get the path of an excluded folder size_t start_pos = line.find('"'); // Find the position of the first double quote
path[0] = '\0'; if (start_pos != std::string::npos) {
//the path is encapsulated with " size_t end_pos = line.find('"', start_pos + 1); // Find the position of the second double quote
int cnt = 0; if (end_pos != std::string::npos) {
int chr = 0; std::string path = line.substr(start_pos + 1, end_pos - start_pos - 1); // Extract the path between double quotes
chr = fgetc(fp); included_folders[included_folders_size++] = path;
if (chr == '\"') {
chr = 0;
while (cnt < 295 && chr != '\"') {
chr = fgetc(fp); //get a char
if (chr != '\"')
path[cnt] = chr;
path[cnt + 1] = '\0';
cnt++;
}
//now add the path to the array
if (included_folders_size < 95) {
strcpy_s(included_folders[included_folders_size], 295, path);
included_folders_size++;
}
else {
log(LOGLEVEL::ERR, "[load_included_files()]: included folders array is full. Cannot add more folders.");
}
} }
} }
fclose(fp);
delete[] path;
} }
file.close();
} }
void load_excluded_folders() { void load_excluded_folders() {
FILE* fp; std::lock_guard<std::mutex> lock(settingsMutex); // Lock access to settings variables
if (fopen_s(&fp, EXCLUDED_FOLDERS, "r") != 0) {
log(LOGLEVEL::ERR, "[load_excluded_folders()]: Could not open excluded folders file. ", EXCLUDED_FOLDERS); std::ifstream file(EXCLUDED_FOLDERS);
if (!file.is_open()) {
log(LOGLEVEL::ERR, "[load_included_files()]: Could not open excluded folders file. ", INCLUDED_FOLDERS);
return; return;
} }
else {
char* path = new char[505]; std::string line;
fscanf_s(fp, "%s", path, 500); //the cert is always the first line std::getline(file, line); // Skip the first line
while (!feof(fp)) { while (std::getline(file, line)) {
//get the path of an excluded folder size_t start_pos = line.find('"'); // Find the position of the first double quote
path[0] = '\0'; if (start_pos != std::string::npos) {
//the path is encapsulated with " size_t end_pos = line.find('"', start_pos + 1); // Find the position of the second double quote
int cnt = 0; if (end_pos != std::string::npos) {
int chr = 0; std::string path = line.substr(start_pos + 1, end_pos - start_pos - 1); // Extract the path between double quotes
chr = fgetc(fp); excluded_folders[excluded_folders_size++] = path;
if (chr == '\"') {
chr = 0;
while (cnt < 295 && chr != '\"') {
chr = fgetc(fp); //get a char
if (chr != '\"')
path[cnt] = chr;
path[cnt + 1] = '\0';
cnt++;
}
//now add the path to the array
if (excluded_folders_size < 95) {
strcpy_s(excluded_folders[excluded_folders_size], 295, path);
excluded_folders_size++;
}
else {
log(LOGLEVEL::ERR, "[load_excluded_folders()]: Excluded folders array is full. Cannot add more folders.");
}
} }
} }
fclose(fp);
delete[] path;
} }
file.close();
} }
bool is_folder_included(const char* path) { bool is_folder_included(const std::string& path) {
std::lock_guard<std::mutex> lock(settingsMutex); // Lock access to settings variables std::lock_guard<std::mutex> lock(settingsMutex); // Lock access to settings variables
for (int i = 0; i < included_folders_size; i++) { for (int i = 0; i < included_folders_size; i++) {
if (strstr(path, included_folders[i]) != 0 && strcmp(included_folders[i], "") != 0 && strcmp(included_folders[i], " ") != 0) { if (path.find(included_folders[i]) != std::string::npos) {
return true; return true;
} }
} }
return false; return false;
} }
bool is_folder_excluded(const char* path) { bool is_folder_excluded(const std::string& path) {
std::lock_guard<std::mutex> lock(settingsMutex); // Lock access to settings variables std::lock_guard<std::mutex> lock(settingsMutex); // Lock access to settings variables
for (int i = 0; i < excluded_folders_size; i++) { for (int i = 0; i < excluded_folders_size; i++) {
if (strstr(path, excluded_folders[i]) != 0 && strcmp(excluded_folders[i], "") != 0 && strcmp(excluded_folders[i], " ") != 0) { if (path.find(excluded_folders[i]) != std::string::npos) {
return true; return true;
} }
} }
@@ -256,4 +222,4 @@ int log_timeout_reset_get() {
return log_timeout_reset; return log_timeout_reset;
} }
#endif #endif // SETTINGS_CPP

View File

@@ -3,12 +3,16 @@
#define SETTINGS_H #define SETTINGS_H
#include <iostream> #include <iostream>
#include <Windows.h> #include <Windows.h>
int get_setting(const char* setting_name); #include <string>
int get_setting(const char* setting_name,char*out); int get_setting(const std::string& setting_name);
std::string get_setting_string(const std::string& setting_name);
int load_settings(); int load_settings();
bool is_folder_included(const char* path); void load_included_folders();
bool is_folder_excluded(const char* path); void load_excluded_folders();
void print_inclusions(); bool is_folder_included(const std::string& path);
bool is_folder_excluded(const std::string& path);
void print_inclusions();
int log_timeout_get(); int log_timeout_get();
void log_timeout_set(int timeout); void log_timeout_set(int timeout);

View File

@@ -1,78 +1,60 @@
#ifndef THREAD_CTRL_CPP #ifndef THREAD_CTRL_CPP
#define THREAD_CTRL_CPP #define THREAD_CTRL_CPP
#include "thread_ctrl.h" #include "thread_ctrl.h"
#include "log.h" #include "log.h"
#include "well_known.h" #include "well_known.h"
#include "scan.h" #include "scan.h"
#include "app_ctrl.h" #include "app_ctrl.h"
#include "update.h" #include "update.h"
void split(char* input,const char delimiter, char* out1, char* out2) {
//split a string at the delimiter. the delimiter only occurs once. so the first part is out1 and the second part is out2
int i = 0;
int j = 0;
int k = 0;
while (input[i] != '\0') {
if (input[i] == delimiter) {
out1[j] = '\0';
i++;
while (input[i] != '\0') {
out2[k] = input[i];
i++;
k++;
}
out2[k] = '\0';
return;
}
else {
out1[j] = input[i];
i++;
j++;
}
}
}
int start_thread(const char* command) {
if (can_run_thread()) {
char* out2 = new char[100]; //for the command
char* out1 = new char[300]; //for the arguments
split((char*)command,';', (char*)out1, (char*)out2);
//log(LOGLEVEL::INFO, "[start_thread()]: starting command: ", out1, " with arguments: ",out2);
//printf("out1: %s\n", out1);
//printf("out2: %s\n", out2);
//determine what should be executed
if (strcmp(out1, "scanfile") == 0) {
log(LOGLEVEL::INFO, "[start_thread()]: starting scanfile with arguments: ", out2);
//start a new thread with the scanfile function
std::thread t1(action_scanfile, out2);
t1.detach();
}
else if (strcmp(out1, "scanfolder") == 0) {
//start a new thread with the scanfolder function
log(LOGLEVEL::INFO, "[start_thread()]: starting scanfolder with arguments: ", out2);
std::thread t1(action_scanfolder, out2);
//log(LOGLEVEL::INFO, "[start_thread()]: started scanfolder with arguments: ", out2);
t1.detach();
}
else if (strcmp(out1, "update_settings") == 0) {
//start a new thread with the scanfolder function
log(LOGLEVEL::INFO, "[start_thread()]: starting update_settings with arguments: ", out2);
std::thread t1(action_update_settings);
t1.detach();
}
else if (strcmp(out1, "update_db") == 0) {
//start a new thread with the scanfolder function
log(LOGLEVEL::INFO, "[start_thread()]: starting update_db with arguments: ", out2);
std::thread t1(action_update_settings);
t1.detach();
}
while (can_run_thread()) { void split(const std::string& input, char delimiter, std::string& out1, std::string& out2) {
//delay a bit, in order to wait until the thread is started // Split a string at the delimiter. The delimiter only occurs once.
Sleep(10); // The first part is stored in out1 and the second part in out2.
} size_t pos = input.find(delimiter);
delete[] out1; if (pos != std::string::npos) {
delete[] out2; out1 = input.substr(0, pos);
} out2 = input.substr(pos + 1);
return 0; }
} }
#endif int start_thread(const std::string& command) {
if (can_run_thread()) {
std::string out1, out2;
split(command, ';', out1, out2);
log(LOGLEVEL::INFO_NOSEND, "[start_thread()]: command: ", out1, " arguments: ",out2, " call: ",command);
// Determine what should be executed
if (out1 == "scanfile") {
log(LOGLEVEL::INFO, "[start_thread()]: starting scanfile with arguments: ", out2);
// Start a new thread with the scanfile function
std::thread t1(action_scanfile, out2);
t1.detach();
}
else if (out1 == "scanfolder") {
// Start a new thread with the scanfolder function
log(LOGLEVEL::INFO, "[start_thread()]: starting scanfolder with arguments: ", out2);
std::thread t1(action_scanfolder, out2);
t1.detach();
}
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);
std::thread t1(action_update_settings);
t1.detach();
}
else if (out1 == "update_db") {
// Start a new thread with the update_db function
log(LOGLEVEL::INFO, "[start_thread()]: starting update_db with arguments: ", out2);
std::thread t1(action_update_db);
t1.detach();
}
while (can_run_thread()) {
// Delay a bit to wait until the thread is started
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
}
return 0;
}
#endif // THREAD_CTRL_CPP

View File

@@ -7,5 +7,5 @@
#include <thread> #include <thread>
#include <mutex> #include <mutex>
int start_thread(const char*command); int start_thread(const std::string& command);
#endif #endif

View File

@@ -1,106 +1,98 @@
#ifndef UPDATE_CPP #ifndef UPDATE_CPP
#define UPDATE_CPP #define UPDATE_CPP
#include "update.h" #include "update.h"
#include "log.h" #include "log.h"
#include "connect.h" #include "connect.h"
#include "settings.h" #include "settings.h"
#include "security.h" #include "security.h"
#include <string>
#include <iostream>
#include <cctype>
int update_db(const std::string& folder_path) {
// Download the databases from the server
for (char firstChar = '0'; firstChar <= 'f'; ++firstChar) {
for (char secondChar = '0'; secondChar <= 'f'; ++secondChar) {
// Ensure that the characters are valid hexadecimal digits
if (!std::isxdigit(firstChar) || !std::isxdigit(secondChar) || std::isupper(firstChar) || std::isupper(secondChar)) {
continue;
}
int update_db(const char* folder_path) { // Create the filename based on the naming convention
//download the databases from the server std::string file_name = std::string(1, firstChar) + secondChar + ".jdbf";
for (char firstChar = '0'; firstChar <= 'f'; ++firstChar) {
for (char secondChar = '0'; secondChar <= 'f'; ++secondChar) {
// Ensure that the characters are valid hexadecimal digits
if (!std::isxdigit(firstChar) || !std::isxdigit(secondChar) or std::isupper(firstChar) or std::isupper(secondChar)) {
continue;
}
// Create the filename based on the naming convention // Create the strings to download the files
std::string url = get_setting_string("server:server_url");
if (url.empty() || url == "nan") {
return 2; // Invalid server URL
}
url += "/database_srv/" + file_name;
char file_name[] = { firstChar, secondChar ,'.','j','d','b','f','\0' }; std::string output_path = folder_path + "\\" + file_name;
//create the strings to download the files
char* output_path = new char[300];
char* url = new char[1000];
if (get_setting("server:server_url", url) == 0 or strcmp(url, "nan") == 0) {
strcat_s(url, 295, "/database_srv/");
strcat_s(url, 295, file_name);
strcpy_s(output_path, 295, folder_path);
strcat_s(output_path, 295, "\\");
strcat_s(output_path, 295, file_name);
printf("%s\n", url);
int res = download_file_from_srv(url, output_path,get_setting("communication:unsafe_tls"));
if (res != 0) {
return 10;
}
}
else {
return 2;
}
delete[] url; std::cout << url << std::endl;
delete[] output_path;
} int res = download_file_from_srv(url, output_path, get_setting("communication:unsafe_tls"));
} if (res != 0) {
return 0; return 10; // Error downloading file
}
}
}
return 0;
} }
int update_settings(const char*settings_type) {
//create the strings to download the files
char* url = new char[1000];
if (get_setting("server:server_url", url) == 0 or strcmp(url,"nan")==0) {
strcat_s(url, 1000, "/api/php/settings/get_settings.php?");//need to add machine_id and apikey
strcat_s(url, 1000, settings_type);
strcat_s(url, 1000, "&machine_id=");
strcat_s(url, 1000, get_machineid(SECRETS));
strcat_s(url, 1000, "&apikey=");
strcat_s(url, 1000, get_apikey(SECRETS));
int res = 1;
if (strcmp(settings_type, "settings") == 0)
res = download_file_from_srv(url, SETTINGS_DB, get_setting("communication:unsafe_tls"));
else if (strcmp(settings_type, "rtp_included") == 0)
res = download_file_from_srv(url, INCLUDED_FOLDERS, get_setting("communication:unsafe_tls"));
else if (strcmp(settings_type, "rtp_excluded") == 0)
res = download_file_from_srv(url, EXCLUDED_FOLDERS, get_setting("communication:unsafe_tls"));
else if (strcmp(settings_type, "sched") == 0)
res = download_file_from_srv(url, SCHED_PATH, get_setting("communication:unsafe_tls"));
//int res = 0;
if (res != 0) {
log(LOGLEVEL::ERR, "[update_settings()]: Error downloading settings database file from server", " ERROR:", res);
return 1;
}
delete[] url; int update_settings(const std::string& settings_type) {
return 0; // Create the strings to download the files
} std::string url = get_setting_string("server:server_url");
else { if (url.empty() || url == "nan") {
delete[] url; return 2; // Invalid server URL
return 2; }
} url += "/api/php/settings/get_settings.php?";
return 2; url += settings_type + "&machine_id=" + get_machineid(SECRETS) + "&apikey=" + get_apikey(SECRETS);
int res = 1;
if (settings_type == "settings")
res = download_file_from_srv(url, SETTINGS_DB, get_setting("communication:unsafe_tls"));
else if (settings_type == "rtp_included")
res = download_file_from_srv(url, INCLUDED_FOLDERS, get_setting("communication:unsafe_tls"));
else if (settings_type == "rtp_excluded")
res = download_file_from_srv(url, EXCLUDED_FOLDERS, get_setting("communication:unsafe_tls"));
else if (settings_type == "sched")
res = download_file_from_srv(url, SCHED_PATH, get_setting("communication:unsafe_tls"));
if (res != 0) {
log(LOGLEVEL::ERR, "[update_settings()]: Error downloading settings database file from server. ERROR:", res);
return 1; // Error downloading file
}
return 0;
} }
int action_update_settings() { int action_update_settings() {
//update the settings // Update the settings
int err = 0; int err = 0;
if (update_settings("settings") != 0) { if (update_settings("settings") != 0)
err= 1; err = 1;
}
//update the included folders // Update the included folders
if (update_settings("rtp_included") != 0) { if (update_settings("rtp_included") != 0)
err= 2; err = 2;
}
//update the excluded folders // Update the excluded folders
if (update_settings("rtp_excluded") != 0) { if (update_settings("rtp_excluded") != 0)
err= 3; err = 3;
}
//update the schedule // Update the schedule
if (update_settings("sched") != 0) { if (update_settings("sched") != 0)
err= 4; err = 4;
}
return err; return err;
} }
int action_update_db() { int action_update_db() {
//update the databases // Update the databases
return update_db(DB_DIR); return update_db(DB_DIR);
} }
#endif
#endif // UPDATE_CPP

View File

@@ -3,7 +3,8 @@
#define UPDATE_H #define UPDATE_H
#include <curl/curl.h> #include <curl/curl.h>
#include<string> #include<string>
int update_db(const char* folder_path); int update_db(const std::string& folder_path);
int update_settings(const char*settings_type); int update_settings(const std::string& settings_type);
int action_update_settings(); int action_update_settings();
int action_update_db();
#endif #endif

View File

@@ -1,5 +1,6 @@
#ifndef VIRUS_CTRL_CPP #ifndef VIRUS_CTRL_CPP
#define VIRUS_CTRL_CPP #define VIRUS_CTRL_CPP
#include "virus_ctrl.h" #include "virus_ctrl.h"
#include "well_known.h" #include "well_known.h"
#include "log.h" #include "log.h"
@@ -7,183 +8,163 @@
#include "connect.h" #include "connect.h"
#include "security.h" #include "security.h"
#include <mutex> // Include the mutex header #include <mutex> // Include the mutex header
#include <iostream>
#include <fstream>
#include <cstdio>
#include <thread>
#include <windows.h>
#include <tlhelp32.h>
#include <cstring>
// Define a mutex for thread synchronization // Define a mutex for thread synchronization
std::mutex virusCtrlMutex; std::mutex virusCtrlMutex;
int virus_ctrl_store( const char*path, const char*hash, const char*id) {
std::lock_guard<std::mutex> lock(virusCtrlMutex); // Lock the mute
FILE* fp;
char *db_path = new char[300];
strcpy_s(db_path, 295,VIRUS_CTRL_DB);
strcat_s(db_path, 295, id);
if (fopen_s(&fp, db_path, "a") != 0) {
log(LOGLEVEL::ERR, "[virus_ctrl_store()]:Failed to open virus control database to store path of infected file: ",path);
delete[] db_path;
return 1;
}
else {
fprintf(fp, "\"%s\" %s\n", path, hash);
fclose(fp);
delete[] db_path;
return 0;
}
}
int virus_ctrl_process( const char* id) {
std::lock_guard<std::mutex> lock(virusCtrlMutex); // Lock the mute
//take actions based on settings.
//eg delete infected files, quarantine them, etc
Sleep(100); //wait for the file to be written to the disk else the process that createt the file might not be finished yet
FILE* fp;
char* db_path = new char[300];
strcpy_s(db_path, 295, VIRUS_CTRL_DB);
strcat_s(db_path, 295, id);
if (fopen_s(&fp, db_path, "r") != 0) {
log(LOGLEVEL::ERR, "[virus_ctrl_process()]:Failed to open virus control database to process it.", db_path);
delete[] db_path;
return 1;
}
else {
while (!feof(fp)) {
//get a fulll path (enclosed with "")
char* path = new char[300];
char* hash = new char[300];
path[0] = '\0';
//search for starting ", then loop until ending "
int cnt = 0;
int chr = 0;
chr=fgetc(fp);
if (chr == '\"') {//get the location of the file
chr = 0;
while (cnt < 295 && chr != '\"') {
chr = fgetc(fp); //get a char
if (chr != '\"')
path[cnt] = chr;
path[cnt + 1] = '\0';
cnt++;
}
fscanf_s(fp, "%s", hash, 295); // get the hash of the file
char* quarantine_path = new char[300];
char* url = new char[1005];
char* server_response = new char[100];
char* action = new char[50];
switch (get_setting("virus_ctrl:virus_found:action")) {
case 1://remove
if(remove(path)!=0){
strcpy_s(action, 50, "remove failed");
log(LOGLEVEL::ERR, "[virus_ctrl_process()]:Error while removing infected file: ", path," ",hash);
}
else{
log(LOGLEVEL::VIRUS, "[virus_ctrl_process()]:Removed Virus: ", path, " ", hash, "");
strcpy_s(action, 50, "removed");
}
break;
case 2://quarantine int virus_ctrl_store(const std::string& path, const std::string& hash, const std::string& id) {
strcpy_s(quarantine_path, 295, QUARANTINE_PATH); std::lock_guard<std::mutex> lock(virusCtrlMutex); // Lock the mutex
strcat_s(quarantine_path, 295, "\\"); std::ofstream file(VIRUS_CTRL_DB + id, std::ios::app);
strcat_s(quarantine_path, 295, hash); if (!file.is_open()) {
if(rename(path,quarantine_path)!=0){ log(LOGLEVEL::ERR, "[virus_ctrl_store()]: Failed to open virus control database to store path of infected file: ", path);
log(LOGLEVEL::ERR, "[virus_ctrl_process()]:Error while quarantining infected file: ", path," ",hash); return 1;
strcpy_s(action, 50, "quarantine failed"); }
} else {
else file << "\"" << path << "\" " << hash << "\n";
{ file.close();
log(LOGLEVEL::VIRUS, "[virus_ctrl_process()]:Quarantined Virus: ", path, " ", hash, " to ", quarantine_path); return 0;
strcpy_s(action, 50, "quarantined"); }
} }
break;
case 3://ignore int virus_ctrl_process(const std::string& id) {
//ignore this file and just continue. but for good measure we should log it std::lock_guard<std::mutex> lock(virusCtrlMutex); // Lock the mutex
log(LOGLEVEL::VIRUS, "[virus_ctrl_process()]:Virus found in file: ", path, " ", hash, " but ignored due to settings"); // Take actions based on settings.
strcpy_s(action, 50, "ignored"); // e.g., delete infected files, quarantine them, etc.
break; std::this_thread::sleep_for(std::chrono::milliseconds(100)); // Wait for the file to be written to the disk else the process that created the file might not be finished yet
case 4://notify std::ifstream file(VIRUS_CTRL_DB + id);
//we shoulkd also log it if (!file.is_open()) {
log(LOGLEVEL::VIRUS, "[virus_ctrl_process()]:Virus found in file: ", path, " ", hash, " but only notified due to settings"); log(LOGLEVEL::ERR, "[virus_ctrl_process()]: Failed to open virus control database to process it.", VIRUS_CTRL_DB + id);
strcpy_s(action, 50, "notified"); return 1;
break; }
else {
std::string line;
while (std::getline(file, line)) {
// Get a full path (enclosed with "")
std::string path, hash;
std::size_t pos = line.find("\"");
if (pos != std::string::npos) {
path = line.substr(pos + 1, line.find("\"", pos + 1) - pos - 1);
hash = line.substr(line.find("\"", pos + 1) + 1);
std::string quarantine_path = std::string(QUARANTINE_PATH) + "\\" + hash;
std::string action;
switch (get_setting("virus_ctrl:virus_found:action")) {
case 1: // remove
if (std::remove(path.c_str()) != 0) {
action = "remove_failed";
log(LOGLEVEL::ERR, "[virus_ctrl_process()]: Error while removing infected file: ", path, " ", hash);
}
else {
log(LOGLEVEL::VIRUS, "[virus_ctrl_process()]: Removed Virus: ", path, " ", hash, "");
action = "removed";
}
break;
} case 2: // quarantine
//notify the server if (std::rename(path.c_str(), quarantine_path.c_str()) != 0) {
url[0] = '\0'; log(LOGLEVEL::ERR, "[virus_ctrl_process()]: Error while quarantining infected file: ", path, " ", hash);
if (get_setting("server:server_url", url) == 0 or strcmp(url, "nan") == 0) { action = "quarantine_failed";
strcat_s(url, 1000, "/api/php/virus/notify_virus.php?"); }
strcat_s(url, 1000, "file="); else {
strcat_s(url, 1000, url_encode(path)); log(LOGLEVEL::VIRUS, "[virus_ctrl_process()]: Quarantined Virus: ", path, " ", hash, " to ", quarantine_path);
strcat_s(url, 1000, "&hash="); action = "quarantined";
strcat_s(url, 1000, hash); }
strcat_s(url, 1000, "&action="); break;
strcat_s(url, 1000, action);
strcat_s(url, 1000, "&machine_id="); case 3: // ignore
strcat_s(url, 1000, get_machineid(SECRETS)); // Ignore this file and just continue. But for good measure, we should log it.
strcat_s(url, 1000, "&apikey="); log(LOGLEVEL::VIRUS, "[virus_ctrl_process()]: Virus found in file: ", path, " ", hash, " but ignored due to settings");
strcat_s(url, 1000, get_apikey(SECRETS)); action = "ignored";
if (connect_to_srv(url, server_response, 100, get_setting("communication:unsafe_tls")) != 0 or strcmp("wrt_ok", server_response) != 0) break;
log(LOGLEVEL::ERR, "[virus_ctrl_process()]:Error while notifying server about virus: ", path, " ", hash);
} case 4: // notify
else { // We should also log it.
log(LOGLEVEL::ERR, "[virus_ctrl_process()]:Error while notifying server about virus: ", path, " ", hash); log(LOGLEVEL::VIRUS, "[virus_ctrl_process()]: Virus found in file: ", path, " ", hash, " but only notified due to settings");
} action = "notified";
delete[] quarantine_path; break;
delete[] url; }
delete[] server_response;
} // Notify the server
//else { creates to many log entrys => entrys are not needed std::string url;
// log(LOGLEVEL::ERR, "[virus_ctrl_process()]:Error while processing virus control database. Expected \" but got ", chr); url = get_setting_string("server:server_url");
//} if(url != "nan" && url != "") {
delete[] path; url += "/api/php/virus/notify_virus.php?";
delete[] hash; url += "file=" + url_encode(path);
} url += "&hash=" + url_encode(hash);
fclose(fp); url += "&action=" + action;
} url += "&machine_id=" + get_machineid(SECRETS);
remove(db_path); url += "&apikey=" + get_apikey(SECRETS);
delete[] db_path; char server_response[100];
return 0; int res;
if ((res = connect_to_srv(url, server_response, 100, get_setting("communication:unsafe_tls"))) != 0 || strcmp("wrt_ok", server_response) != 0) {
log(LOGLEVEL::ERR, "[virus_ctrl_process()]: Error while notifying server about virus: ", path, " ", hash);
//log(LOGLEVEL::ERR_NOSEND, "[virus_ctrl_process()]: Error while notifying server about virus: ", path, " ", hash, " response: ", server_response, " url: ", url, " res: ", res);
}
}
else {
log(LOGLEVEL::ERR, "[virus_ctrl_process()]: Error while notifying server about virus: ", path, " ", hash);
}
}
}
file.close();
}
std::remove((VIRUS_CTRL_DB + id).c_str());
return 0;
} }
const char* get_filename(const char* path) {
const char* fileName = strrchr(path, '\\'); std::string get_filename(const std::string& path) {
if (fileName == NULL) { auto pos = path.find_last_of("\\");
// No directory separator found, return the original path if (pos == std::string::npos) {
return path; // No directory separator found, return the original path
} return path;
else { }
// Return the substring after the last directory separator else {
return fileName + 1; // Return the substring after the last directory separator
} return path.substr(pos + 1);
}
} }
int strcasecmp(const char* s1, const char* s2) {
while (*s1 && *s2) { int strcasecmp(const std::string& s1, const std::string& s2) {
int diff = tolower(*s1) - tolower(*s2); auto it1 = s1.begin();
if (diff != 0) auto it2 = s2.begin();
return diff; while (it1 != s1.end() && it2 != s2.end()) {
s1++; int diff = std::tolower(*it1) - std::tolower(*it2);
s2++; if (diff != 0)
} return diff;
return 0; ++it1;
++it2;
}
return 0;
} }
void kill_process(const char*path) {
HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, NULL); void kill_process(const std::string& path) {
PROCESSENTRY32 pEntry; HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, NULL);
pEntry.dwSize = sizeof(pEntry); PROCESSENTRY32 pEntry;
BOOL hRes = Process32First(hSnapShot, &pEntry); pEntry.dwSize = sizeof(pEntry);
while (hRes) BOOL hRes = Process32First(hSnapShot, &pEntry);
{ while (hRes)
if (strcasecmp(pEntry.szExeFile, get_filename(path)) == 0) {
{ if (strcasecmp(pEntry.szExeFile, get_filename(path).c_str()) == 0)
HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, 0, {
(DWORD)pEntry.th32ProcessID); HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, 0, static_cast<DWORD>(pEntry.th32ProcessID));
if (hProcess != NULL) if (hProcess != NULL)
{ {
TerminateProcess(hProcess, 9); TerminateProcess(hProcess, 9);
CloseHandle(hProcess); CloseHandle(hProcess);
} }
else else
log(LOGLEVEL::ERR, "[kill_process()]:Error while killing process: ", path); log(LOGLEVEL::ERR, "[kill_process()]: Error while killing process: ", path);
} }
hRes = Process32Next(hSnapShot, &pEntry); hRes = Process32Next(hSnapShot, &pEntry);
} }
CloseHandle(hSnapShot); CloseHandle(hSnapShot);
} }
#endif
#endif

View File

@@ -8,7 +8,11 @@
#include <Tlhelp32.h> #include <Tlhelp32.h>
#include <winbase.h> #include <winbase.h>
#include <string.h> #include <string.h>
int virus_ctrl_store(const char*, const char*,const char* id); //int virus_ctrl_store(const char*, const char*,const char* id);
int virus_ctrl_process(const char* id); //int virus_ctrl_process(const char* id);
void kill_process(const char* path); //void kill_process(const char* path);
void kill_process(const std::string& path);
int virus_ctrl_store(const std::string& path, const std::string& name, const std::string& id);
int virus_ctrl_process(const std::string& id);
#endif #endif