Style/formatting cleanup in detection scripts

Normalize whitespace and formatting across multiple db/*.sg detection scripts: reindent code blocks, consolidate var declarations, reflow conditional expressions and comments, add missing trailing newlines, and standardize a version string to "2.71.X". Updated files include db/Binary/audio.AIFF.1.sg, db/PE/packer_RLPack.2.sg, db/PE/players.1.sg, db/PE/protector_PE-Shield.2.sg, db/PE/sfx_LZH_SFX.1.sg, db/PE/sfx_Zip_SFX.2.sg, db_extra/LX/PKZIP-SFX.1.sg, db_extra/LX/RAR-SFX.1.sg, db_extra/PE/ARDI-SFX.1.sg, db_extra/PE/installer_TInstall.1.sg, and db_extra/PE/installer_instyler.1.sg. These are primarily non-functional formatting changes; no logic alterations were intended except the noted version string normalization.
This commit is contained in:
DosX 2026-05-03 13:46:04 +03:00
commit 1fb558e833
11 changed files with 60 additions and 59 deletions

View file

@ -7,47 +7,47 @@ meta("audio", "Audio Interchange file (");
/* beautify ignore:start */
function detect() {
if (!X.c("'FORM' ........ 'AIF'") || !['F','C'].includes(fc=X.SA(0xB,1))) return;
if (!X.c("'FORM' ........ 'AIF'") || !['F', 'C'].includes(fc = X.SA(0xB, 1))) return;
if (fc == 'F') sName += '.AIF,.aiff)'; else sName += '.aifc)';
if (fc == 'F') sName += '.AIF,.aiff)'; else sName += '.aifc)';
var bad = '', dur = -1, p = 0xC, end = false, sz = X.U32(4,_BE)+0x8,
comm = ssnd = -1,
ch = sr = smp = smpsz = bps = 0, co = '';
var bad = '', dur = -1, p = 0xC, end = false, sz = X.U32(4, _BE) + 0x8,
comm = ssnd = -1,
ch = sr = smp = smpsz = bps = 0, co = '';
while(p < sz) {
var hkhd = X.SA(p,4), hksz = X.U32(p+4,_BE), fubar = false;
if (hksz > 0xFFFF)
if(hkhd != "SSND")
if(hkhd == "NONE") {
// https://www.mmsp.ece.mcgill.ca/Documents/AudioFormats/AIFF/Samples/CCRMA/digit0v0.aiff has a F.U.B.A.R. chunk
hksz = X.U8(p+4); fubar = true
}
else { bad = bad.addIfNone('!badchunk'); break }
while (p < sz) {
var hkhd = X.SA(p, 4), hksz = X.U32(p + 4, _BE), fubar = false;
if (hksz > 0xFFFF)
if (hkhd != "SSND")
if (hkhd == "NONE") {
// https://www.mmsp.ece.mcgill.ca/Documents/AudioFormats/AIFF/Samples/CCRMA/digit0v0.aiff has a F.U.B.A.R. chunk
hksz = X.U8(p + 4); fubar = true
}
else { bad = bad.addIfNone('!badchunk'); break }
//_l2r('aif',p,hkhd+' -> '+Hex(p+(fubar ? 5 : 8)+hksz));
if(!charStat(hkhd,1).includes('allasc')) break; p += fubar ? 6+(hksz & 1) : 8;
switch(hkhd) {
case "COMM": if (comm > 0) bad = bad.addIfNone('!manyCOMMs');
comm = p; if (hksz < 0x12) return;
ch = X.I16(p,_BE); smp = X.U32(p+2,_BE); smpsz = X.I16(p+6,_BE); sr = readFloat80(p+8,_BE);
if (hksz > 0x12) co = X.SA(p+0x12,hksz-0x12);
break;
case "SSND": ssnd = p; break
}
p += hksz + (hksz & 1)
}
//_l2r('aif',p,'sr:'+sr+' smp:'+smp+' comm:'+comm+' ssnd:'+ssnd+' bad:'+bad);
if(comm < 0 || ssnd < 0) return;
//_l2r('aif',p,hkhd+' -> '+Hex(p+(fubar ? 5 : 8)+hksz));
if (!charStat(hkhd, 1).includes('allasc')) break; p += fubar ? 6 + (hksz & 1) : 8;
switch (hkhd) {
case "COMM": if (comm > 0) bad = bad.addIfNone('!manyCOMMs');
comm = p; if (hksz < 0x12) return;
ch = X.I16(p, _BE); smp = X.U32(p + 2, _BE); smpsz = X.I16(p + 6, _BE); sr = readFloat80(p + 8, _BE);
if (hksz > 0x12) co = X.SA(p + 0x12, hksz - 0x12);
break;
case "SSND": ssnd = p; break
}
p += hksz + (hksz & 1)
}
//_l2r('aif',p,'sr:'+sr+' smp:'+smp+' comm:'+comm+' ssnd:'+ssnd+' bad:'+bad);
if (comm < 0 || ssnd < 0) return;
bDetected = true;
bDetected = true;
if(X.isVerbose()) {
var nmSeconds = Math.round(smp / sr * 10000) / 10;
dur = new Date(nmSeconds).toISOString().substr(11, 8);
sOption('ch:' + ch + ' s/r:' + Math.round(sr) + 'Hz '+ (dur !== -1 ? ' len: '+dur : '') +' co:' + co + ' sz:' + outSz(sz))
}
if (X.isVerbose()) {
var nmSeconds = Math.round(smp / sr * 10000) / 10;
dur = new Date(nmSeconds).toISOString().substr(11, 8);
sOption('ch:' + ch + ' s/r:' + Math.round(sr) + 'Hz ' + (dur !== -1 ? ' len: ' + dur : '') + ' co:' + co + ' sz:' + outSz(sz))
}
return result();
return result();
}
/* beautify ignore:end */

View file

@ -46,7 +46,7 @@ function detect() {
} else if (PE.getNumberOfImports() === 1 && PE.compareEP("60") && PE.isSectionNamePresent(".RLPack")) {
bDetected = true;
} else if (PE.compareEP("eb$$9c60e8........33c08bc483c0..938be3")) {
sVersion = "1.16-1.21";
sVersion = "1.16-1.21";
bDetected = true;
}

View file

@ -11,7 +11,7 @@ function detect() {
sOptions = "by www.tlxsoft.com";
bDetected = true;
} else if (PE.compareOverlay("'------'") && PE.isSignaturePresent(PE.getOverlayOffset(), 0x110, "'CM3PKG'")) {
//doesn't work: PE.compareOverlay("'CM3PKG'", PE.getOverlayOffset() + 0x100)
//doesn't work: PE.compareOverlay("'CM3PKG'", PE.getOverlayOffset() + 0x100)
sName = "ComicMaker";
sVersion = "3";
bDetected = true;

View file

@ -25,8 +25,8 @@ function detect() {
bDetected = true;
}
var peShieldSection = PE.section["PESHiELD"];
var peAnakinSection = PE.section["ANAKiN98"];
var peShieldSection = PE.section["PESHiELD"],
peAnakinSection = PE.section["ANAKiN98"];
if (!bDetected) {
if (PE.isImportPositionHashPresent(0, 0x3651f68d) && (peShieldSection || peAnakinSection)) {

View file

@ -10,15 +10,15 @@ function detect() {
sOptions = "by Yoshi 1991 / mH 1995 / Micco 1997-99";
bDetected = true;
} else if (PE.compareOverlay("........'-lh'..'-'")) {
sVersion = "2.71.x";
sVersion = "2.71.X";
sOptions = "by Yoshi 1991 / mH 1995 / Micco 1997-99";
bDetected = true;
}
} else if (PE.compareEP("a1........c1e0..a3........575133c0bf........b9........3bcf") && //Borland C++
(PE.isSignaturePresent(PE.getOverlayOffset(), 4096, "'-lh'..'-'"))) {
sOptions = "custom";
bDetected = true;
}
PE.isSignaturePresent(PE.getOverlayOffset(), 4096, "'-lh'..'-'")) {
sOptions = "custom";
bDetected = true;
}
return result();
}

View file

@ -66,8 +66,8 @@ function detect() {
bDetected = true;
}
}
if (PE.compareEP("a1........c1e0..a3........575133c0bf........b9........3bcf76") //Borland C++
&& (PE.isSignaturePresent(PE.getOverlayOffset(), 4096, "'PK'0304"))) {
if (PE.compareEP("a1........c1e0..a3........575133c0bf........b9........3bcf76") && //Borland C++
PE.isSignaturePresent(PE.getOverlayOffset(), 4096, "'PK'0304")) {
sOptions = "custom";
bDetected = true;
}

View file

@ -11,4 +11,4 @@ function detect() {
}
return result();
}
}

View file

@ -15,4 +15,4 @@ function detect() {
}
return result();
}
}

View file

@ -13,5 +13,6 @@ function detect() {
bDetected = true;
}
}
return result();
}

View file

@ -4,8 +4,8 @@
meta("installer", "TInstall");
function detect() {
if (PE.compareEP("558bec83c4..535657e8........e8$$$$$$$$558bec535657") //Borland Delphi (2)
&& (PE.isSignaturePresent(PE.getSize() - 0x40, 40, "'SELFEXTRACTING'"))) {
if (PE.compareEP("558bec83c4..535657e8........e8$$$$$$$$558bec535657") && //Borland Delphi (2)
PE.isSignaturePresent(PE.getSize() - 0x40, 40, "'SELFEXTRACTING'")) {
sOptions = "zlib";
bDetected = true;
}

View file

@ -4,8 +4,8 @@
meta("installer", "instyler");
function detect() {
if (PE.compareEP("558bec81c4........53565733c08985") //Borland Delphi (2)
&& (PE.compareOverlay("'IS'011a"))) {
if (PE.compareEP("558bec81c4........53565733c08985") && //Borland Delphi (2)
PE.compareOverlay("'IS'011a")) {
sVersion = "1.6";
sOptions = "zlib";
bDetected = true;