mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-24 23:06:51 +00:00
feat: 添加进程调试信息
- 显示找到的 WeChat 进程列表 - 更新 dylib 支持多进程名 - 帮助诊断附加失败问题
This commit is contained in:
@@ -13,6 +13,7 @@ export class KeyServiceMac {
|
|||||||
private GetDbKey: any = null
|
private GetDbKey: any = null
|
||||||
private ScanMemoryForImageKey: any = null
|
private ScanMemoryForImageKey: any = null
|
||||||
private FreeString: any = null
|
private FreeString: any = null
|
||||||
|
private ListWeChatProcesses: any = null
|
||||||
|
|
||||||
private getDylibPath(): string {
|
private getDylibPath(): string {
|
||||||
const isPackaged = app.isPackaged
|
const isPackaged = app.isPackaged
|
||||||
@@ -54,6 +55,7 @@ export class KeyServiceMac {
|
|||||||
this.GetDbKey = this.lib.func('const char* GetDbKey()')
|
this.GetDbKey = this.lib.func('const char* GetDbKey()')
|
||||||
this.ScanMemoryForImageKey = this.lib.func('const char* ScanMemoryForImageKey(int pid, const char* ciphertext)')
|
this.ScanMemoryForImageKey = this.lib.func('const char* ScanMemoryForImageKey(int pid, const char* ciphertext)')
|
||||||
this.FreeString = this.lib.func('void FreeString(const char* str)')
|
this.FreeString = this.lib.func('void FreeString(const char* str)')
|
||||||
|
this.ListWeChatProcesses = this.lib.func('const char* ListWeChatProcesses()')
|
||||||
|
|
||||||
this.initialized = true
|
this.initialized = true
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
@@ -72,9 +74,19 @@ export class KeyServiceMac {
|
|||||||
try {
|
try {
|
||||||
onStatus?.('正在获取数据库密钥...', 0)
|
onStatus?.('正在获取数据库密钥...', 0)
|
||||||
|
|
||||||
|
// 调试:列出所有 WeChat 进程
|
||||||
|
const procsPtr = this.ListWeChatProcesses()
|
||||||
|
if (procsPtr) {
|
||||||
|
const procs = this.koffi.decode(procsPtr, 'char', -1)
|
||||||
|
this.FreeString(procsPtr)
|
||||||
|
onStatus?.(`找到进程: ${procs}`, 0)
|
||||||
|
} else {
|
||||||
|
onStatus?.('未找到 WeChat 相关进程', 2)
|
||||||
|
}
|
||||||
|
|
||||||
const keyPtr = this.GetDbKey()
|
const keyPtr = this.GetDbKey()
|
||||||
if (!keyPtr) {
|
if (!keyPtr) {
|
||||||
onStatus?.('获取失败:WeChat 未运行或无法附加', 2)
|
onStatus?.('获取失败:WeChat 未运行或无法附加(可能需要授予调试权限)', 2)
|
||||||
return { success: false, error: 'WeChat 未运行或无法附加' }
|
return { success: false, error: 'WeChat 未运行或无法附加' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user