Documentation
¶
Overview ¶
Package wxkey is wechat-cli's thin client for the standalone `wxkey` CLI. The CLI handles task_for_pid + memory scan + SQLCipher verification; this package finds the binary, invokes `wxkey setup`, and parses the JSON it prints to stdout. First-run human/agent setup should usually call `wxkey bootstrap` explicitly; wechat-cli keeps runtime startup on the narrower setup path so it does not silently re-sign or restart WeChat.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindBinary ¶
FindBinary locates the wxkey CLI. Resolution order:
- $WX_KEY_BIN — explicit override
- next to the calling executable (the recommended distribution layout)
- PATH lookup
func SetupSupported ¶
func SetupSupported() bool
func UnsupportedSetupMessage ¶
func UnsupportedSetupMessage() string
Types ¶
type ImageKeyCommandResult ¶
type ImageKeyCommandResult struct {
PID int `json:"pid"`
Root string `json:"scan_root"`
WxID string `json:"wxid"`
ImageKey *ImageKeyResult `json:"image_key,omitempty"`
}
type ImageKeyResult ¶
type ImageKeyResult struct {
Key string `json:"key"`
XORKey *int `json:"xor_key,omitempty"`
TemplateFile string `json:"template_file,omitempty"`
TemplateSource string `json:"template_source,omitempty"`
Regions int `json:"regions,omitempty"`
BytesScanned uint64 `json:"bytes_scanned,omitempty"`
Candidates int `json:"candidates,omitempty"`
Elapsed json.RawMessage `json:"elapsed_ns,omitempty"`
}
func RunImageKey ¶
func RunImageKey(root string) (*ImageKeyResult, string, error)
type ResultEntry ¶
type SetupResult ¶
type SetupResult struct {
PID int `json:"pid"`
Root string `json:"scan_root"`
WxID string `json:"wxid"`
ConfigPath string `json:"config_path"`
Stats json.RawMessage `json:"stats"`
Results []ResultEntry `json:"results"`
ImageKey *ImageKeyResult `json:"image_key,omitempty"`
ImageKeyError string `json:"image_key_error,omitempty"`
Keys map[string]string `json:"-"` // populated from Results post-decode
}
SetupResult mirrors what `wxkey setup` writes to stdout. We only consume the bits wechat-cli needs.
func RunSetup ¶
func RunSetup() (*SetupResult, string, error)
RunSetup refreshes schema-2 per-DB keys. On macOS/Linux builds this invokes the standalone `wxkey setup` helper and parses its JSON output. On Windows it uses the in-process adapter in setup_windows.go.
The macOS path intentionally does not run `wxkey bootstrap`, because bootstrap may quit, ad-hoc re-sign, and reopen WeChat. stderrText is also returned so wechat-cli can surface progress / errors.