Skip to content

Commit

Permalink
fix: gen_agent should abort when OS choice is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
jm33-m0 committed Jan 31, 2024
1 parent 5cd567d commit a8c2142
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/lib/cc/buildAgent.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ func GenAgent() (agent_binary_path string) {
outfile = fmt.Sprintf("%s/agent_linux_%s_%d-%d-%d_%d-%d-%d",
EmpWorkSpace, arch_choice,
now.Year(), now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second())
}
if is_win {
} else if is_win {
CliPrintInfo("You chose Windows")
if CliYesNo("Generate for 32 bit Windows") {
arch_choice = "386"
Expand All @@ -71,13 +70,15 @@ func GenAgent() (agent_binary_path string) {
outfile = fmt.Sprintf("%s/agent_windows_%s_%d-%d-%d_%d-%d-%d.exe",
EmpWorkSpace, arch_choice,
now.Year(), now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second())
}
if is_dll {
} else if is_dll {
CliPrintInfo("You chose Windows DLL")
stubFile = fmt.Sprintf("%s-%s", emp3r0r_data.Stub_Windows_DLL, arch_choice)
outfile = fmt.Sprintf("%s/agent_windows_%s_%d-%d-%d_%d-%d-%d.dll",
EmpWorkSpace, arch_choice,
now.Year(), now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second())
} else {
CliPrintError("Invalid choice")
return
}

// is this stub file available?
Expand Down

0 comments on commit a8c2142

Please sign in to comment.