Releases: yydfh33/DivaScanner
Release list
DivaScanner v0.2.0-beta
⚠️ If you used v0.1.0-beta, read this first
v0.1.0-beta could corrupt your mod files.
It identified a database's type by trying each reader in turn and keeping the first one that did not throw. These formats are permissive enough that the wrong reader "succeeds" and returns nonsense, so files were routinely misidentified. Repairing such a file wrote it back through the wrong writer.
In one observed case a mod_spr_db.bin was saved through the texture-database writer: 1376 bytes became 240, most of the sprite data was gone, and the game would no longer start.
How to check your install: open repair_history.log in your mods folder. Any entry whose Type= does not match the file it was written to — for example Type=Texture written to a *_spr_db.bin — means that file was damaged. The .bak file beside it is the original from before the repair; rename it back to restore.
What's fixed
- The database type now comes from the file name instead of being guessed by trial, so a file is never handled as the wrong kind.
- Mismatched writes are refused before anything is written. The file is left byte-for-byte untouched.
- Every write is verified and rolled back on failure. The saved file is reloaded and checked; if it no longer parses or the ID count changed, it is restored from
.bakand an error is reported. A repair can no longer report success while leaving a broken file behind. - Object IDs beyond 16 bits are rejected. MikuMikuLibrary's writer produces a file its own reader cannot load once an object ID reaches 65536.
- The scan cache carries a version stamp. A cached entry is only reused when it was produced by the current parser; otherwise files you never touched would keep their old, incorrect results forever.
- Memory is compacted after a scan. Scanning left a large resident working set that could slow down the whole machine, not just this program.
- The log file is no longer wiped at the start of every scan. A repair triggers a rescan, which previously erased the log of the repair itself.
Known limitations
- Some database files cannot be parsed by MikuMikuLibrary at all. They are now reported honestly as unrecognised rather than being assigned a wrong type. Conflicts inside them are not visible — safer than the previous behaviour of inventing false ones from garbage data.
- Texture conflict counts will rise substantially, because texture databases were not being read correctly before. Do not compare these numbers against older versions.
Requirements
中文说明
⚠️ 使用过 v0.1.0-beta 的用户请先看这里
v0.1.0-beta 可能损毁你的 mod 文件。
它靠依次尝试各个读取器来判断数据库类型,谁先不抛异常就算谁。这些格式足够宽松,错误的读取器同样能"成功"并返回垃圾数据,因此文件经常被判错类型。对这类文件执行修复,就会用错误的格式写回。
在一个实例中,某个 mod_spr_db.bin 被当作贴图数据库保存:1376 字节只剩 240 字节,sprite 数据大部分丢失,游戏无法启动。
自查方法:打开 mods 目录下的 repair_history.log,如果某条记录的 Type= 与被写入的文件不符(例如 Type=Texture 写向 *_spr_db.bin),该文件已被损坏。它旁边的 .bak 是修复前的原始文件,改回原名即可恢复。
本次修复
- 数据库类型改为依文件名确定,不再靠试探,文件不会再被当作错误的类型处理
- 类型不符的写入在动手之前就被拒绝,文件一字节不变
- 每次写入都会校验,失败自动回滚:保存后重新载入检查,若无法解析或 ID 数量变化,则从
.bak恢复并报错。不会再出现"提示修复成功、文件却已损坏" - 拒绝超出 16 位的 object ID:MikuMikuLibrary 的写入器在 object ID 达到 65536 时会产出自己都读不回来的文件
- 扫描缓存增加版本戳:仅当缓存由当前解析器产生时才复用,否则你从未改动过的文件会一直沿用旧的错误结果
- 扫描后压缩回收内存:此前扫描会留下大量常驻内存,可能拖慢整台机器而不只是本程序
- 不再于每次扫描开头清空日志文件:修复会触发自动重扫,而重扫原先会把修复本身的日志抹掉
已知限制
- 有些数据库文件 MikuMikuLibrary 确实无法解析。它们现在被如实标记为无法识别,而不是被安上一个错误的类型。其中的冲突暂时不可见——这比此前用垃圾数据编造出虚假冲突要安全
- 贴图冲突数会明显上升,因为此前贴图数据库并未被正确读取。请勿与旧版本的数字对比
运行要求
DivaScanner v0.1.0-beta ⚠️ Withdrawn / 已撤回
⚠️ This release has been withdrawn — do not use
v0.1.0-beta can corrupt your mod files. The download has been removed from this page.
When repairing, it identified a database's type by trying each reader in turn and keeping the first
one that did not throw. These formats are permissive enough that the wrong reader "succeeds" and
returns nonsense, so files were routinely misidentified and then written back through the wrong
writer. In one observed case a mod_spr_db.bin was saved as a texture database: 1376 bytes became
240, most of the sprite data was gone, and the game would no longer start.
Please use v0.2.0-beta
instead. It cannot cause this damage: mismatched writes are refused before anything is written,
and every write is verified and rolled back on failure.
If you already ran a repair with v0.1.0-beta
Open repair_history.log in your mods folder. Any entry whose Type= does not match the file it
was written to — for example Type=Texture written to a *_spr_db.bin — means that file was
damaged. The .bak file beside it is the original from before the repair; rename it back to
restore.
The source code and tag are kept for history.
⚠️ 此版本已撤回,请勿使用
v0.1.0-beta 可能损毁你的 mod 文件。 下载附件已从本页移除。
它在修复时靠依次尝试各个读取器来判断数据库类型,谁先不抛异常就算谁。这些格式足够宽松,错误的读取器同样能"成功"并返回垃圾数据,因此文件经常被判错类型,随后又被用错误的格式写回。在一个实例中,某个 mod_spr_db.bin 被当作贴图数据库保存:1376 字节只剩 240 字节,sprite 数据大部分丢失,游戏无法启动。
请改用 v0.2.0-beta。 它不会再造成此类损坏:类型不符的写入在动手之前就被拒绝,且每次写入都会校验,失败自动回滚。
如果你已经用 v0.1.0-beta 修复过
打开 mods 目录下的 repair_history.log,如果某条记录的 Type= 与被写入的文件不符(例如 Type=Texture 写向 *_spr_db.bin),该文件已被损坏。它旁边的 .bak 是修复前的原始文件,改回原名即可恢复。
源码与标签保留,以存历史。