feat(tools): 边界审计输出带目录定位
This commit is contained in:
1 parent
1c5dc3afb9
commit
d95e35e5c9
1 file changed
+4
-3
@@ -134,7 +134,7 @@ function IsBoundary(Buf, At) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function AuditPt(Body, Off, File, BitStart) {
|
||||
function AuditPt(Body, Off, File, BitStart, Label) {
|
||||
if (Off + 4 > Body.length) return;
|
||||
const Buf = Body;
|
||||
const C = Buf.readInt32BE(Off);
|
||||
@@ -164,7 +164,7 @@ function AuditPt(Body, Off, File, BitStart) {
|
||||
continue;
|
||||
}
|
||||
const Codec = Tables.CodecByKey.get(Key);
|
||||
const Where = File + ' 第 ' + (I + 1) + '/' + D + ' 项 ' + Id + '(' + Key + ')@' + At;
|
||||
const Where = (Label || File) + ' 第 ' + (I + 1) + '/' + D + ' 项 ' + Id + '(' + Key + ')@' + At;
|
||||
if (!Codec) {
|
||||
Stats.Bad++;
|
||||
Bump(Key || ('未注册:' + Id), true, Where);
|
||||
@@ -232,7 +232,8 @@ function ScanFile(File) {
|
||||
}
|
||||
for (const R of (Decoded && Decoded.Records) || []) {
|
||||
if (String(R.MethodId) !== PT_METHOD || R.Bad || R.At === undefined || R.Consumed === undefined) continue;
|
||||
AuditPt(Body, R.At + 16, path.basename(File), R.BitStart);
|
||||
const Label = path.basename(path.dirname(File)) + '/' + path.basename(File);
|
||||
AuditPt(Body, R.At + 16, path.basename(File), R.BitStart, Label);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user