commit: add source

This commit is contained in:
kernelstub
2026-06-13 15:48:59 +02:00
parent aefef00f79
commit faa0ce7a67
48 changed files with 4037 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
package core
import "fmt"
const banner = `
_____ _____ _____ _____ _____ _____
| __| __| __ | __ | | | |
| __| __| -| -| | | | | |
|__| |_____|__|__|__|__|_____|_|_|_|
Ferrum Windows Vulnerability Research Framework
Build : %s
Author: Kernelstub
#########################################
`
func Banner(build string) string {
return fmt.Sprintf(banner, build)
}
+17
View File
@@ -0,0 +1,17 @@
package core
type Logger interface {
Info(message string)
Success(message string)
Error(message string)
Verbose(message string)
}
type Context struct {
Logger Logger
Build string
}
func NewContext(logger Logger, build string) *Context {
return &Context{Logger: logger, Build: build}
}
+47
View File
@@ -0,0 +1,47 @@
package core
import (
"fmt"
"sort"
"strings"
"sync"
)
type Module interface {
Name() string
Description() string
Run(ctx *Context) error
}
var (
mu sync.RWMutex
registry = make(map[string]Module)
)
func Register(module Module) {
name := strings.ToLower(strings.TrimSpace(module.Name()))
if name == "" {
panic("module name cannot be empty")
}
mu.Lock()
defer mu.Unlock()
if _, exists := registry[name]; exists {
panic(fmt.Sprintf("module already registered: %s", name))
}
registry[name] = module
}
func Modules() []Module {
mu.RLock()
defer mu.RUnlock()
modules := make([]Module, 0, len(registry))
for _, module := range registry {
modules = append(modules, module)
}
sort.Slice(modules, func(i, j int) bool {
return modules[i].Name() < modules[j].Name()
})
return modules
}