shadow1ng/fscan · error
%s: %w [keylogger_entry_write_failed]
Error message
%s: %w [keylogger_entry_write_failed]
What it means
Raised in saveKeysToFile when writing one buffered keystroke entry to the file fails; the localized 'keylogger_write_failed'-style message wraps the I/O error and the bracketed marker keylogger_entry_write_failed identifies the stage.
Source
Thrown at plugins/local/keylogger.go:191
return fmt.Errorf("%s: %w", i18n.GetText("output_file_open_failed"), err)
}
defer func() { _ = file.Close() }()
// 写入头部信息
header := i18n.GetText("keylogger_log_header") + "\n"
header += i18n.Tr("local_start_time", time.Now().Format("2006-01-02 15:04:05")) + "\n"
header += i18n.Tr("local_platform", runtime.GOOS) + "\n"
header += i18n.Tr("keylogger_event_count", len(p.keyBuffer)) + "\n"
header += "========================\n\n"
if _, err := file.WriteString(header); err != nil {
return fmt.Errorf("%s: %w", i18n.GetText("keylogger_header_write_failed"), err)
}
// 写入键盘记录
for _, entry := range p.keyBuffer {
if _, err := file.WriteString(entry + "\n"); err != nil {
return fmt.Errorf("%s: %w", i18n.GetText("keylogger_entry_write_failed"), err)
}
}
return nil
}
// 平台特定的键盘记录实现 - 简化版本,仅做演示
func (p *KeyloggerPlugin) startWindowsKeylogging(ctx context.Context) error {
// Windows平台键盘记录实现
// 在实际实现中需要使用Windows API
p.addKeyToBuffer(i18n.GetText("keylogger_demo_windows"))
// 模拟记录一段时间
select {
case <-ctx.Done():
return ctx.Err()
case <-time.After(5 * time.Second):
// 模拟结束View on GitHub (pinned to 95cc12e753)
Solutions
- Check disk space and file permissions
- Retry the save — the buffer is only cleared after successful persistence
- Move the output to a healthy filesystem
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at plugins/local/keylogger.go:191 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of shadow1ng/fscan@95cc12e753 (2026-09-06).
Data as JSON: /api/errors/7e901c494cbf769f.
Report an issue: GitHub.