{"record":{"id":"38df39d0255f5ef0","repo":"huiyadanli/RevokeMsgPatcher","slug":"match-part-replace","errorCode":"match_part_replace","errorMessage":"特征比对：部分特征已经被替换，请确认是否有使用过其他防撤回/多开补丁！","messagePattern":"特征比对：部分特征已经被替换，请确认是否有使用过其他防撤回/多开补丁！","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"RevokeMsgPatcher/Matcher/ModifyFinder.cs","lineNumber":79,"sourceCode":"                            $\"出现此种情况的一般有如下可能：\\n\" +\n                            $\"1. 你可能已经安装了某个功能的补丁，请选择未安装功能进行安装。\\n\" +\n                            $\"2. 如果当前版本为最新版本，特征码可能出现变化（可能性比较低），请联系作者处理。\");\n                    }\n                }\n            }\n            else\n            {\n                // 匹配数和需要替换的数量不一致时，可能时部分/所有特征已经被替换\n                if (matchNum != changes.Count)\n                {\n                    // 此逻辑在当前特征配置下不会进入，因为查找串和替换串当前全部都是不相同的\n                    if (changes.Count == 0)\n                    {\n                        throw new BusinessException(\"match_already_replace\", \"特征比对：当前应用已经安装了所选功能补丁！\");\n                    }\n                    else\n                    {\n                        throw new BusinessException(\"match_part_replace\", \"特征比对：部分特征已经被替换，请确认是否有使用过其他防撤回/多开补丁！\");\n                    }\n\n                }\n                else\n                {\n                    // 匹配数和需要替换的数量一致时才是正常状态\n                    return changes;\n                }\n            }\n        }\n\n        public static SortedSet<string> FindReplacedFunction(string path, List<ReplacePattern> replacePatterns)\n        {\n            Stopwatch sw = new Stopwatch();\n            sw.Start();\n            byte[] fileByteArray = File.ReadAllBytes(path);\n            Console.WriteLine(\"读取文件耗时：{0}ms.\", sw.Elapsed.TotalMilliseconds);\n            Tuple<bool, SortedSet<string>> res = IsAllReplaced(fileByteArray, replacePatterns);","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/huiyadanli/RevokeMsgPatcher/blob/89cbbb3f0cc896d5d092de0199a635c5c39944b6/RevokeMsgPatcher/Matcher/ModifyFinder.cs#L61-L97","documentation":"matchNum >= expected but matchNum != changes.Count and changes.Count > 0: some matched positions already equal the replace bytes while others still need patching. FindChanges throws BusinessException('match_part_replace'), suggesting a third-party anti-recall / multi-open patcher altered part of the file.","triggerScenarios":"A prior different patcher (or an older version of this tool) replaced some but not all signature locations, leaving the file in a half-patched state.","commonSituations":"Used another WeChat/QQ multi-open or anti-recall tool before this one; mixed usage of patchers.","solutions":["Restore the original DLL from a clean source (the tool's restore, or a fresh DLL).","Remove other patchers' modifications before using this tool."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"static bool IsBusinessException(Exception e, string code) => e is BusinessException b && b.ErrorCode == code;\n\nstatic bool IsPartReplaced(Exception e) => IsBusinessException(e, \"match_part_replace\");","tryCatchPattern":"try\n{\n    editor.TargetChanges = ModifyFinder.FindChanges(editor.FilePath, replacePatterns);\n}\ncatch (BusinessException ex) when (ex.ErrorCode == \"match_part_replace\")\n{\n    // Partly patched by another tool: require a clean restore first.\n    MessageBox.Show(\"检测到部分特征已被替换，请先还原原始文件。\");\n}","preventionTips":["Do not mix this patcher with other anti-recall/multi-open tools.","Restore a clean DLL before patching when 'match_part_replace' is seen.","Filter by ErrorCode 'match_part_replace' to distinguish from a clean already-patched file."],"tags":["matcher","conflict","business-exception"],"backgroundTag":null,"analyzedSha":"89cbbb3f0cc896d5d092de0199a635c5c39944b6","analyzedAt":"2026-08-13T10:37:37.073Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}