diff --git a/src/client_backend/.vs/client_backend/v17/.suo b/src/client_backend/.vs/client_backend/v17/.suo index 6d660fc..bcb8dcb 100644 Binary files a/src/client_backend/.vs/client_backend/v17/.suo and b/src/client_backend/.vs/client_backend/v17/.suo differ diff --git a/src/client_backend/.vs/client_backend/v17/Browse.VC.db b/src/client_backend/.vs/client_backend/v17/Browse.VC.db index 0ed265a..b23ddf8 100644 Binary files a/src/client_backend/.vs/client_backend/v17/Browse.VC.db and b/src/client_backend/.vs/client_backend/v17/Browse.VC.db differ diff --git a/src/client_backend/.vs/client_backend/v17/DocumentLayout.json b/src/client_backend/.vs/client_backend/v17/DocumentLayout.json index 2fde83e..11bd6d6 100644 --- a/src/client_backend/.vs/client_backend/v17/DocumentLayout.json +++ b/src/client_backend/.vs/client_backend/v17/DocumentLayout.json @@ -2,6 +2,38 @@ "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\\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\\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\\local_com.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:local_com.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, + { + "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\connect.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\\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\\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\\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.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}" @@ -10,26 +42,10 @@ "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\thread_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:thread_ctrl.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, - { - "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\virus_ctrl.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\\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\\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\\scan.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:scan.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, - { - "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_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\\utils.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:utils.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" @@ -42,22 +58,10 @@ "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\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\\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\\well_known.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:well_known.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, - { - "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\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.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", - "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:connect.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" - }, { "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.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}" @@ -66,10 +70,6 @@ "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_process.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|solutionrelative:check_process.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, - { - "AbsoluteMoniker": "D:0:0:{56E65283-AAC9-43F6-9613-72BE8D648AC4}|client_backend.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_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\\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}" @@ -102,99 +102,8 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 17, + "SelectedChildIndex": 11, "Children": [ - { - "$type": "Document", - "DocumentIndex": 3, - "Title": "local_com.cpp", - "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.cpp", - "RelativeDocumentMoniker": "local_com.cpp", - "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.cpp", - "RelativeToolTip": "local_com.cpp", - "ViewState": "AQIAAAAAAAAAAAAAAAAAAB4AAAASAAAA", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-03-17T16:34:14.678Z", - "EditorCaption": "" - }, - { - "$type": "Document", - "DocumentIndex": 7, - "Title": "utils.h", - "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.h", - "RelativeDocumentMoniker": "utils.h", - "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.h", - "RelativeToolTip": "utils.h", - "ViewState": "AQIAAAAAAAAAAAAAAAAAAAMAAAAUAAAA", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-14T15:55:30.524Z", - "EditorCaption": "" - }, - { - "$type": "Document", - "DocumentIndex": 8, - "Title": "utils.cpp", - "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.cpp", - "RelativeDocumentMoniker": "utils.cpp", - "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.cpp", - "RelativeToolTip": "utils.cpp", - "ViewState": "AQIAAAAAAAAAAAAAAAAAABAAAAAAAAAA", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-03-14T15:55:22.469Z", - "EditorCaption": "" - }, - { - "$type": "Document", - "DocumentIndex": 15, - "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": "AQIAABkAAAAAAAAAAABBwDcAAABCAAAA", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-03-14T13:35:33.369Z", - "EditorCaption": "" - }, - { - "$type": "Document", - "DocumentIndex": 11, - "Title": "well_known.h", - "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\well_known.h", - "RelativeDocumentMoniker": "well_known.h", - "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\well_known.h", - "RelativeToolTip": "well_known.h", - "ViewState": "AQIAAAAAAAAAAAAAAAAAAC0AAAAZAAAA", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-14T13:20:06.953Z", - "EditorCaption": "" - }, - { - "$type": "Document", - "DocumentIndex": 16, - "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": "AQIAAEkAAAAAAAAAAABBwHkAAAAwAAAA", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-03-13T06:48:31.009Z", - "EditorCaption": "" - }, - { - "$type": "Document", - "DocumentIndex": 1, - "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": "AQIAAAAAAAAAAAAAAAAAABQAAAAqAAAA", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-03-13T06:52:01.533Z", - "EditorCaption": "" - }, { "$type": "Document", "DocumentIndex": 21, @@ -205,21 +114,19 @@ "RelativeToolTip": "local_com.h", "ViewState": "AQIAAAAAAAAAAAAAAAAAAAYAAABSAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-13T06:49:41.823Z", - "EditorCaption": "" + "WhenOpened": "2024-03-13T06:49:41.823Z" }, { "$type": "Document", - "DocumentIndex": 12, + "DocumentIndex": 6, "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": "AQIAAEwAAAAAAAAAAAD4v2wAAABKAAAA", + "ViewState": "AQIAAE4AAAAAAAAAAAAAAG4AAAA2AAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-13T06:47:02.038Z", - "EditorCaption": "" + "WhenOpened": "2024-03-13T06:47:02.038Z" }, { "$type": "Document", @@ -231,21 +138,19 @@ "RelativeToolTip": "virus_ctrl.h", "ViewState": "AQIAAAAAAAAAAAAAAAAAABAAAAAuAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-13T06:45:51.845Z", - "EditorCaption": "" + "WhenOpened": "2024-03-13T06:45:51.845Z" }, { "$type": "Document", - "DocumentIndex": 13, + "DocumentIndex": 3, "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": "AQIAAAAAAAAAAAAAAAAAAA8AAABrAAAA", + "ViewState": "AQIAAAAAAAAAAAAAAAAAABMAAAAdAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-13T06:44:13.879Z", - "EditorCaption": "" + "WhenOpened": "2024-03-13T06:44:13.879Z" }, { "$type": "Document", @@ -257,8 +162,7 @@ "RelativeToolTip": "queue_ctrl.h", "ViewState": "AQIAAAAAAAAAAAAAAAAAAAUAAAAYAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-13T06:43:48.22Z", - "EditorCaption": "" + "WhenOpened": "2024-03-13T06:43:48.22Z" }, { "$type": "Document", @@ -270,12 +174,11 @@ "RelativeToolTip": "queue _ctrl.cpp", "ViewState": "AQIAAAAAAAAAAAAAAAAAACAAAAArAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-01-28T20:40:06.295Z", - "EditorCaption": "" + "WhenOpened": "2024-01-28T20:40:06.295Z" }, { "$type": "Document", - "DocumentIndex": 14, + "DocumentIndex": 15, "Title": "update.h", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.h", "RelativeDocumentMoniker": "update.h", @@ -283,8 +186,7 @@ "RelativeToolTip": "update.h", "ViewState": "AQIAAAAAAAAAAAAAAAAAAAkAAAAUAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-13T06:42:28.196Z", - "EditorCaption": "" + "WhenOpened": "2024-03-13T06:42:28.196Z" }, { "$type": "Document", @@ -296,8 +198,7 @@ "RelativeToolTip": "settings.cpp", "ViewState": "AQIAAAAAAAAAAAAAAAAAAD0AAAA1AAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-03-13T06:48:40.364Z", - "EditorCaption": "" + "WhenOpened": "2024-03-13T06:48:40.364Z" }, { "$type": "Document", @@ -309,25 +210,23 @@ "RelativeToolTip": "settings.h", "ViewState": "AQIAAAAAAAAAAAAAAAAAABEAAAAiAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-13T06:42:03.328Z", - "EditorCaption": "" + "WhenOpened": "2024-03-13T06:42:03.328Z" }, { "$type": "Document", - "DocumentIndex": 5, + "DocumentIndex": 10, "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": "AQIAAA0AAAAAAAAAAAAAABMAAAAPAAAA", + "ViewState": "AQIAAAsAAAAAAAAAAABBwBMAAAAPAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-13T06:41:43.701Z", - "EditorCaption": "" + "WhenOpened": "2024-03-13T06:41:43.701Z" }, { "$type": "Document", - "DocumentIndex": 0, + "DocumentIndex": 8, "Title": "scan.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\scan.cpp", "RelativeDocumentMoniker": "scan.cpp", @@ -335,18 +234,30 @@ "RelativeToolTip": "scan.cpp", "ViewState": "AQIAAMIAAAAAAAAAAAAkwOkAAAAFAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-01-28T20:40:06.248Z", + "WhenOpened": "2024-01-28T20:40:06.248Z" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "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": "AQIAAOMAAAAAAAAAAAAIwAEBAAArAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", + "WhenOpened": "2024-01-28T20:40:06.315Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 4, + "DocumentIndex": 1, "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": "AQIAAC0AAAAAAAAAAAAAAFYAAAAfAAAA", + "ViewState": "AQIAABIAAAAAAAAAAAAAABQAAAAaAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "WhenOpened": "2024-01-28T20:40:06.279Z", "EditorCaption": "" @@ -354,54 +265,122 @@ { "$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": "AQIAAAAAAAAAAAAAAAAAABQAAAAqAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", + "WhenOpened": "2024-03-13T06:52:01.533Z" + }, + { + "$type": "Document", + "DocumentIndex": 7, + "Title": "check_dir.cpp", + "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_dir.cpp", + "RelativeDocumentMoniker": "check_dir.cpp", + "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\check_dir.cpp", + "RelativeToolTip": "check_dir.cpp", + "ViewState": "AQIAAAYAAAAAAAAAAAAAAC0AAAA7AAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", + "WhenOpened": "2024-03-13T06:48:31.009Z" + }, + { + "$type": "Document", + "DocumentIndex": 14, + "Title": "well_known.h", + "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\well_known.h", + "RelativeDocumentMoniker": "well_known.h", + "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\well_known.h", + "RelativeToolTip": "well_known.h", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAC0AAAAZAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", + "WhenOpened": "2024-03-14T13:20:06.953Z" + }, + { + "$type": "Document", + "DocumentIndex": 16, + "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": "AQIAABcAAAAAAAAAAABRwDcAAABCAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", + "WhenOpened": "2024-03-14T13:35:33.369Z" + }, + { + "$type": "Document", + "DocumentIndex": 12, + "Title": "utils.cpp", + "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.cpp", + "RelativeDocumentMoniker": "utils.cpp", + "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.cpp", + "RelativeToolTip": "utils.cpp", + "ViewState": "AQIAAAAAAAAAAAAAAAAAABAAAAAAAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", + "WhenOpened": "2024-03-14T15:55:22.469Z" + }, + { + "$type": "Document", + "DocumentIndex": 11, + "Title": "utils.h", + "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.h", + "RelativeDocumentMoniker": "utils.h", + "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\utils.h", + "RelativeToolTip": "utils.h", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAAMAAAAUAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", + "WhenOpened": "2024-03-14T15:55:30.524Z" + }, + { + "$type": "Document", + "DocumentIndex": 2, + "Title": "local_com.cpp", + "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.cpp", + "RelativeDocumentMoniker": "local_com.cpp", + "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\local_com.cpp", + "RelativeToolTip": "local_com.cpp", + "ViewState": "AQIAAAkAAAAAAAAAAAAAAC8AAAAXAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", + "WhenOpened": "2024-03-17T16:34:14.678Z" + }, + { + "$type": "Document", + "DocumentIndex": 13, "Title": "update.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.cpp", "RelativeDocumentMoniker": "update.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\update.cpp", "RelativeToolTip": "update.cpp", - "ViewState": "AQIAAAQAAAAAAAAAAABBwAkAAAARAAAA", + "ViewState": "AQIAAAIAAAAAAAAAAABRwAkAAAARAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-01-28T20:40:06.248Z", - "EditorCaption": "" + "WhenOpened": "2024-01-28T20:40:06.248Z" }, { "$type": "Document", - "DocumentIndex": 6, + "DocumentIndex": 4, "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": "AQIAAGEAAAAAAAAAAAAkwI4AAAANAAAA", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAEIAAAAAAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-01-28T20:40:06.279Z", - "EditorCaption": "" + "WhenOpened": "2024-01-28T20:40:06.279Z" }, { "$type": "Document", - "DocumentIndex": 10, - "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": "AQIAAJoAAAAAAAAAAABBwHkAAAAtAAAA", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-01-28T20:40:06.315Z", - "EditorCaption": "" - }, - { - "$type": "Document", - "DocumentIndex": 2, + "DocumentIndex": 5, "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": "AQIAAEEAAAAAAAAAAAAwwHYAAABIAAAA", + "ViewState": "AQIAAFAAAAAAAAAAAAD4v2gAAAA8AAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-02-18T12:49:41.861Z", - "EditorCaption": "" + "WhenOpened": "2024-02-18T12:49:41.861Z" } ] } diff --git a/src/client_backend/client_backend.cpp b/src/client_backend/client_backend.cpp index bf6543e..0b7c386 100644 --- a/src/client_backend/client_backend.cpp +++ b/src/client_backend/client_backend.cpp @@ -19,7 +19,7 @@ #include "virus_ctrl.h" #include "update.h" #include "check_process.h" -int main() { +int main(int argc, char*argv[]) { //log(LOGLEVEL::INFO, "[main()]:Starting main thread."); //return 0; @@ -28,19 +28,21 @@ int main() { printf("welcome to the jakach security tool main thread\n"); //exit(0); if (load_settings() == 0) {//load the settings from the settings file - if (update_settings("settings")!=0) { //update the settings from the server - log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not update settings (settings) from server."); + if (argc != 2) { + if (update_settings("settings") != 0) { //update the settings from the server + log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not update settings (settings) from server."); + } + if (update_settings("rtp_included") != 0) { //update the settings from the server + log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not update settings (rtp_included) from server."); + } + if (update_settings("rtp_excluded") != 0) { //update the settings from the server + log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not update settings (rtp_excluded) from server."); + } + if (update_settings("sched") != 0) { //update the settings from the server + log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not update settings (scheduled_tasks) from server."); + } + load_settings(); //load the updated settings from the settings file } - if (update_settings("rtp_included")!=0) { //update the settings from the server - log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not update settings (rtp_included) from server."); - } - if (update_settings("rtp_excluded")!=0) { //update the settings from the server - log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not update settings (rtp_excluded) from server."); - } - if (update_settings("sched")!=0) { //update the settings from the server - log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not update settings (scheduled_tasks) from server."); - } - load_settings(); //load the updated settings from the settings file } else { log(LOGLEVEL::ERR_NOSEND, "[main()]:Could not load settings from file."); diff --git a/src/client_backend/client_backend/x64/Debug/client_backend.ilk b/src/client_backend/client_backend/x64/Debug/client_backend.ilk index baf9348..c15d93b 100644 Binary files a/src/client_backend/client_backend/x64/Debug/client_backend.ilk and b/src/client_backend/client_backend/x64/Debug/client_backend.ilk differ diff --git a/src/client_backend/client_backend/x64/Debug/client_backend.log b/src/client_backend/client_backend/x64/Debug/client_backend.log index 648c73e..11a098f 100644 --- a/src/client_backend/client_backend/x64/Debug/client_backend.log +++ b/src/client_backend/client_backend/x64/Debug/client_backend.log @@ -1,2 +1,5 @@  Quellen werden auf Modulabhängigkeiten überprüft... + connect.cpp +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\connect.cpp(210,37): warning C4267: "Argument": Konvertierung von "size_t" nach "DWORD", Datenverlust möglich +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\connect.cpp(196,11): warning C4101: "dwRead": Unreferenzierte lokale Variable client_backend.vcxproj -> C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_backend\x64\Debug\client_backend.exe diff --git a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.command.1.tlog b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.command.1.tlog index c95c904..da49fca 100644 Binary files a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.command.1.tlog and b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.command.1.tlog differ diff --git a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.read.1.tlog b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.read.1.tlog index 1e218c3..da31f50 100644 Binary files a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.read.1.tlog and b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.read.1.tlog differ diff --git a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.write.1.tlog b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.write.1.tlog index 629e409..0d5c965 100644 Binary files a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.write.1.tlog and b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/CL.write.1.tlog differ diff --git a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/client_backend.write.1u.tlog b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/client_backend.write.1u.tlog index 55dd8f8..dc0cf1b 100644 Binary files a/src/client_backend/client_backend/x64/Debug/client_backend.tlog/client_backend.write.1u.tlog and b/src/client_backend/client_backend/x64/Debug/client_backend.tlog/client_backend.write.1u.tlog differ diff --git a/src/client_backend/client_backend/x64/Debug/vc143.idb b/src/client_backend/client_backend/x64/Debug/vc143.idb index 5eb334d..c92d0b9 100644 Binary files a/src/client_backend/client_backend/x64/Debug/vc143.idb and b/src/client_backend/client_backend/x64/Debug/vc143.idb differ diff --git a/src/client_backend/client_backend/x64/Debug/vc143.pdb b/src/client_backend/client_backend/x64/Debug/vc143.pdb index 99d6e6b..be73945 100644 Binary files a/src/client_backend/client_backend/x64/Debug/vc143.pdb and b/src/client_backend/client_backend/x64/Debug/vc143.pdb differ diff --git a/src/client_backend/connect.cpp b/src/client_backend/connect.cpp index afa665c..02527da 100644 --- a/src/client_backend/connect.cpp +++ b/src/client_backend/connect.cpp @@ -7,14 +7,20 @@ #include "security.h" #include #include +#include +std::mutex connect_mutex; +//this function is thread safe int fast_send(const std::string& url, bool ignore_insecure) { - CURL* curl; - CURLcode res; + std::lock_guard lock(connect_mutex); + thread_local const std::string url_ = url; + thread_local const bool ignore_insecure_ = ignore_insecure; + thread_local CURL* curl; + thread_local CURLcode res; curl = curl_easy_init(); if (curl) { - curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); - if (ignore_insecure) + curl_easy_setopt(curl, CURLOPT_URL, url_.c_str()); + if (ignore_insecure_) curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_setopt(curl, CURLOPT_TIMEOUT, 1L); res = curl_easy_perform(curl); @@ -33,7 +39,7 @@ static size_t write_callback_connect(void* contents, size_t size, size_t nmemb, ((std::string*)userp)->append((char*)contents, size * nmemb); return size * nmemb; } - +//make this multi thread safe int connect_to_srv(const std::string& url, char* out, int max_len, bool ignore_insecure) { CURL* curl; CURLcode res; @@ -185,5 +191,70 @@ int upload_to_srv(const std::string& url, const std::string& filepath, bool igno } return 2; } - +int send_to_pipe(const std::string& message) { + HANDLE hPipe; + DWORD dwRead; + DWORD dwWritten; + std::ofstream(MAIN_COM_PATH); // Create the pipe + hPipe = CreateFile(TEXT(MAIN_COM_PATH), + GENERIC_READ | GENERIC_WRITE, + 0, + NULL, + OPEN_EXISTING, + 0, + NULL); + if (hPipe != INVALID_HANDLE_VALUE) + { + WriteFile(hPipe, + message.c_str(), + strlen(message.c_str()) + 1, // = length of string + terminating '\0' !!! + &dwWritten, + NULL); + CloseHandle(hPipe); + return 0; + } + else { + return 1; + } +} +std::string read_from_pipe() { + HANDLE hPipe; + DWORD dwRead; + char buffer[1000]; + hPipe = CreateFile(TEXT(MAIN_COM_PATH), + GENERIC_READ, + 0, + NULL, + OPEN_EXISTING, + 0, + NULL); + if (hPipe != INVALID_HANDLE_VALUE) + { + if (ReadFile(hPipe, buffer, sizeof(buffer), &dwRead, NULL)) + { + CloseHandle(hPipe); + buffer[dwRead] = '\0'; // Ensure null-termination after reading + std::ofstream(MAIN_COM_PATH); // delete the pipe + return std::string(buffer); + } + else + { + // ReadFile failed, print error + DWORD dwError = GetLastError(); + // Handle dwError appropriately (e.g., log, display error message) + CloseHandle(hPipe); + std::ofstream(MAIN_COM_PATH); // delete the pipe + return "Error_reading_from_pipe"; + } + } + else + { + // CreateFile failed, print error + DWORD dwError = GetLastError(); + // Handle dwError appropriately (e.g., log, display error message) + std::ofstream(MAIN_COM_PATH); // delete the pipe + return "Error_creating_pipe"; + } + std::ofstream(MAIN_COM_PATH); // delete the pipe +} #endif diff --git a/src/client_backend/connect.cpp~RF277fb4a.TMP b/src/client_backend/connect.cpp~RF277fb4a.TMP new file mode 100644 index 0000000..e56581b --- /dev/null +++ b/src/client_backend/connect.cpp~RF277fb4a.TMP @@ -0,0 +1,242 @@ +#pragma warning(disable:4996) +#ifndef CONNECT_CPP +#define CONNECT_CPP + +#include "connect.h" +#include "well_known.h" +#include "security.h" +#include +#include +#include +std::mutex connect_mutex; + +//this function is thread safe +int fast_send(const std::string& url, bool ignore_insecure) { + std::lock_guard lock(connect_mutex); + thread_local const std::string url_ = url; + thread_local const bool ignore_insecure_ = ignore_insecure; + thread_local CURL* curl; + thread_local CURLcode res; + curl = curl_easy_init(); + if (curl) { + curl_easy_setopt(curl, CURLOPT_URL, url_.c_str()); + if (ignore_insecure_) + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(curl, CURLOPT_TIMEOUT, 1L); + res = curl_easy_perform(curl); + curl_easy_cleanup(curl); + if (res == CURLE_OK) { + return 0; + } + else { + return res; + } + } + return 1; +} + +static size_t write_callback_connect(void* contents, size_t size, size_t nmemb, void* userp) { + ((std::string*)userp)->append((char*)contents, size * nmemb); + return size * nmemb; +} +//make this multi thread safe +int connect_to_srv(const std::string& url, char* out, int max_len, bool ignore_insecure) { + CURL* curl; + CURLcode res; + std::string readBuffer; + + curl = curl_easy_init(); + if (curl) { + curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback_connect); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); + if (ignore_insecure) + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + res = curl_easy_perform(curl); + curl_easy_cleanup(curl); + if (max_len > (int)readBuffer.length()) { + strcpy(out, readBuffer.c_str()); + return 0; + } + else + return 1; + } + return 2; +} + +size_t write_callback_download(void* contents, size_t size, size_t nmemb, void* userp) { + size_t totalSize = size * nmemb; + FILE* file = (FILE*)userp; + if (file) { + fwrite(contents, 1, totalSize, file); + } + return totalSize; +} + +int download_file_from_srv(const std::string& url, const std::string& output_file_path, bool ignore_insecure, bool do_not_check_cyberhex_cert) { + char* temp_path = new char[output_file_path.size() + 6]; + strcpy(temp_path, output_file_path.c_str()); + strcat(temp_path, ".temp"); + + CURL* curl; + CURLcode res; + FILE* output_file; + + curl = curl_easy_init(); + if (!curl) { + delete[] temp_path; + return 1; + } + + curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); + + output_file = fopen(temp_path, "wb"); + if (!output_file) { + curl_easy_cleanup(curl); + delete[] temp_path; + return 2; + } + + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback_download); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, output_file); + if (ignore_insecure) + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + + res = curl_easy_perform(curl); + if (res != CURLE_OK) { + fclose(output_file); + delete[] temp_path; + return 3; + } + + curl_easy_cleanup(curl); + fclose(output_file); + + if ((output_file = fopen(temp_path, "r")) == 0) { + delete[] temp_path; + return 4; + } + else { + char buf[501]; + fscanf(output_file, "%500s", buf); + if (strcmp(buf, "no_auth") == 0) { + fclose(output_file); + delete[] temp_path; + return 5; + } + else if (check_cert(buf, SECRETS) == 0 or do_not_check_cyberhex_cert==true) { + remove(output_file_path.c_str()); + fclose(output_file); + if (rename(temp_path, output_file_path.c_str()) != 0) { + delete[] temp_path; + return 6; + } + } + else { + fclose(output_file); + delete[] temp_path; + return 7; + } + } + + delete[] temp_path; + return 0; +} + +std::string url_encode(const std::string& input) { + static const char* const safe_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~"; + std::string encoded; + for (char c : input) { + if (std::strchr(safe_chars, c) != nullptr) { + encoded += c; + } + else { + char temp[4]; + sprintf(temp, "%%%02X", (unsigned char)c); + encoded += temp; + } + } + return encoded; +} + +int upload_to_srv(const std::string& url, const std::string& filepath, bool ignore_insecure) { + CURL* curl; + CURLcode res; + struct curl_httppost* formpost = nullptr; + struct curl_httppost* lastptr = nullptr; + struct curl_slist* headerlist = nullptr; + static const char buf[] = "Expect:"; + + curl_global_init(CURL_GLOBAL_ALL); + curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "file", CURLFORM_FILE, filepath.c_str(), CURLFORM_END); + + curl = curl_easy_init(); + if (curl) { + curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); + if (ignore_insecure) + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + headerlist = curl_slist_append(headerlist, buf); + curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist); + curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); + res = curl_easy_perform(curl); + curl_easy_cleanup(curl); + curl_formfree(formpost); + curl_slist_free_all(headerlist); + if (res == CURLE_OK) { + return 0; + } + else { + return 1; + } + } + return 2; +} +int send_to_pipe(const std::string& message) { + HANDLE hPipe; + DWORD dwRead; + DWORD dwWritten; + hPipe = CreateFile(TEXT("\\\\.\\pipe\\cyberhex_pipe"), + GENERIC_READ | GENERIC_WRITE, + 0, + NULL, + OPEN_EXISTING, + 0, + NULL); + if (hPipe != INVALID_HANDLE_VALUE) + { + WriteFile(hPipe, + message.c_str(), + strlen(message.c_str()) + 1, // = length of string + terminating '\0' !!! + &dwWritten, + NULL); + CloseHandle(hPipe); + return 0; + } + else { + return 1; + } +} +std::string read_from_pipe() { + HANDLE hPipe; + DWORD dwRead; + DWORD dwWritten; + char buffer[1000]; + hPipe = CreateFile(TEXT("\\\\.\\pipe\\cyberhex_pipe"), + GENERIC_READ | GENERIC_WRITE, + 0, + NULL, + OPEN_EXISTING, + 0, + NULL); + if (hPipe != INVALID_HANDLE_VALUE) + { + ReadFile(hPipe, buffer, sizeof(buffer), &dwRead, NULL); + CloseHandle(hPipe); + buffer[strlen(buffer)+1]= '\0'; + return std::string(buffer); + } + else { + return "Error"; + } +} +#endif diff --git a/src/client_backend/connect.h b/src/client_backend/connect.h index 77d8769..aae3b72 100644 --- a/src/client_backend/connect.h +++ b/src/client_backend/connect.h @@ -15,4 +15,6 @@ 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, bool do_not_check_cyberhex_cert); int upload_to_srv(const std::string& url, const std::string& filepath, bool ignore_insecure); -std::string url_encode(const std::string& input); \ No newline at end of file +std::string url_encode(const std::string& input); +int send_to_pipe(const std::string& message); +std::string read_from_pipe(); \ No newline at end of file diff --git a/src/client_backend/local_com.cpp b/src/client_backend/local_com.cpp index e3173b1..331ca43 100644 --- a/src/client_backend/local_com.cpp +++ b/src/client_backend/local_com.cpp @@ -1,15 +1,16 @@ #ifndef LOCAL_COM_CPP #define LOCAL_COM_CPP #include "local_com.h" - +#include "connect.h" #include #include #include #include #include + int check_for_com_tasks(const std::string& com_name, const std::string& com_path) { - std::ifstream file(com_path); + /*std::ifstream file(com_path); if (!file.is_open()) { return 1; // Error opening file } @@ -40,6 +41,21 @@ int check_for_com_tasks(const std::string& com_name, const std::string& com_path file.close(); std::remove(com_path.c_str()); + */ + std::string line; + std::string command=""; + std::string path=""; + line=read_from_pipe(); + std::stringstream ss(line); + if (ss >> command) { + size_t start = line.find("\"") + 1; // Start after the opening quote + size_t end = line.find_last_of("\""); // Find the last quote + if (start != std::string::npos && end != std::string::npos) { + path = line.substr(start, end - start); + } + } + std::string queue_entry = command + ";" + path; + queue_push(queue_entry.c_str()); return 0; } #endif // !LOCAL_COM_CPP diff --git a/src/client_backend/local_schedule.cpp b/src/client_backend/local_schedule.cpp index 23d9965..65e9129 100644 --- a/src/client_backend/local_schedule.cpp +++ b/src/client_backend/local_schedule.cpp @@ -80,7 +80,7 @@ int check_for_sched_tasks(const char* sched_name, const char* sched_path) { return 1; } else { - fscanf_s(fp, "%s", command, _countof(command)); + fscanf_s(fp, "%s", command, (unsigned int)_countof(command)); fgetc(fp); while (!feof(fp)) { if (!feof(fp)) { @@ -99,7 +99,7 @@ int check_for_sched_tasks(const char* sched_name, const char* sched_path) { } } - fscanf_s(fp, "%s", command, _countof(command)); + fscanf_s(fp, "%s", command, (unsigned int)_countof(command)); char path[300] = { '\0' }; cnt = 0; chr = 0; @@ -117,7 +117,7 @@ int check_for_sched_tasks(const char* sched_name, const char* sched_path) { } char taskname[300] = { '\0' }; - fscanf_s(fp, "%s", taskname, _countof(taskname)); + fscanf_s(fp, "%s", taskname, (unsigned int)_countof(taskname)); fgetc(fp); std::time_t t = std::time(nullptr); diff --git a/src/client_backend/log.h b/src/client_backend/log.h index 0114b28..ec5ea2c 100644 --- a/src/client_backend/log.h +++ b/src/client_backend/log.h @@ -7,6 +7,7 @@ #include #include #include +#include #include "connect.h" #include "well_known.h" #include "settings.h" @@ -106,14 +107,11 @@ void log(LOGLEVEL level, const std::string& message, Args&&... args) { url += get_machineid(SECRETS); url += "&apikey="; 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) { - //log(LOGLEVEL::ERR_NOSEND, "[log()]: Error while sending log to server: ", url); - log_timeout_set(log_timeout_get() + 1); - } - }//else - //log(LOGLEVEL::ERR_NOSEND, "[log()]: Error while sending log to server: ", url); + //send with fastsend in new thread + std::thread send_thread(fast_send, url, get_setting("communication:unsafe_tls")); + send_thread.detach(); + Sleep(10);//in order to wait for the thread to copy the params into its own memory + } } diff --git a/src/client_backend/virus_ctrl.cpp b/src/client_backend/virus_ctrl.cpp index 0bc805f..5897473 100644 --- a/src/client_backend/virus_ctrl.cpp +++ b/src/client_backend/virus_ctrl.cpp @@ -103,12 +103,10 @@ int virus_ctrl_process(const std::string& id) { url += "&action=" + action; url += "&machine_id=" + get_machineid(SECRETS); url += "&apikey=" + get_apikey(SECRETS); - char server_response[100]; - 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); - } + //send notification using fastsend + std::thread send(fast_send, url, get_setting("communication:unsafe_tls")); + send.detach(); + Sleep(10);//in order to wait for the thread to copy the params into its own memory } else { log(LOGLEVEL::ERR, "[virus_ctrl_process()]: Error while notifying server about virus: ", path, " ", hash); diff --git a/src/client_backend/x64/Debug/client_backend.pdb b/src/client_backend/x64/Debug/client_backend.pdb index 6fa273d..42e0d19 100644 Binary files a/src/client_backend/x64/Debug/client_backend.pdb and b/src/client_backend/x64/Debug/client_backend.pdb differ diff --git a/src/client_frontend_guilite/.vs/client_frontend_guilite/v17/.suo b/src/client_frontend_guilite/.vs/client_frontend_guilite/v17/.suo index 1fdc1ea..c91138f 100644 Binary files a/src/client_frontend_guilite/.vs/client_frontend_guilite/v17/.suo and b/src/client_frontend_guilite/.vs/client_frontend_guilite/v17/.suo differ diff --git a/src/client_frontend_guilite/.vs/client_frontend_guilite/v17/Browse.VC.db b/src/client_frontend_guilite/.vs/client_frontend_guilite/v17/Browse.VC.db index c8893ec..46f4256 100644 Binary files a/src/client_frontend_guilite/.vs/client_frontend_guilite/v17/Browse.VC.db and b/src/client_frontend_guilite/.vs/client_frontend_guilite/v17/Browse.VC.db differ diff --git a/src/client_frontend_guilite/.vs/client_frontend_guilite/v17/DocumentLayout.json b/src/client_frontend_guilite/.vs/client_frontend_guilite/v17/DocumentLayout.json index 453875a..9eed7c2 100644 --- a/src/client_frontend_guilite/.vs/client_frontend_guilite/v17/DocumentLayout.json +++ b/src/client_frontend_guilite/.vs/client_frontend_guilite/v17/DocumentLayout.json @@ -2,12 +2,20 @@ "Version": 1, "WorkspaceRootPath": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\", "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{C434E5CA-752E-4D35-9986-BECF1CC34A98}|client_frontend_guilite.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\connect.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{C434E5CA-752E-4D35-9986-BECF1CC34A98}|client_frontend_guilite.vcxproj|solutionrelative:connect.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, + { + "AbsoluteMoniker": "D:0:0:{C434E5CA-752E-4D35-9986-BECF1CC34A98}|client_frontend_guilite.vcxproj|C:\\USERS\\JANIS\\DOCUMENTS\\PROJEKTE_MIT_C\\MA\\MA\\SRC\\CLIENT_BACKEND\\WELL_KNOWN.H||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, { "AbsoluteMoniker": "D:0:0:{C434E5CA-752E-4D35-9986-BECF1CC34A98}|client_frontend_guilite.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\main.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{C434E5CA-752E-4D35-9986-BECF1CC34A98}|client_frontend_guilite.vcxproj|solutionrelative:main.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, { - "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\well_known.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + "AbsoluteMoniker": "D:0:0:{C434E5CA-752E-4D35-9986-BECF1CC34A98}|client_frontend_guilite.vcxproj|C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\connect.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{C434E5CA-752E-4D35-9986-BECF1CC34A98}|client_frontend_guilite.vcxproj|solutionrelative:connect.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" } ], "DocumentGroupContainers": [ @@ -17,8 +25,33 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 1, + "SelectedChildIndex": 0, "Children": [ + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "connect.cpp", + "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\connect.cpp", + "RelativeDocumentMoniker": "connect.cpp", + "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\connect.cpp", + "RelativeToolTip": "connect.cpp", + "ViewState": "AQIAACEAAAAAAAAAAAAIwC0AAAArAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", + "WhenOpened": "2024-03-19T18:03:49.536Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 3, + "Title": "connect.h", + "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\connect.h", + "RelativeDocumentMoniker": "connect.h", + "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\connect.h", + "RelativeToolTip": "connect.h", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAAcAAAAAAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", + "WhenOpened": "2024-03-19T18:03:42.761Z" + }, { "$type": "Document", "DocumentIndex": 1, @@ -27,22 +60,22 @@ "RelativeDocumentMoniker": "..\\client_backend\\well_known.h", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_backend\\well_known.h", "RelativeToolTip": "..\\client_backend\\well_known.h", - "ViewState": "AQIAAAAAAAAAAAAAAAAAAAQAAAAVAAAA", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAAQAAAA5AAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", - "WhenOpened": "2024-03-17T16:32:22.34Z" + "WhenOpened": "2024-03-17T16:32:22.34Z", + "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 0, + "DocumentIndex": 2, "Title": "main.cpp", "DocumentMoniker": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\main.cpp", "RelativeDocumentMoniker": "main.cpp", "ToolTip": "C:\\Users\\janis\\Documents\\Projekte_mit_c\\ma\\ma\\src\\client_frontend_guilite\\main.cpp", "RelativeToolTip": "main.cpp", - "ViewState": "AQIAAAYAAAAAAAAAAAAAAP0AAAAAAAAA", + "ViewState": "AQIAAAAAAAAAAAAAAAAAABYAAAAEAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", - "WhenOpened": "2024-03-14T19:45:55.142Z", - "EditorCaption": "" + "WhenOpened": "2024-03-14T19:45:55.142Z" } ] } diff --git a/src/client_frontend_guilite/.vs/client_frontend_guilite/v17/fileList.bin b/src/client_frontend_guilite/.vs/client_frontend_guilite/v17/fileList.bin index 89117ee..f55d7c9 100644 Binary files a/src/client_frontend_guilite/.vs/client_frontend_guilite/v17/fileList.bin and b/src/client_frontend_guilite/.vs/client_frontend_guilite/v17/fileList.bin differ diff --git a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/CL.command.1.tlog b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/CL.command.1.tlog index 5979398..bb1a1c0 100644 Binary files a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/CL.command.1.tlog and b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/CL.command.1.tlog differ diff --git a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/CL.read.1.tlog b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/CL.read.1.tlog index 2304742..994c3b4 100644 Binary files a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/CL.read.1.tlog and b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/CL.read.1.tlog differ diff --git a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/CL.write.1.tlog b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/CL.write.1.tlog index ee02041..2018095 100644 Binary files a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/CL.write.1.tlog and b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/CL.write.1.tlog differ diff --git a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/Cl.items.tlog b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/Cl.items.tlog index 3290d00..494cbea 100644 --- a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/Cl.items.tlog +++ b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/Cl.items.tlog @@ -1 +1,2 @@ +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_frontend_guilite\connect.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_frontend_guilite\client_f.c434e5ca\x64\Debug\connect.obj C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_frontend_guilite\main.cpp;C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_frontend_guilite\client_f.c434e5ca\x64\Debug\main.obj diff --git a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/client_frontend_guilite.write.1u.tlog b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/client_frontend_guilite.write.1u.tlog index 89ab401..3d388ba 100644 Binary files a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/client_frontend_guilite.write.1u.tlog and b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/client_frontend_guilite.write.1u.tlog differ diff --git a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/link.command.1.tlog b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/link.command.1.tlog index 2185688..e2382df 100644 Binary files a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/link.command.1.tlog and b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/link.command.1.tlog differ diff --git a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/link.read.1.tlog b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/link.read.1.tlog index ff721ee..00279a3 100644 Binary files a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/link.read.1.tlog and b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/link.read.1.tlog differ diff --git a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/link.secondary.1.tlog b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/link.secondary.1.tlog index c81bc17..f651fc8 100644 --- a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/link.secondary.1.tlog +++ b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/link.secondary.1.tlog @@ -1,2 +1,2 @@ -^C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_FRONTEND_GUILITE\CLIENT_F.C434E5CA\X64\DEBUG\MAIN.OBJ +^C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_FRONTEND_GUILITE\CLIENT_F.C434E5CA\X64\DEBUG\CONNECT.OBJ|C:\USERS\JANIS\DOCUMENTS\PROJEKTE_MIT_C\MA\MA\SRC\CLIENT_FRONTEND_GUILITE\CLIENT_F.C434E5CA\X64\DEBUG\MAIN.OBJ C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_frontend_guilite\client_f.c434e5ca\x64\Debug\client_frontend_guilite.ilk diff --git a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/link.write.1.tlog b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/link.write.1.tlog index b4257de..c3d3cd0 100644 Binary files a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/link.write.1.tlog and b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_f.c434e5ca.tlog/link.write.1.tlog differ diff --git a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_frontend_guilite.ilk b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_frontend_guilite.ilk index f32ae73..0860eac 100644 Binary files a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_frontend_guilite.ilk and b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_frontend_guilite.ilk differ diff --git a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_frontend_guilite.log b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_frontend_guilite.log index dc99186..7c44650 100644 --- a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_frontend_guilite.log +++ b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/client_frontend_guilite.log @@ -1,8 +1,4 @@ - main.cpp -C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\minwindef.h(130,1): warning C4005: "APIENTRY": Makro-Neudefinition - (Quelldatei „main.cpp“ wird kompiliert) - C:\vcpkg\vcpkg-2023.08.09\installed\x64-windows\include\GLFW\glfw3.h(123,1): - Siehe vorherige Definition von "APIENTRY" - + connect.cpp +C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_frontend_guilite\connect.cpp(44,11): warning C4101: "dwWritten": Unreferenzierte lokale Variable LINK : warning LNK4044: Nicht erkannte Option /lOpenGL; wird ignoriert. client_frontend_guilite.vcxproj -> C:\Users\janis\Documents\Projekte_mit_c\ma\ma\src\client_frontend_guilite\x64\Debug\client_frontend_guilite.exe diff --git a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/vc143.idb b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/vc143.idb index f939bc5..1f45f69 100644 Binary files a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/vc143.idb and b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/vc143.idb differ diff --git a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/vc143.pdb b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/vc143.pdb index 862ac38..e53f312 100644 Binary files a/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/vc143.pdb and b/src/client_frontend_guilite/client_f.c434e5ca/x64/Debug/vc143.pdb differ diff --git a/src/client_frontend_guilite/client_frontend_guilite.vcxproj b/src/client_frontend_guilite/client_frontend_guilite.vcxproj index 602c189..6264e7c 100644 --- a/src/client_frontend_guilite/client_frontend_guilite.vcxproj +++ b/src/client_frontend_guilite/client_frontend_guilite.vcxproj @@ -70,6 +70,9 @@ + + $(VC_IncludePath);$(WindowsSDK_IncludePath); + Level3 @@ -104,12 +107,14 @@ true _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true - $(VCPKG_ROOT) + $(VCPKG_ROOT); + + Console true - $(CoreLibraryDependencies);%(AdditionalDependencies);-lOpenGL + $(CoreLibraryDependencies);%(AdditionalDependencies);-lOpenGL; @@ -129,8 +134,12 @@ + + + + diff --git a/src/client_frontend_guilite/client_frontend_guilite.vcxproj.filters b/src/client_frontend_guilite/client_frontend_guilite.vcxproj.filters index 87acf48..c844216 100644 --- a/src/client_frontend_guilite/client_frontend_guilite.vcxproj.filters +++ b/src/client_frontend_guilite/client_frontend_guilite.vcxproj.filters @@ -18,5 +18,13 @@ Quelldateien + + Headerdateien + + + + + Headerdateien + \ No newline at end of file diff --git a/src/client_frontend_guilite/connect.cpp b/src/client_frontend_guilite/connect.cpp new file mode 100644 index 0000000..6288dc3 --- /dev/null +++ b/src/client_frontend_guilite/connect.cpp @@ -0,0 +1,64 @@ +#pragma warning(disable:4996) +#ifndef CONNECT_CPP +#define CONNECT_CPP +#include +#include +#include +#include "../client_backend/well_known.h" +int send_to_pipe(const std::string& message) { + HANDLE hPipe; + DWORD dwWritten; + std::ofstream (MAIN_COM_PATH);//enshure the file exists + hPipe = CreateFile(TEXT(MAIN_COM_PATH), + GENERIC_WRITE, + 0, + NULL, + OPEN_EXISTING, + 0, + NULL); + + if (hPipe != INVALID_HANDLE_VALUE) { + if (WriteFile(hPipe, + message.c_str(), + static_cast(message.size()), // Size of the message + &dwWritten, + NULL)) { + CloseHandle(hPipe); + return 0; // Success + } + else { + // Failed to write to pipe + CloseHandle(hPipe); + return 2; // Error writing to pipe + } + } + else { + // Failed to open pipe + DWORD dwError = GetLastError(); + return dwError; // Return the error code + } +} +std::string read_from_pipe() { + HANDLE hPipe; + DWORD dwRead; + DWORD dwWritten; + char buffer[1000]; + hPipe = CreateFile(TEXT(MAIN_COM_PATH), + GENERIC_READ | GENERIC_WRITE, + 0, + NULL, + OPEN_EXISTING, + 0, + NULL); + if (hPipe != INVALID_HANDLE_VALUE) + { + ReadFile(hPipe, buffer, sizeof(buffer), &dwRead, NULL); + CloseHandle(hPipe); + buffer[strlen(buffer) + 1] = '\0'; + return std::string(buffer); + } + else { + return "Error"; + } +} +#endif diff --git a/src/client_frontend_guilite/connect.h b/src/client_frontend_guilite/connect.h new file mode 100644 index 0000000..2cb8fa5 --- /dev/null +++ b/src/client_frontend_guilite/connect.h @@ -0,0 +1,10 @@ +#pragma once +#include +#include +#include +#include +#include +#include + +int send_to_pipe(const std::string& message); +std::string read_from_pipe(); diff --git a/src/client_frontend_guilite/main.cpp b/src/client_frontend_guilite/main.cpp index b81801c..62293ea 100644 --- a/src/client_frontend_guilite/main.cpp +++ b/src/client_frontend_guilite/main.cpp @@ -8,9 +8,11 @@ #include #include #include + #include "../client_backend/well_known.h" +#include "connect.h" // Function to simulate file scanning -void scan_file(nanogui::Screen*screen ,nanogui::Widget* contentWidget, const std::string& filePath) { +void scan_file(nanogui::Screen* screen, nanogui::Widget* contentWidget, const std::string& filePath) { // Remove the answer file std::remove(ANSWER_COM_PATH); // Display the scanned file path in the window @@ -18,16 +20,7 @@ void scan_file(nanogui::Screen*screen ,nanogui::Widget* contentWidget, const std screen->performLayout(); bool answered = false; // Write command into com file - std::ofstream outputFile(MAIN_COM_PATH); - if (outputFile.is_open()) { - outputFile << "scanfile \"" << filePath << "\""; - outputFile.close(); - } - else { - nanogui::Label* lineLabel2 = new nanogui::Label(contentWidget, "Error: Unable to talk to daemon!\n"); - screen->performLayout(); - return; - } + printf("%d\n",send_to_pipe("scanfile \"" + filePath + "\"")); while (!answered) { // Wait for answer in file std::ifstream inputFile(ANSWER_COM_PATH); @@ -81,7 +74,7 @@ void scan_file(nanogui::Screen*screen ,nanogui::Widget* contentWidget, const std } // Function to simulate folder scanning -void scan_folder(nanogui::Screen*screen,nanogui::Widget* contentWidget, const std::string& filePath) { +void scan_folder(nanogui::Screen* screen, nanogui::Widget* contentWidget, const std::string& filePath) { // Remove the answer file std::remove(ANSWER_COM_PATH); // Display the scanned folder path in the window @@ -223,7 +216,7 @@ int main() { ); if (!selectedFile.empty()) { // Call scan_file function in a separate thread - std::thread(scan_file,&screen, contentWidget, selectedFile).detach(); + std::thread(scan_file, &screen, contentWidget, selectedFile).detach(); } }); @@ -235,7 +228,7 @@ int main() { std::string selectedFolder = getFolderPath(); if (!selectedFolder.empty()) { // Call scan_folder function in a separate thread - std::thread(scan_folder, &screen,contentWidget, selectedFolder).detach(); + std::thread(scan_folder, &screen, contentWidget, selectedFolder).detach(); } }); @@ -255,7 +248,7 @@ int main() { // Scroll panel will automatically take the size of its content //scrollPanel->setFixedHeight(300); - screen.setVisible(true); + //screen.setVisible(true); screen.setLayout(layout); diff --git a/src/client_frontend_guilite/x64/Debug/client_frontend_guilite.pdb b/src/client_frontend_guilite/x64/Debug/client_frontend_guilite.pdb index 5c384a2..5e5f1e4 100644 Binary files a/src/client_frontend_guilite/x64/Debug/client_frontend_guilite.pdb and b/src/client_frontend_guilite/x64/Debug/client_frontend_guilite.pdb differ