Panoptes 1.0.0
Endpoint Detection and Response
Loading...
Searching...
No Matches
error_message.cpp
Go to the documentation of this file.
1#include "error_message.h"
2#include "utils.h"
3#include <iostream>
4
5std::string GetErrorMessage( UINT resourceID)
6{
7 char buffer[MAX_PATH];
8 GetModuleFileNameA(NULL, buffer, MAX_PATH);
9 std::string::size_type pos = std::string(buffer).find_last_of("\\/");
10 std::string currentPath = std::string(buffer).substr(0, pos);
11
12 std::string fullPath = currentPath + "\\Resources.dll";
13
14 HMODULE hModule = LoadLibraryA(fullPath.c_str());
15 if(hModule == NULL)
16 return "";
17
18 char err_buffer[1024];
19 LoadStringA(hModule, resourceID, (LPSTR)err_buffer, MAX_PATH);
20
21 return std::string(err_buffer);;
22}
23
24void DisplayErrorMessage(std::string errorMessage)
25{
26 MessageBoxA(NULL, errorMessage.c_str(), "Panoptes EDR", MB_OK | MB_ICONERROR);
27 return;
28}
#define MAX_PATH
Definition callbacks.h:6
std::string GetErrorMessage(UINT resourceID)
void DisplayErrorMessage(std::string errorMessage)