diff --git a/data/launcher.go b/data/launcher.go index 35e5715..a26ad47 100644 --- a/data/launcher.go +++ b/data/launcher.go @@ -30,6 +30,8 @@ type obDependency struct { obDepBFD []float64 } + +var Stdout string = "ENABLESTDOUT" const obErr = 1 const obCorrelationLevel = 0.4 const obStdLevel = 1 @@ -547,7 +549,7 @@ func obLauncher() { obStderrIn, _ := obCommand.StderrPipe() defer obStderrIn.Close() - obStdout, obErr := obStrconv.ParseBool("ENABLESTDOUT") + obStdout, obErr := obStrconv.ParseBool(Stdout) if obErr != nil { obExit() } diff --git a/internal/pakkero/pakkero.go b/internal/pakkero/pakkero.go index 0c16fc1..e60c962 100644 --- a/internal/pakkero/pakkero.go +++ b/internal/pakkero/pakkero.go @@ -70,6 +70,7 @@ func Pakkero(infile string, offset int64, outfile string, dependency string, com // packages fmt.Print(" → Registering Dependencies...") + Secrets[stdoutEnabledPlaceholder] = []string{"\"unset\"", "leaveunset"} // ------------------------------------------------------------------------ // Register eventual dependency passed by cli // If a dependency check is present, register it. @@ -91,8 +92,6 @@ func Pakkero(infile string, offset int64, outfile string, dependency string, com Secrets[offsetPlaceholder] = []string{fmt.Sprintf("%d", offset), GenerateTyposquatName(128)} - Secrets[stdoutEnabledPlaceholder] = []string{strconv.FormatBool(stdout), - GenerateTyposquatName(128)} // copy the stub from where to start. launcherStub, _ := base64.StdEncoding.DecodeString(LauncherStub) err := ioutil.WriteFile(launcherFile, launcherStub, 0644) @@ -134,8 +133,9 @@ func Pakkero(infile string, offset int64, outfile string, dependency string, com "-trimpath", "-gcflags", "-N -l -nolocalimports", - "-ldflags", - "-s -w -extldflags -static", + "-ldflags=" + + "-X main.Stdout=" + strconv.FormatBool(stdout) + + " -s -w -extldflags -static\"", } flags = append(flags, "-o") flags = append(flags, outfile)