mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-12-04 05:43:27 +01:00
A signal killed the process mid-run and left the snapshot's copies of browser files in the temp dir. The run now stops at its next step, removes them, and ends by the same signal, so the exit status and calling scripts see what they did before. RFC-012 also keeps the list goldens in cmd.
31 lines
700 B
Go
31 lines
700 B
Go
//go:build windows
|
|
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/inconshreveable/mousetrap"
|
|
"github.com/spf13/cobra"
|
|
"golang.org/x/sys/windows"
|
|
|
|
"github.com/moond4rk/hackbrowserdata/internal/winapi"
|
|
)
|
|
|
|
// configureDoubleClickMode hides the console and bypasses cobra's
|
|
// double-click guard when launched from Explorer (issue #344).
|
|
func configureDoubleClickMode() {
|
|
if !mousetrap.StartedByExplorer() {
|
|
return
|
|
}
|
|
|
|
cobra.MousetrapHelpText = ""
|
|
winapi.HideConsoleWindow()
|
|
}
|
|
|
|
// exitBy ends the process with the status Windows gives a console process that Ctrl-C or closing the console ends.
|
|
func exitBy(os.Signal) {
|
|
status := uint32(windows.STATUS_CONTROL_C_EXIT)
|
|
os.Exit(int(int32(status)))
|
|
}
|