MCPcopy Create free account
hub / github.com/NotRequiem/VMAware / parse_disable_token

Function parse_disable_token

src/cli/output.cpp:302–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302bool parse_disable_token(const char* token) {
303 const std::string tok(token);
304 std::vector<std::string> names;
305 std::string current;
306
307 for (const char c : tok) {
308 if (c == ',') {
309 if (!current.empty()) {
310 names.push_back(current);
311 current.clear();
312 }
313 } else {
314 current += c;
315 }
316 }
317
318 if (!current.empty()) {
319 names.push_back(current);
320 }
321
322 for (const auto& name : names) {
323 const std::pair<bool, VM::enum_flags> technique = string_to_technique(name);
324
325 const bool found = technique.first;
326 const VM::enum_flags flag = technique.second;
327
328 if (!found) {
329 std::cerr << "Unknown technique \"" << name << "\", aborting\n";
330 return false;
331 }
332
333 VM::disabled_techniques.push_back(flag);
334 }
335
336 return true;
337}
338
339void generate_json(const char* output) {
340 const VM::vmaware vm(VM::MULTIPLE);

Callers 1

mainFunction · 0.85

Calls 1

string_to_techniqueFunction · 0.85

Tested by

no test coverage detected