Added remote address and modules to agent structure. Help command now only shows commands for which the agent has been configured.

This commit is contained in:
Jakob Friedl
2025-10-02 10:25:37 +02:00
parent fbe85493b2
commit 5c0beb36ff
15 changed files with 92 additions and 77 deletions

View File

@@ -1,7 +1,7 @@
import tables, strformat
import ../common/types
const MODULES {.intdefine.} = 0
const MODULES* {.intdefine.} = 0
type
ModuleManager* = object
@@ -75,5 +75,10 @@ proc getCommandByName*(cmdName: string): Command =
proc getAvailableCommands*(): Table[string, Command] =
return manager.commandsByName
proc getModules*(): seq[Module] =
return manager.modules
proc getModules*(modules: uint32 = 0): seq[Module] =
if modules == 0:
return manager.modules
else:
for m in manager.modules:
if (modules and cast[uint32](m.moduleType)) == cast[uint32](m.moduleType):
result.add(m)