diff --git a/docs/research/2026-10-17-direct-api-scope-evidence.json b/docs/research/2026-10-17-direct-api-scope-evidence.json new file mode 100644 index 0000000..059a728 --- /dev/null +++ b/docs/research/2026-10-17-direct-api-scope-evidence.json @@ -0,0 +1,133 @@ +{ + "source_hashes_unchanged": true, + "cases": [ + { + "case": "add-part-plain", + "error": "com_error(-2147352567, '发生意外。', (6055, 'DxDesigner', 'Symbol RESISTOR:res01.1 not found, empty or a block.', None, 0, 0), None)", + "returned": null, + "changed_count": 0, + "dialogs": [], + "call_seconds": null, + "changed_refdes": [] + }, + { + "case": "add-part-qualified", + "error": "com_error(-2147352567, '发生意外。', (6055, 'DxDesigner', 'Symbol RESISTOR:skyworth:res01.1 not found, empty or a block.', None, 0, 0), None)", + "returned": null, + "changed_count": 0, + "dialogs": [], + "call_seconds": null, + "changed_refdes": [] + }, + { + "case": "add-part-full", + "error": null, + "returned": null, + "changed_count": 1, + "dialogs": [], + "call_seconds": 0.9060000000026776, + "changed_refdes": [], + "native_part_created": { + "uid": "$2I2277", + "refdes": "R?", + "part": "4100-CA0000-T0", + "label": "0R", + "value": "", + "cell": "RESC1608N", + "location": [ + 5000, + 5000 + ], + "orientation": 0, + "name_query_result": "$2I2277" + } + }, + { + "case": "change-uid-symbol", + "error": "com_error(-2147352567, '发生意外。', (1186, 'DxDesigner', 'No components found to change', None, 0, 0), None)", + "returned": null, + "changed_count": 0, + "dialogs": [], + "call_seconds": null, + "changed_refdes": [] + }, + { + "case": "change-uid-part", + "error": "com_error(-2147352567, '发生意外。', (1186, 'DxDesigner', 'No components found to change', None, 0, 0), None)", + "returned": null, + "changed_count": 0, + "dialogs": [], + "call_seconds": null, + "changed_refdes": [] + }, + { + "case": "change-symbol-qualified", + "error": null, + "returned": true, + "changed_count": 19, + "dialogs": [], + "call_seconds": 2.8439999999973224, + "changed_refdes": [ + "RV19", + "RV08", + "RV16", + "RV05", + "RV02", + "RV11", + "RV09", + "RV03", + "RV13", + "RV12", + "RV06", + "RV07", + "RV17", + "RV10", + "RV14", + "RV04", + "RV15", + "RV18", + "RV01" + ] + }, + { + "case": "ccomp-symbol", + "error": null, + "returned": false, + "changed_count": 0, + "dialogs": [ + { + "title": "Change Component", + "text": [ + "自定义 2", + "确定(&O)", + "取消(&C)" + ] + } + ], + "call_seconds": 0.15600000000267755, + "changed_refdes": [] + }, + { + "case": "ccomp-part", + "error": null, + "returned": false, + "changed_count": 0, + "dialogs": [ + { + "title": "Change Component", + "text": [ + "自定义 2", + "确定(&O)", + "取消(&C)" + ] + } + ], + "call_seconds": 0.375, + "changed_refdes": [] + } + ], + "notes": [ + "name_query_result is an instance-name query from the initial probe, not a library-symbol identity.", + "ChangeComponentPreserveRefdes was tested with only RV05 selected, but changed 19 same-symbol page components." + ] +} \ No newline at end of file diff --git a/docs/research/2026-10-17-replacement-cli-alternative.md b/docs/research/2026-10-17-replacement-cli-alternative.md new file mode 100644 index 0000000..219ba72 --- /dev/null +++ b/docs/research/2026-10-17-replacement-cli-alternative.md @@ -0,0 +1,43 @@ +# 替换 CLI 替代:核心调用与无弹窗实验 + +这份记录继续验证本机 Mentor 7.9.5EE 的实际替换路径。原生清单 CLI 已接入;这里研究的是写入替换,不把查询成功视为替换成功。正式替换后端未切换,没有打包或发布。 + +## 已确认的原生提交链 + +在全新 Audio 测试副本中,只替换 RV05,保留同料号 RV11。多断点跟踪完成原生替换、保存重开和独立磁盘读回,全部跟踪进程退出,私有桌面释放,来源工程哈希未变。 + +实际命中顺序(均为本机二进制 RVA): + +| 阶段 | 模块与入口 | 证据 | +| --- | --- | --- | +| 打开替换窗口 | viewdraw.exe `0x207bd0 → 0x167880` | WM_COMMAND 33977 的 MFC handler 与委托函数均命中 | +| 接收选料 | viewdraw.exe `0x168190` | 返回地址位于 PlaceDevice.dll `0x1e67b` | +| 提交替换 | viewdraw.exe `0x432f90` | 返回地址为 viewdraw.exe `0x262676`,对应调用点 `0x262671` | + +`0x432f90` 也是旧 `ccomp` 命令静态引用的核心。命令 handler 传入多个空字符串,原生选料提交路径传入目标数据;存在共同核心不代表 `ccomp` 已提供完整的料号替换参数。 + +本次提交栈的 flags 为 9。提交后只读检查相关内存,取得目标料号 `4100-CA0000-T0`、Part Name `RESC1608N`、Part Label `0R`,与实际读回一致。该检查发生在函数返回之后,仅作辅助证据,不能用于认定完整参数类型或对象生命周期。 + +ICE70.dll 的 `replaceSymbols` 导出入口 `0x17c800` 及内部跳转目标 `0x17bd80` 均未命中。调试器跟踪了模块卸载和重载;结论仅适用于这次同符号替换,不能推广到所有替换。 + +PlaceDevice.dll 有 `NotifySelectionObservers`、`SelectLibrarySymbol`、`CreatePDController` 等 C++ 导出,当前没有取得可用类型库。它传递选择事件并需要已初始化的 CAD、库服务及回调对象,不能作为独立替换 EXE 调用。 + +## 公开 API 的实际边界 + +- `AddPartInstance("skyworth", "4100-CA0000-T0", "res01.1", x, y)` 已无弹窗创建库件,取得真实 Part Name 和 Part Label。第一个参数在此安装中需要符号分区。 +- `ChangeComponentPreserveRefdes` 的两个参数均为字符串。传精确 UID 报未找到器件;传符号名时,即使只选择 RV05,也实际改变页内 19 个同符号器件,包含 RV11,并清空部分物料属性,不能用作精确位号替换。 +- 创建新器件后删除旧器件,即使坐标与方向一致,也会失去旧引脚网络连接;零长度 AddNet 未能恢复。这条实验路径已排除。 + +直接接口的范围证据见 [JSON](2026-10-17-direct-api-scope-evidence.json)。 + +## 同符号原位实验与属性层级 + +原型通过 `AddPartInstance` 创建远处未连接的目标模板,从库模板取得属性,再应用到原器件;删除模板,保留原器件 UID、坐标、方向和连接。仅覆盖单 gate、同符号、同引脚编号集合。 + +首个原型只写 `InstanceValue`。CAD 保存重开核验通过;当前工具的分层清单却仍返回旧料号。进一步用 `icdb2ascii` 的 flat 和 instance 报告核实:新料号和封装已写到实例属性,基础属性仍旧。不能把该现象误判为完全没有保存,也不能忽略分层采集与有效实例值的差别。 + +该原型与原生替换的 flat 输出已逐器件、逐引脚比较:57 个器件、103 个引脚、22 个网络一致。比较保留引脚对应的连接,仅忽略同层属性顺序。分层输出仍有差别,因此尚未将它认定为等价的正式后端。 + +只改 `Value` 的对照实验在 Part Name 的有效值断言处失败,说明已有实例值会覆盖基础值。正在继续验证同时同步基础与实例属性,并补查无效料号和命令边界。实验脚本与工程副本保存在忽略目录 build 中,均为研究原型。 + +核心调用证据见 [JSON](2026-10-17-replacement-core-trace-evidence.json)。所有内部地址都需要匹配模块哈希,不能写成跨版本正式接口。 diff --git a/docs/research/2026-10-17-replacement-core-trace-evidence.json b/docs/research/2026-10-17-replacement-core-trace-evidence.json new file mode 100644 index 0000000..df9e789 --- /dev/null +++ b/docs/research/2026-10-17-replacement-core-trace-evidence.json @@ -0,0 +1,297 @@ +{ + "installation": "Mentor 7.9.5EE", + "scope": "Fresh Audio test-project copy, RV05 only; same skyworth:res01 symbol; PartLabel copied to Value", + "verified": true, + "source_hashes_unchanged": true, + "process_count": 17, + "debug_event_count": 7888, + "all_process_exit_codes": [ + 0, + 1 + ], + "still_alive": {}, + "errors": [], + "hits": [ + { + "seconds": 253.14100000000326, + "label": "wm_command_handler_A", + "module": "viewdraw.exe", + "rva": 2128848, + "stack_words": [ + 1558943379, + 218711080, + 24049612, + 1558943861, + 33977, + 57, + 219817104, + 218711080, + 0, + 24049676, + 1558960284, + 33977, + 0, + 0, + 0, + 2524577804 + ], + "resolved_return_addresses": [ + { + "module": "C:\\Windows\\WinSxS\\Fusion\\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_none_eaa49612b1f5b2ea\\9.0\\9.0.30729.6161\\mfc90.dll", + "rva": "0x89693", + "address": "0x5ceb9693" + }, + { + "module": "C:\\Windows\\WinSxS\\Fusion\\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_none_eaa49612b1f5b2ea\\9.0\\9.0.30729.6161\\mfc90.dll", + "rva": "0x89875", + "address": "0x5ceb9875" + }, + { + "module": "C:\\Windows\\WinSxS\\Fusion\\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_none_eaa49612b1f5b2ea\\9.0\\9.0.30729.6161\\mfc90.dll", + "rva": "0x8d89c", + "address": "0x5cebd89c" + }, + { + "module": "C:\\Windows\\WinSxS\\Fusion\\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_none_eaa49612b1f5b2ea\\9.0\\9.0.30729.6161\\mfc90.dll", + "rva": "0x61670", + "address": "0x5ce91670" + }, + { + "module": "D:\\Mentor\\7.9.5EE\\SDD_HOME\\wv\\win32\\bin\\viewdraw.exe", + "rva": "0x1b6d61", + "address": "0x5b6d61" + } + ] + }, + { + "seconds": 253.23500000000058, + "label": "replace_dialog_entry", + "module": "viewdraw.exe", + "rva": 1472640, + "stack_words": [ + 1558943379, + 218711080, + 24049612, + 1558943861, + 33977, + 57, + 219817104, + 218711080, + 0, + 24049676, + 1558960284, + 33977, + 0, + 0, + 0, + 2524577804 + ], + "resolved_return_addresses": [ + { + "module": "C:\\Windows\\WinSxS\\Fusion\\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_none_eaa49612b1f5b2ea\\9.0\\9.0.30729.6161\\mfc90.dll", + "rva": "0x89693", + "address": "0x5ceb9693" + }, + { + "module": "C:\\Windows\\WinSxS\\Fusion\\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_none_eaa49612b1f5b2ea\\9.0\\9.0.30729.6161\\mfc90.dll", + "rva": "0x89875", + "address": "0x5ceb9875" + }, + { + "module": "C:\\Windows\\WinSxS\\Fusion\\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_none_eaa49612b1f5b2ea\\9.0\\9.0.30729.6161\\mfc90.dll", + "rva": "0x8d89c", + "address": "0x5cebd89c" + }, + { + "module": "C:\\Windows\\WinSxS\\Fusion\\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_none_eaa49612b1f5b2ea\\9.0\\9.0.30729.6161\\mfc90.dll", + "rva": "0x61670", + "address": "0x5ce91670" + }, + { + "module": "D:\\Mentor\\7.9.5EE\\SDD_HOME\\wv\\win32\\bin\\viewdraw.exe", + "rva": "0x1b6d61", + "address": "0x5b6d61" + } + ] + }, + { + "seconds": 263.8439999999973, + "label": "replace_dialog_impl_A", + "module": "viewdraw.exe", + "rva": 1474960, + "stack_words": [ + 234350203, + 470834792, + 24049844, + 24049900, + 24049956, + 24049928, + 217320392, + 64396220, + 554450416, + 554450416, + 554687208, + 1958530064, + 216733504, + 24049700, + 0, + 470834792 + ], + "resolved_return_addresses": [ + { + "module": "D:\\Mentor\\7.9.5EE\\SDD_HOME\\common\\win32\\lib\\PlaceDevice.dll", + "rva": "0x1e67b", + "address": "0xdf7e67b" + } + ] + }, + { + "seconds": 269.5, + "label": "legacy_change_core", + "module": "viewdraw.exe", + "rva": 4403088, + "stack_words": [ + 6694518, + 435566232, + 523421360, + 554450456, + 554450224, + 470833488, + 0, + 9, + 2390341880, + 10882096, + 162418352, + 24048864, + 0, + 9, + 16777217, + 523421360 + ], + "resolved_return_addresses": [ + { + "module": "D:\\Mentor\\7.9.5EE\\SDD_HOME\\wv\\win32\\bin\\viewdraw.exe", + "rva": "0x262676", + "address": "0x662676" + } + ] + }, + { + "seconds": 425.8289999999979, + "label": "replace_query_factory", + "module": "viewdraw.exe", + "rva": 2017440, + "stack_words": [ + 6664601, + 1, + 2390340768, + 0, + 12331056, + 24051408, + 27089544, + 27089544, + 216441600, + 24051408, + 1559013441, + 27089544, + 0, + 15, + 24051556, + 10348040 + ], + "resolved_return_addresses": [ + { + "module": "D:\\Mentor\\7.9.5EE\\SDD_HOME\\wv\\win32\\bin\\viewdraw.exe", + "rva": "0x25b199", + "address": "0x65b199" + } + ] + }, + { + "seconds": 425.8600000000006, + "label": "replace_dialog_impl_B", + "module": "viewdraw.exe", + "rva": 1475872, + "stack_words": [ + 5666157, + 1, + 2390340752, + 162417904, + 162417904, + 24051340, + 10214643, + 1, + 5666520, + 12331056, + 6814637, + 1, + 2390340776, + 10615712, + 162519336, + 24051420 + ], + "resolved_return_addresses": [ + { + "module": "D:\\Mentor\\7.9.5EE\\SDD_HOME\\wv\\win32\\bin\\viewdraw.exe", + "rva": "0x16756d", + "address": "0x56756d" + } + ] + } + ], + "negative_points": [ + { + "module": "viewdraw.exe", + "label": "wm_command_handler_B", + "rva": 2133696 + }, + { + "module": "viewdraw.exe", + "label": "ccomp_handler", + "rva": 630032 + }, + { + "module": "ICE70.dll", + "label": "ice_replace_export", + "rva": 1558528 + }, + { + "module": "ICE70.dll", + "label": "ice_replace_body", + "rva": 1555840 + } + ], + "readback": [ + { + "uid": "$2I2014", + "refdes": "RV05", + "part": "4100-CA0000-T0", + "value": "0R" + }, + { + "uid": "$2I2022", + "refdes": "RV11", + "part": "4100-CA0000-T7", + "value": "0R" + } + ], + "limitations": [ + "One same-symbol replacement; no inference for other symbols or installations.", + "Observed flags value 9 is not decoded as Library Wins.", + "Runtime addresses and internal ABI are not public CLI contracts.", + "Debugger timing is not a performance benchmark." + ], + "module_identities": [ + { + "module": "viewdraw.exe", + "process": "viewdraw.exe", + "sha256": "80f7350dbfd283f637df15e513d1a0657b5ac908f30e9a0e540ca3d8c978e07a" + }, + { + "module": "ICE70.dll", + "process": "viewdraw.exe", + "sha256": "83f696cc3a7b75ed926f7b6150a05e318fbbe62336ff43e5b202abe5e12fa297" + } + ], + "nonzero_exit_notes": "A startup conhost.exe exited with code 1. All tracked vendor processes and workload exited 0; CAD/desktop cleanup was independently confirmed." +} \ No newline at end of file