feat: re-instrument per STUB rules - all silent placeholders now panic

- PE-E03 pe_loader.c: unsupported base-reloc type silently skipped -> panic
- PE-E04 pe_shim.c ReadFile: fake TRUE+0-bytes ("pretend EOF") -> panic
- PE-E05 pe_shim.c CreateFileA: no file backend -> panic (no honest-failure excuse)
- PE-E06/E07 x86emu32.c: emu IAT unimplemented API / shim index OOB -> panic
- NETST-E01 net.c: netdev stats all-zero placeholder ("lying zero traffic") -> panic
- apic.c comment: SIPI reserved now points to DKM-E03 skeleton
- pe_dll_manager comments: circular-dep stub call now documented as PE-E01
- virtio_blk.c: capacity declaration marked as instrumentation whitelist
- QEMU verify: wizard -> Save -> verify ok -> login success -> desktop ready,
  zero spurious panics

[STUB] P1/UTSM/pe+net re-instrument sweep | 剩余STUB命中=101 (全部为 panic 坐标注释 /
IDT halt-stub 防御术语 / 白名单) | “未成之物,不留活口”
This commit is contained in:
Linehu
2026-10-03 12:44:57 +08:00
parent cd39caa10c
commit 301006d611
13 changed files with 78 additions and 18 deletions
+13 -5
View File
@@ -216,10 +216,12 @@ static u64 __attribute__((ms_abi)) shim_WriteFile(u64 handle, u64 buffer, u64 le
static u64 __attribute__((ms_abi)) shim_ReadFile(u64 handle, u64 buffer, u64 max_length,
u64 bytes_read_ptr, u64 overlapped) {
(void)handle; (void)buffer; (void)max_length; (void)overlapped;
/* 暂不支持输入读取;lpNumberOfBytesRead 同为 DWORD*(4 字节) */
u64 brp = gp(bytes_read_ptr);
if (brp) *(u32 *)brp = 0;
return 1;
/* 严格错误策略插桩:读取路径未实现。此前返回 TRUE+0 字节是
* "假装能跑"——PE 应用以为读到了 EOF。零降级 panic(PE-E04)。 */
log_error("[PE] ReadFile called on shim without input backend");
panic_full("PE-E04 READFILE INPUT NOT IMPLEMENTED",
"shim ReadFile has no input backend: designed, not implemented", 0);
return 0;
}
static u64 __attribute__((ms_abi)) shim_ExitProcess(u64 exit_code) {
@@ -287,7 +289,13 @@ static u64 __attribute__((ms_abi)) shim_GetEnvironmentVariableA(u64 name, u64 bu
static u64 __attribute__((ms_abi)) shim_CreateFileA(u64 filename, u64 access, u64 share,
u64 sa, u64 disp, u64 flags, u64 template) {
(void)filename; (void)access; (void)share; (void)sa; (void)disp; (void)flags; (void)template;
return 0; /* 暂不支持文件 */
/* 严格错误策略插桩:文件访问未实现。返回 INVALID_HANDLE 是诚实的
* Win32 失败语义(应用可自行处理),但功能本身未实现——按零降级
* 原则 panic(PE-E05),不做"假装没有文件"的静默降级。 */
log_error("[PE] CreateFileA called: file IO not implemented");
panic_full("PE-E05 FILE IO NOT IMPLEMENTED",
"shim CreateFileA: file backend designed, not implemented", 0);
return 0;
}
static u64 __attribute__((ms_abi)) shim_CloseHandle(u64 handle) { (void)handle; return 1; }
static u64 __attribute__((ms_abi)) shim_GetFileSize(u64 handle, u64 high) {