MCPcopy Create free account
hub / github.com/Xenov-X/csbot / executeInjectLoadDll

Method executeInjectLoadDll

workflow/executor_spawn.go:442–467  ·  view source on GitHub ↗

executeInjectLoadDll loads a DLL from disk via LoadLibrary

(ctx context.Context, client *csclient.Client, beaconID string, action Action)

Source from the content-addressed store, hash-verified

440
441// executeInjectLoadDll loads a DLL from disk via LoadLibrary
442func (e *Executor) executeInjectLoadDll(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {
443 pidVal, ok := action.Parameters["pid"]
444 if !ok {
445 return "", fmt.Errorf("pid parameter required for inject_load_dll")
446 }
447 var pid int
448 switch v := pidVal.(type) {
449 case float64:
450 pid = int(v)
451 case int:
452 pid = v
453 default:
454 return "", fmt.Errorf("pid must be a number")
455 }
456
457 path, ok := action.Parameters["path"].(string)
458 if !ok {
459 return "", fmt.Errorf("path parameter required for inject_load_dll")
460 }
461
462 resp, err := client.InjectLoadDll(ctx, beaconID, pid, path)
463 if err != nil {
464 return "", err
465 }
466 return e.waitForOutput(ctx, client, resp.TaskID)
467}
468
469// --- PostEx DLL ---
470

Callers 1

executeActionMethod · 0.95

Calls 1

waitForOutputMethod · 0.95

Tested by

no test coverage detected