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

Method add

AdaptixClient/Source/Client/AxScript/AxCommandWrappers.cpp:194–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192QJSEngine* AxCommandGroupWrapper::getEngine() const { return this->engine; }
193
194void AxCommandGroupWrapper::add(const QJSValue &value)
195{
196 if (value.isUndefined() || value.isNull())
197 return;
198
199 if (value.isArray()) {
200 const int length = value.property("length").toInt();
201 for (int i = 0; i < length; ++i) {
202 QJSValue item = value.property(i);
203
204 QObject* obj = item.toQObject();
205 if (auto* commandWrapper = qobject_cast<AxCommandWrappers*>(obj)) {
206 this->commands.append(commandWrapper->getCommand());
207 } else {
208 Q_EMIT scriptError("Item at index " + QString::number(i) + " is not an Command");
209 }
210 }
211 }
212 else {
213 QObject* obj = value.toQObject();
214 if (auto* commandWrapper = qobject_cast<AxCommandWrappers*>(obj)) {
215 this->commands.append(commandWrapper->getCommand());
216 } else {
217 Q_EMIT scriptError("Item is not an Command");
218 }
219 }
220}

Callers 12

AddTunnelItemMethod · 0.45
AddDownloadItemMethod · 0.45
flushPendingCredsMethod · 0.45
AddCredentialsItemsMethod · 0.45
flushPendingTasksMethod · 0.45
AddTaskItemMethod · 0.45
flushPendingTargetsMethod · 0.45
AddTargetsItemsMethod · 0.45
AddListenerItemMethod · 0.45
flushPendingAgentsMethod · 0.45
AddAgentItemMethod · 0.45
AddScreenshotItemMethod · 0.45

Calls 4

propertyMethod · 0.80
appendMethod · 0.80
getCommandMethod · 0.80
isNullMethod · 0.45

Tested by

no test coverage detected