mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-26 13:11:53 +08:00
Expand i18n coverage
This commit is contained in:
@@ -26,10 +26,10 @@ func NewWinIFEOPlugin() *WinIFEOPlugin {
|
||||
func (p *WinIFEOPlugin) Scan(ctx context.Context, info *common.HostInfo, session *common.ScanSession) *plugins.Result {
|
||||
pePath := session.Config.WinPEFile
|
||||
if pePath == "" {
|
||||
return &plugins.Result{Success: false, Error: fmt.Errorf("%s", i18n.GetText("local_pe_not_specified"))}
|
||||
return &plugins.Result{Success: false, Error: fmt.Errorf("%s", i18n.GetText("local_pe_not_specified"))}
|
||||
}
|
||||
if _, err := os.Stat(pePath); err != nil {
|
||||
return &plugins.Result{Success: false, Error: fmt.Errorf("%s", i18n.Tr("local_pe_not_found", pePath))}
|
||||
return &plugins.Result{Success: false, Error: fmt.Errorf("%s", i18n.Tr("local_pe_not_found", pePath))}
|
||||
}
|
||||
|
||||
absPath, _ := filepath.Abs(pePath)
|
||||
@@ -39,9 +39,9 @@ func (p *WinIFEOPlugin) Scan(ctx context.Context, info *common.HostInfo, session
|
||||
exe string
|
||||
desc string
|
||||
}{
|
||||
{"sethc.exe", "粘滞键 (Shift×5)"},
|
||||
{"utilman.exe", "辅助功能 (Win+U)"},
|
||||
{"narrator.exe", "讲述人"},
|
||||
{"sethc.exe", i18n.GetText("winifeo_sticky_keys")},
|
||||
{"utilman.exe", i18n.GetText("winifeo_accessibility")},
|
||||
{"narrator.exe", i18n.GetText("winifeo_narrator")},
|
||||
}
|
||||
|
||||
var output strings.Builder
|
||||
@@ -51,10 +51,10 @@ func (p *WinIFEOPlugin) Scan(ctx context.Context, info *common.HostInfo, session
|
||||
key := fmt.Sprintf(`HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\%s`, t.exe)
|
||||
out, err := exec.Command("reg", "add", key, "/v", "Debugger", "/t", "REG_SZ", "/d", absPath, "/f").CombinedOutput()
|
||||
if err != nil {
|
||||
output.WriteString(fmt.Sprintf("[失败] %s: %s\n", t.desc, strings.TrimSpace(string(out))))
|
||||
output.WriteString(i18n.Tr("local_step_failed", t.desc, strings.TrimSpace(string(out))) + "\n")
|
||||
continue
|
||||
}
|
||||
output.WriteString(fmt.Sprintf("[成功] %s (%s)\n", t.desc, t.exe))
|
||||
output.WriteString(i18n.Tr("local_step_success_detail", t.desc, t.exe) + "\n")
|
||||
successCount++
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user