e055cb1d7c
Project CI / AI game creator shell Rust lane 2/2 (push) Has been cancelled
Project CI / AI game creator shell Rust smoke (push) Has been cancelled
Project CI / AI game creator shell Rust crates (push) Has been cancelled
Project CI / Backend tests (push) Has been cancelled
Project CI / Native shell tests (push) Has been cancelled
Project CI / Frontend tests (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
Project CI / AI game creator shell web tests (push) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (push) Has been cancelled
- 新增 scripts/pe-version-info.mjs:纯 Node 解析 PE RT_VERSION(VS_FIXEDFILEINFO + StringFileInfo),带非 PE 输入失败关闭的用例 - check:agc-update-channel-manifests:下载 Windows 安装包后断言 ProductName 与 FileVersion,与 mac 侧解 Info.plist 对称;实测 dev-win 0.1.155=陶泥儿开发版/0.1.155、release-win 0.1.150=陶泥儿 Release/0.1.150 - 渠道化与渠道隔离里程碑记录:dev-win 0.1.155 于 14:26:13 发布完成(总号/清单/旧协议指针三者对齐),但该构建源码早于 assertArtifactVersionMatches,守卫仍待下次真实构建验证 - decision-log 与 pitfalls 补记 PE 侧核对口径
32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
|
|
import { readPortableExecutableVersionInfo } from './pe-version-info.mjs';
|
|
|
|
// 真实安装包(dev-win 0.1.154 / release-win 0.1.150)已在本轮用线上对象验证过解析结果;
|
|
// 这里只守住「非 PE 输入必须失败关闭」这条,避免解析器坏掉时静默返回空身份。
|
|
test('rejects buffers that are not PE files', () => {
|
|
assert.throws(
|
|
() => readPortableExecutableVersionInfo(Buffer.alloc(128)),
|
|
/不是 PE 文件/u,
|
|
);
|
|
assert.throws(
|
|
() => readPortableExecutableVersionInfo('not a buffer'),
|
|
/需要传入 PE 文件的 Buffer/u,
|
|
);
|
|
});
|
|
|
|
test('rejects a PE without a version resource', () => {
|
|
const buffer = Buffer.alloc(512);
|
|
buffer.writeUInt16LE(0x5a4d, 0);
|
|
buffer.writeUInt32LE(0x80, 0x3c);
|
|
buffer.writeUInt32LE(0x00004550, 0x80);
|
|
buffer.writeUInt16LE(1, 0x84 + 2);
|
|
buffer.writeUInt16LE(0xe0, 0x84 + 16);
|
|
buffer.writeUInt16LE(0x10b, 0x98);
|
|
assert.throws(
|
|
() => readPortableExecutableVersionInfo(buffer),
|
|
/没有资源目录|RT_VERSION|属于任何节/u,
|
|
);
|
|
});
|