aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorheqnx <root@heqnx.com>2025-06-03 23:06:02 +0300
committerheqnx <root@heqnx.com>2025-06-03 23:06:02 +0300
commit1e10fee9b60eec8b218776103c294464a9a7baee (patch)
tree806f877e501e38071492d54de0db902c922c0abe
parentcc8089f24b3a353f87d4892e9cc1e2aab74c9426 (diff)
downloadgo-assembly-ldr-1e10fee9b60eec8b218776103c294464a9a7baee.tar.gz
go-assembly-ldr-1e10fee9b60eec8b218776103c294464a9a7baee.zip
added author
-rw-r--r--main.go22
1 files changed, 21 insertions, 1 deletions
diff --git a/main.go b/main.go
index 0217b43..be6c8d9 100644
--- a/main.go
+++ b/main.go
@@ -603,6 +603,21 @@ namespace <%=obf Namespace %>
return nil
}
+func init() {
+ const usageHeader = `
+offensive security tool designed for generating encrypted and obfuscated loaders for .NET assemblies
+
+author: heqnx - https://heqnx.com
+
+`
+ flag.Usage = func() {
+ fmt.Fprint(os.Stderr, usageHeader)
+ fmt.Fprintf(os.Stderr, "usage of %s:\n", os.Args[0])
+ flag.PrintDefaults()
+ }
+ flag.CommandLine.SetOutput(os.Stderr)
+}
+
func main() {
filePath := flag.String("f", "", "input file path")
outputType := flag.String("t", "powershell", "loader type: powershell|msbuild|installutil")
@@ -612,6 +627,11 @@ func main() {
dotnetArch := flag.String("dotnet-architecture", "x64", ".net architecture for msbuild: x86|x64")
flag.Parse()
+ if flag.NFlag() == 0 && flag.NArg() == 0 {
+ flag.Usage()
+ os.Exit(1)
+ }
+
if *filePath == "" {
fmt.Println("[err] -f/--file is required")
flag.Usage()
@@ -654,7 +674,7 @@ func main() {
err = generateInstallUtilLdr(*filePath, *obfuscationLength, *keyLength, *encryptionType)
}
if err != nil {
- fmt.Printf("[err] %v\n", err)
+ fmt.Printf("%v\n", err)
os.Exit(1)
}
}