@@ -21,13 +21,13 @@ import (
2121 "github.com/hillu/go-yara/v4"
2222)
2323
24- const FASTFINDER_VERSION = "2.0.0b "
24+ const FASTFINDER_VERSION = "2.0.0 "
2525const YARA_VERSION = "4.1.3"
2626const BUILDER_RC4_KEY = ">Õ°ªKb{¡§ÌB$lMÕ±9l.tòÑ馨¿"
2727
2828func main () {
2929 // parse configuration file
30- parser := argparse .NewParser ("fastfinder" , "Incident Response - Fast suspicious file finder" )
30+ parser := argparse .NewParser ("fastfinder" , "Fastfinder v" + FASTFINDER_VERSION + " (with YARA " + YARA_VERSION + ")" + LineBreak + " \t \t \t Incident Response - Fast suspicious file finder" )
3131 pConfigPath := parser .String ("c" , "configuration" , & argparse.Options {Required : false , Default : "" , Help : "Fastfind configuration file" })
3232 pSfxPath := parser .String ("b" , "build" , & argparse.Options {Required : false , Help : "Output a standalone package with configuration and rules in a single binary" })
3333 pOutLogPath := parser .String ("o" , "output" , & argparse.Options {Required : false , Help : "Save fastfinder logs in the specified file" })
@@ -42,59 +42,64 @@ func main() {
4242 log .Fatal (parser .Usage (err ))
4343 }
4444
45+ RunProgramWithParameters (* pConfigPath , * pSfxPath , * pOutLogPath , * pHideWindow , * pDisableAdvUI , * pLogVerbosity , * pTriage )
46+ }
47+
48+ // RunProgramWithParameters used specified argv and run fastfinder
49+ func RunProgramWithParameters (pConfigPath string , pSfxPath string , pOutLogPath string , pHideWindow bool , pDisableAdvUI bool , pLogVerbosity int , pTriage bool ) {
4550 // enable advanced UI
46- if * pTriage || * pDisableAdvUI || * pHideWindow || len (* pSfxPath ) > 0 {
51+ if pTriage || pDisableAdvUI || pHideWindow || len (pSfxPath ) > 0 {
4752 UIactive = false
4853 } else {
4954 InitUI ()
5055 }
5156
5257 // display open file dialog when config file empty
53- if len (* pConfigPath ) == 0 {
58+ if len (pConfigPath ) == 0 {
5459 InitUI ()
5560 OpenFileDialog ()
56- * pConfigPath = UIselectedConfigPath
61+ pConfigPath = UIselectedConfigPath
5762 }
5863
5964 // check for log path validity
60- if len (* pOutLogPath ) > 0 {
61- if strings .Contains (* pOutLogPath , " " ) {
65+ if len (pOutLogPath ) > 0 {
66+ if strings .Contains (pOutLogPath , " " ) {
6267 LogFatal ("Log file path cannot contain spaces" )
6368 }
6469 }
6570
6671 // init progressbar object
67- EnableProgressbar (* pDisableAdvUI )
72+ EnableProgressbar (pDisableAdvUI )
6873
6974 // configuration parsing
7075 var config Configuration
71- config .getConfiguration (* pConfigPath )
76+ config .getConfiguration (pConfigPath )
7277 if config .Output .FilesCopyPath != "" {
7378 config .Output .FilesCopyPath = "./"
7479 }
7580
7681 // window hidden
77- if * pHideWindow && len (* pSfxPath ) == 0 {
82+ if pHideWindow && len (pSfxPath ) == 0 {
7883 HideConsoleWindow ()
7984 }
8085
8186 // output log to file
82- if len (* pOutLogPath ) > 0 && len (* pSfxPath ) == 0 {
83- loggingPath = * pOutLogPath
87+ if len (pOutLogPath ) > 0 && len (pSfxPath ) == 0 {
88+ loggingPath = pOutLogPath
8489 }
8590
8691 // file logging verbosity
87- if * pLogVerbosity >= 1 && * pLogVerbosity <= 4 {
88- loggingVerbosity = * pLogVerbosity
92+ if pLogVerbosity >= 1 && pLogVerbosity <= 4 {
93+ loggingVerbosity = pLogVerbosity
8994 }
9095
9196 // run app
9297 if UIactive {
93- go MainFastfinderRoutine (config , * pConfigPath , * pDisableAdvUI , * pHideWindow , * pSfxPath , * pTriage , * pOutLogPath , * pLogVerbosity )
98+ go MainFastfinderRoutine (config , pConfigPath , pDisableAdvUI , pHideWindow , pSfxPath , pTriage , pOutLogPath , pLogVerbosity )
9499 MainWindow ()
95100 } else {
96101 LogMessage (LOG_INFO , LineBreak + "================================================" + LineBreak + RenderFastfinderLogo ()+ "================================================" + LineBreak )
97- MainFastfinderRoutine (config , * pConfigPath , * pDisableAdvUI , * pHideWindow , * pSfxPath , * pTriage , * pOutLogPath , * pLogVerbosity )
102+ MainFastfinderRoutine (config , pConfigPath , pDisableAdvUI , pHideWindow , pSfxPath , pTriage , pOutLogPath , pLogVerbosity )
98103 }
99104
100105}
0 commit comments