mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-07 11:03:55 +00:00
Updated a few things to help alleviate false positives with AV Vendors
This commit is contained in:
Binary file not shown.
@@ -6,11 +6,8 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
|
||||
//
|
||||
#include "afxres.h"
|
||||
//if using VS2019 pro edition, you will get error when try to build, so place "//" infront of the top line then add the following lines:
|
||||
// #include "WinResrc.h"
|
||||
// #define IDC_STATIC -1
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
@@ -72,7 +69,7 @@ END
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,2,1,3
|
||||
FILEVERSION 0,0,0,0
|
||||
PRODUCTVERSION 0,0,0,0
|
||||
FILEFLAGSMASK 0x17L
|
||||
#ifdef _DEBUG
|
||||
@@ -88,12 +85,8 @@ BEGIN
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "FileDescription", "Mesh Agent Service"
|
||||
VALUE "FileVersion", "0.2.1.3"
|
||||
VALUE "InternalName", "MeshAgent"
|
||||
VALUE "FileVersion", "0.0.0.0"
|
||||
VALUE "LegalCopyright", "Apache 2.0 License"
|
||||
VALUE "OriginalFilename", "MeshAgent.exe"
|
||||
VALUE "ProductName", "Mesh Agent Service"
|
||||
VALUE "ProductVersion", "0, 0, 0, 0"
|
||||
END
|
||||
END
|
||||
|
||||
@@ -180,6 +180,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PostBuildEventUseInBuild>false</PostBuildEventUseInBuild>
|
||||
<TargetName>$(ProjectName)64</TargetName>
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_NoOpenSSL|x64'">
|
||||
<PostBuildEventUseInBuild>false</PostBuildEventUseInBuild>
|
||||
|
||||
@@ -38,12 +38,6 @@ limitations under the License.
|
||||
#include "microscript/ILibDuktape_Commit.h"
|
||||
#include <shellscalingapi.h>
|
||||
|
||||
#ifndef _MINCORE
|
||||
// #include "../kvm/kvm.h"
|
||||
int SetupWindowsFirewall(wchar_t* processname);
|
||||
int ClearWindowsFirewall(wchar_t* processname);
|
||||
#endif
|
||||
|
||||
#if defined(WIN32) && defined (_DEBUG) && !defined(_MINCORE)
|
||||
#include <crtdbg.h>
|
||||
#define _CRTDBG_MAP_ALLOC
|
||||
@@ -167,7 +161,7 @@ void GdiPlusFlat_Release()
|
||||
|
||||
BOOL IsAdmin()
|
||||
{
|
||||
BOOL admin;
|
||||
BOOL admin = 0;
|
||||
PSID AdministratorsGroup;
|
||||
SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
|
||||
|
||||
@@ -805,40 +799,10 @@ int wmain(int argc, char* wargv[])
|
||||
int len = MeshInfo_GetSystemInformation(&data);
|
||||
if (len > 0) { printf_s(data); }
|
||||
}
|
||||
else if (argc > 1 && (strcasecmp(argv[1], "-setfirewall") == 0))
|
||||
{
|
||||
// Reset the firewall rules
|
||||
GetModuleFileNameW(NULL, str, _MAX_PATH);
|
||||
if (IsAdmin() == FALSE) { printf("Must run as administrator"); }
|
||||
else { ClearWindowsFirewall(str); SetupWindowsFirewall(str); printf("Done"); }
|
||||
}
|
||||
else if (argc > 1 && (strcasecmp(argv[1], "-clearfirewall") == 0))
|
||||
{
|
||||
// Clear the firewall rules
|
||||
GetModuleFileNameW(NULL, str, _MAX_PATH);
|
||||
if (IsAdmin() == FALSE) { printf("Must run as administrator"); }
|
||||
else { ClearWindowsFirewall(str); printf("Done"); }
|
||||
}
|
||||
#endif
|
||||
else if (argc == 2 && (strcasecmp(argv[1], "-resetnodeid") == 0))
|
||||
{
|
||||
// Set "resetnodeid" in registry
|
||||
HKEY hKey;
|
||||
#ifndef _WIN64
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Open Source\\MeshAgent2", 0, KEY_WRITE | KEY_WOW64_32KEY, &hKey) == ERROR_SUCCESS)
|
||||
#else
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Open Source\\MeshAgent2", 0, KEY_WRITE, &hKey) == ERROR_SUCCESS)
|
||||
#endif
|
||||
{
|
||||
i = 1;
|
||||
DWORD err = RegSetValueEx(hKey, "ResetNodeId", 0, REG_DWORD, (BYTE*)&i, (DWORD)4);
|
||||
if (err == ERROR_SUCCESS) { printf("NodeID will be reset next time the Mesh Agent service is started."); }
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Error writing to registry, try running as administrator.");
|
||||
}
|
||||
wmain_free(argv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user