Panoptes 1.0.0
Endpoint Detection and Response
Loading...
Searching...
No Matches
Functions
PanoptesLinter.h File Reference
#include <Windows.h>
#include <iostream>
#include <string>
#include <fstream>
#include <vector>

Go to the source code of this file.

Functions

bool FileExists (const std::string &filePath)
 Check if a file exists.
 
void RemoveStringFromVector (std::vector< std::string > &vec, const std::string &str)
 Remove a string from a vector

 
bool IsStringInVector (const std::vector< std::string > &vec, const std::string &str)
 Check if a string is in a vector.
 

Function Documentation

◆ FileExists()

bool FileExists ( const std::string &  filePath)

Check if a file exists.

Parameters
filePathThe path to the file
Returns
True if the file exists, false otherwise

Check if a file exists.

Parameters
filePathThe path to the file
Returns
True if the file exists, false otherwise

Definition at line 22 of file PanoptesLinter.cpp.

22 {
23 DWORD fileAttributes = GetFileAttributesA(filePath.c_str());
24 return (fileAttributes != INVALID_FILE_ATTRIBUTES &&
25 !(fileAttributes & FILE_ATTRIBUTE_DIRECTORY));
26}
unsigned long DWORD
Definition inject.h:2

Referenced by InstallPanoptes(), main(), and UninstallPanoptes().

◆ IsStringInVector()

bool IsStringInVector ( const std::vector< std::string > &  vec,
const std::string &  str 
)

Check if a string is in a vector.

Parameters
vecThe vector to check
strThe string to check
Returns
True if the string is in the vector, false otherwise

Definition at line 39 of file PanoptesLinter.cpp.

39 {
40 return std::find(vec.begin(), vec.end(), str) != vec.end();
41}

Referenced by main().

◆ RemoveStringFromVector()

void RemoveStringFromVector ( std::vector< std::string > &  vec,
const std::string &  str 
)

Remove a string from a vector

Parameters
vecThe vector to remove the string from
strThe string to remove

Remove a string from a vector

Parameters
vecThe vector to remove the string from
strThe string to remove

Definition at line 31 of file PanoptesLinter.cpp.

31 {
32 vec.erase(std::remove(vec.begin(), vec.end(), str), vec.end());
33}

Referenced by main().