MCPcopy Create free account
hub / github.com/dobin/RedEdr / ShutdownPplService

Function ShutdownPplService

RedEdr/pplmanager.cpp:129–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127
128
129BOOL ShutdownPplService() {
130 LOG_A(LOG_INFO, "ETW-TI: ShutdownPplService()");
131 char buffer[PPL_CONFIG_LEN] = { 0 };
132
133 try {
134 // Create JSON object for shutdown command
135 nlohmann::json j;
136 j["command"] = "shutdown";
137
138 std::string json_str = j.dump();
139
140 // Validate JSON string length
141 if (json_str.length() >= (PPL_CONFIG_LEN - 1)) {
142 LOG_A(LOG_ERROR, "ETW-TI: Shutdown JSON payload too long: %zu characters", json_str.length());
143 return FALSE;
144 }
145
146 // Copy JSON string to buffer
147 strncpy_s(buffer, PPL_CONFIG_LEN, json_str.c_str(), _TRUNCATE);
148
149 if (!pipeClient.Send(buffer)) {
150 LOG_A(LOG_ERROR, "ETW-TI: Error writing shutdown JSON to named pipe: %ld", GetLastError());
151 return FALSE;
152 }
153 pipeClient.Disconnect();
154 return TRUE;
155 }
156 catch (const std::exception& ex) {
157 LOG_A(LOG_ERROR, "ETW-TI: JSON serialization error for shutdown: %s", ex.what());
158 return FALSE;
159 }
160}
161
162
163BOOL InstallElamCertPpl()

Callers 1

mainFunction · 0.85

Calls 5

dumpMethod · 0.80
SendMethod · 0.80
DisconnectMethod · 0.80
LOG_AFunction · 0.70
whatMethod · 0.45

Tested by

no test coverage detected