MCPcopy Create free account
hub / github.com/Adaptix-Framework/AdaptixC2 / TargetsAdd

Method TargetsAdd

AdaptixClient/Source/UI/Widgets/TargetsWidget.cpp:275–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273/// Sender
274
275void TargetsWidget::TargetsAdd(QList<TargetData> targetList)
276{
277 QJsonArray jsonArray;
278 for (const auto &target : targetList) {
279 QJsonObject obj;
280 obj["computer"] = target.Computer;
281 obj["domain"] = target.Domain;
282 obj["address"] = target.Address;
283 obj["os"] = target.Os;
284 obj["os_desk"] = target.OsDesc;
285 obj["tag"] = target.Tag;
286 obj["info"] = target.Info;
287 obj["alive"] = target.Alive;
288 jsonArray.append(obj);
289 }
290
291 QJsonObject dataJson;
292 dataJson["targets"] = jsonArray;
293 QByteArray jsonData = QJsonDocument(dataJson).toJson();
294
295 HttpReqTargetsCreateAsync(jsonData, *(adaptixWidget->GetProfile()), [](bool success, const QString &message, const QJsonObject&) {
296 if (!success)
297 MessageError(message);
298 });
299}
300
301/// Slots
302

Callers 3

onCreateTargetMethod · 0.95
targets_addMethod · 0.80
targets_add_listMethod · 0.80

Calls 5

MessageErrorFunction · 0.85
appendMethod · 0.80
toJsonMethod · 0.45
GetProfileMethod · 0.45

Tested by

no test coverage detected