Skip to content

Commit 260cb0b

Browse files
committed
2 parents c628462 + b64a4c3 commit 260cb0b

23 files changed

+186
-56
lines changed

Diff for: db/Binary/__MiniExtensionsHeuristic_By_DosX.7.sg

+12
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ function main() {
217217
{ ext: ["lvl"], type: "format", name: "Level File", bin: true },
218218
{ ext: ["stb"], type: "format", name: "STB (OGG)", bin: true },
219219
{ ext: ["adbx"], type: "format", name: "AdibouX", bin: true },
220+
{ ext: ["sav"], type: "format", name: "Save", bin: true },
220221
// XPAT formats:
221222
{ ext: ["xcs"], type: "format", name: "XPAT Compiled Script", bin: true },
222223
// Generic formats:
@@ -233,6 +234,15 @@ function main() {
233234
{ ext: ["mdx"], type: "format", name: "Multidimensional Expressions", bin: true },
234235
{ ext: ["qdat"], type: "format", name: "QuickTime data", bin: true },
235236
{ ext: ["pup"], type: "format", name: "Playstation Update Package", bin: true },
237+
{ ext: ["mps"], type: "format", name: "Mathematical Programming System", bin: true },
238+
{ ext: ["gzf"], type: "format", name: "Ghidra Zip File", bin: true },
239+
{ ext: ["cue"], type: "format", name: "CUE sheet", bin: false },
240+
{ ext: ["cat"], type: "format", name: "Windows Cabinet File", bin: true },
241+
{ ext: ["sdb"], type: "format", name: "Shim Database", bin: true },
242+
{ ext: ["mof"], type: "format", name: "Managed Object Format", bin: false },
243+
{ ext: ["nls"], type: "format", name: "National Language Support", bin: true },
244+
{ ext: ["sse"], type: "format", name: "Streaming SIMD Extensions", bin: true },
245+
{ ext: ["res"], type: "format", name: "Resource file", bin: true },
236246
// ScummVM formats:
237247
{ ext: ["gob"], type: "format", name: "Config file (extract_gob_stk)", bin: false },
238248
// Director formats:
@@ -242,6 +252,8 @@ function main() {
242252
{ ext: ["cct"], type: "format", name: "Published Shockwave Cast", bin: true },
243253
// 3DS formats:
244254
{ ext: ["cia"], type: "format", name: "CTR Importable Archive", bin: true },
255+
// Amiga formats:
256+
{ ext: ["adf"], type: "format", name: "Amiga Disk File", bin: true },
245257
];
246258

247259
for (var i = 0; i < extensionsDb.length; i++) {

Diff for: db/Binary/archive.BCSAR.sg

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ init("archive", "BCSAR");
77
function detect() {
88
if (Binary.compare("'CSAR'")) {
99
sVersion = "Binary CTR Sound Archive";
10-
bDetected = true; // Mark as detected
10+
bDetected = true;
1111
}
1212

13-
return result(); // Return the result of the detection
13+
return result();
1414
}

Diff for: db/Binary/archive.CKP.sg

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ init("archive", "CKP");
88
function detect() {
99
if (Binary.compare("'.CKP'")) {
1010
sVersion = "CKP";
11-
bDetected = true; // Mark as detected
11+
bDetected = true;
1212
}
1313

14-
return result(); // Return the result of the detection
14+
return result();
1515
}

Diff for: db/Binary/archive.CVM.sg

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Detect It Easy: detection rule file
2+
// Author: BJNFNE <[email protected]>
3+
// This Script supports following formats: CVM
4+
// Used by Playstation 2 games
5+
6+
init("archive", "CVM");
7+
8+
function detect() {
9+
if (Binary.compare("'CVMH'")) {
10+
sVersion = "CRI ROFS";
11+
bDetected = true;
12+
}
13+
14+
return result();
15+
}

Diff for: db/Binary/archive.HIP.sg

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Detect It Easy: detection rule file
2+
// Author: BJNFNE <[email protected]>
3+
// This Script supports following formats: HIP
4+
// Used by EvilEngine games
5+
6+
init("archive", "HIP");
7+
8+
function detect() {
9+
if (Binary.compare("'HIPA'")) {
10+
sVersion = "HIP archives (HIP/HOP)";
11+
bDetected = true;
12+
}
13+
14+
return result();
15+
}

Diff for: db/Binary/archive.IFP.sg

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Detect It Easy: detection rule file
2+
// Author: BJNFNE <[email protected]>
3+
// This Script supports following formats: IFP
4+
// Used by Grand Theft Auto San Andreas
5+
6+
init("archive", "IFP");
7+
8+
function detect() {
9+
if (Binary.compare("'ANP3'")) {
10+
sVersion = "Animation file [Version 3]";
11+
bDetected = true;
12+
}
13+
14+
return result();
15+
}

Diff for: db/Binary/archive.JAM.sg

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Detect It Easy: detection rule file
2+
// Author: BJNFNE <[email protected]>
3+
// This Script supports following formats: JAM
4+
// Used by Lego Racers
5+
6+
init("archive", "JAM");
7+
8+
function detect() {
9+
if (Binary.compare("'LJAM'")) {
10+
bDetected = true;
11+
}
12+
13+
return result();
14+
}

Diff for: db/Binary/archive.STK.sg

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
init("archive", "STK");
66

77
function detect() {
8-
// Check if the string "'STK2.1'" is present in the archive
98
if (Binary.compare("'STK2.1'")) {
109
sVersion = "STK21";
11-
bDetected = true; // Mark as detected
10+
bDetected = true;
1211
} else {
13-
bDetected = false; // Mark as not detected if the string is not found
12+
bDetected = false;
1413
}
1514

16-
return result(); // Return the result of the detection
15+
return result();
1716
}

Diff for: db/Binary/audio.BCSTM.1.sg

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ init("audio", "BCSTM");
77
function detect() {
88
if (Binary.compare("'CSTM'")) {
99
sVersion = "BCSTM Audio Stream";
10-
bDetected = true; // Mark as detected
10+
bDetected = true;
1111
}
1212

13-
return result(); // Return the result of the detection
13+
return result();
1414
}

Diff for: db/Binary/audio.OGG.sg

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Detect It Easy: detection rule file
2+
// Author: BJNFNE <[email protected]>
3+
// This Script supports following formats: OGG
4+
5+
init("audio", "OGG");
6+
7+
function detect() {
8+
if (Binary.compare("'OggS'")) {
9+
sVersion = "Vorbis";
10+
bDetected = true;
11+
}
12+
13+
return result();
14+
}

Diff for: db/Binary/audio.PAT.sg

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ init("audio", "PAT");
77
function detect() {
88
if (Binary.compare("'PT'")) {
99
sVersion = "Audio";
10-
bDetected = true; // Mark as detected
10+
bDetected = true;
1111
}
1212

13-
return result(); // Return the result of the detection
13+
return result();
1414
}

Diff for: db/Binary/bin.COL.1.sg

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Detect It Easy: detection rule file
2+
// Author: BJNFNE <[email protected]>
3+
// This Script supports following formats: COL
4+
// Used by Grand Theft Auto San Andreas
5+
6+
init("format", "COL");
7+
8+
function detect() {
9+
if (Binary.compare("'COL'")) {
10+
sVersion = "Collision Data";
11+
bDetected = true;
12+
}
13+
14+
return result();
15+
}

Diff for: db/Binary/bin.SHBIN.1.sg

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Detect It Easy: detection rule file
22
// Author: BJNFNE <[email protected]>
3-
// This Script supports following formats: BCSAR
3+
// This Script supports following formats: SHBIN
44

55
init("format", "SHBIN");
66

77
function detect() {
88
if (Binary.compare("'DVLB'")) {
99
sVersion = "Shader Binary";
10-
bDetected = true; // Mark as detected
10+
bDetected = true;
1111
}
1212

13-
return result(); // Return the result of the detection
13+
return result();
1414
}

Diff for: db/Binary/bin.W3D.1.sg

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Detect It Easy: detection rule file
2+
// Author: BJNFNE <[email protected]>
3+
// This Script supports following formats: W3D
4+
5+
init("format", "W3D");
6+
7+
function detect() {
8+
if (Binary.compare("'IFX'")) {
9+
sVersion = "Shockwave 3D";
10+
bDetected = true;
11+
}
12+
13+
return result();
14+
}

Diff for: db/Binary/font.BTF.sg

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ init("font", "BTF");
77
function detect() {
88
if (Binary.compare("'TNFB'")) {
99
sVersion = "Font";
10-
bDetected = true; // Mark as detected
10+
bDetected = true;
1111
}
1212

13-
return result(); // Return the result of the detection
13+
return result();
1414
}

Diff for: db/Binary/font.FFN.sg

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ init("font", "FFN");
77
function detect() {
88
if (Binary.compare("'FNTF'")) {
99
sVersion = "Font";
10-
bDetected = true; // Mark as detected
10+
bDetected = true;
1111
}
1212

13-
return result(); // Return the result of the detection
13+
return result();
1414
}

Diff for: db/Binary/font.VTF.sg

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ init("font", "VTF");
77
function detect() {
88
if (Binary.compare("'TNFV'")) {
99
sVersion = "Font";
10-
bDetected = true; // Mark as detected
10+
bDetected = true;
1111
}
1212

13-
return result(); // Return the result of the detection
13+
return result();
1414
}

Diff for: db/Binary/image.FSH.sg

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ init("image", "FSH");
77
function detect() {
88
if (Binary.compare("'SHPI'")) {
99
sVersion = "Image";
10-
bDetected = true; // Mark as detected
10+
bDetected = true;
1111
}
1212

13-
return result(); // Return the result of the detection
13+
return result();
1414
}

Diff for: db/Binary/image.PCX.1.sg

+25-23
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ includeScript("read");
77

88
function detect() {
99
//ref https://www.fileformat.info/format/pcx/spec/a10e75307b3a4cc49c3bbe6db4c41fa2/view.htm
10-
if (File.getSize() >= 0x50) {
11-
if (File.compare("0a") && !File.read_uint8(0x40)) {
12-
switch (nv = File.read_uint8(0x01)) {
10+
if (X.Sz() >= 0x50) {
11+
if (X.U8(0) === 10) {
12+
switch (nv = X.U8(0x01)) {
1313
case 0:
1414
sVersion = "v2.5 using a fixed EGA palette";
1515
break;
@@ -29,41 +29,43 @@ function detect() {
2929
return;
3030
}
3131
var sus = '', inv = 0; // strictly-speaking-invalid or highly unlikely parameter counter
32-
var rle = File.read_uint8(0x02);
32+
var rle = X.U8(0x02);
3333
if (rle > 1) return;
3434
if (!rle) { inv++; sus += '!uncompressed' }
35-
var w = File.read_uint16(0x08) - File.read_uint16(0x04) + 1,
36-
h = File.read_uint16(0x0A) - File.read_uint16(0x06) + 1;
35+
var w = X.U16(0x08) - X.U16(0x04) + 1,
36+
h = X.U16(0x0A) - X.U16(0x06) + 1;
3737
if (w <= 0 || h <= 0) return;
38-
var bpplane = File.read_uint8(0x03),
39-
nplanes = File.read_uint8(0x41),
38+
var xdpi = X.U16(0xC),
39+
ydpi = X.U16(0xE);
40+
if(xdpi && !isWithin(xdpi,32,600)) { inv++; sus += '!susXdpi' };
41+
if(ydpi && !isWithin(ydpi,32,600)) { inv++; sus += '!susYdpi' };
42+
var bpplane = X.U8(0x03),
43+
nplanes = X.U8(0x41),
4044
bpx = bpplane * nplanes,
41-
pal = false;
45+
pal = ext = false;
4246
if ([1, 2, 4, 8, 24].indexOf(bpplane) < 0) return;
4347
if (!nplanes || nplanes > 4) return;
44-
if (!X.c("00",0x40)) { inv++; sus += '!resnon0' }
48+
if (X.U8(0x40)) { inv += 2; sus += '!resnon0' }
4549
if (!isAllZeroes(0x4A, 0x36)) ext = true;
4650
if (pal && ([0, 3].indexOf(nv) < 0 || bpx > 4)) { inv++; sus += '!badpalette' }
47-
var bpline = File.read_uint16(0x42); if (bpline % 2) return;
51+
var bpline = X.U16(0x42); if (bpline % 2) return;
4852
if (bpline < w*bpx >> 3) { inv++; sus += '!bpline'+bpline+'<w'+(w*bpx/8) }
49-
if (inv > 2) return;
50-
if (inv) sVersion = sVersion.appendS('sus'+sus,'/')
51-
if (File.isVerbose()) {
53+
if (inv > 3) return;
54+
if (inv && sus != "!uncompressed") sVersion = sVersion.appendS('sus'+sus,'/')
55+
if (X.isVerbose()) {
5256
sOption(w + "x" + h);
5357
if (rle) sOption("RLE");
5458
if (ext) sOption("extra_block");
5559
sOption(bpx, "bit/pixel:");
5660
sOption(bpplane, "bit/plane:");
5761
if(bpline < w*bpx >> 3) sOption(bpline, "scanline:");
58-
sOption(File.read_uint16(0x0C) + "x" + File.read_uint16(0x0E), "res:", " dpi");
59-
var scrw = File.read_uint16(0x46),
60-
scrh = File.read_uint16(0x48);
61-
if (scrw * scrh) sOption(scrw + "x" + scrh, "screen:");
62-
if (!rle) sOption(0x80 + (w * h * bpx >> 3), "sz:") //but it's never not RLE, sorry
62+
sOption(xdpi + "x" + ydpi, "res:", " dpi");
63+
if (X.U16(0x46) * X.U16(0x48)) sOption(X.U16(0x46) + "x" + X.U16(0x48), "screen:");
64+
if (!rle) sOption(0x80 + (w * h * bpx >> 3), "sz:")
6365
}
64-
bDetected = true;
66+
bDetected = true
6567
}
66-
}
67-
68-
return result();
68+
}
69+
70+
return result()
6971
}

Diff for: db/Binary/image.TGA.1.sg

+5-6
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ function detect(bShowType,bShowVersion,bShowOptions) {
3030
var sus = 0, cmin = File.read_uint16(3), cmlen = File.read_uint16(5), cmsz = File.read_uint8(7),
3131
x0 = File.read_uint16(8), y0 = File.read_uint16(0xA),
3232
w = File.read_uint16(0xC), h = File.read_uint16(0xE), attr = File.read_uint8(0x11);
33-
if(!w || !h || w > 4096 || h > 2048 || x0 > 1600 || y0 > 1200 || cmsz > 32) return false;
33+
if(!w || !h || w > 4096 || h > 2048 || x0 > 1600 || y0 > 1200 || cmsz > 32 || (attr&0xC0)) return false;
3434
// suspiciousness is probably the only way to filter out all the FPs, so let's measure that
3535
if(x0) sus++; if(y0) sus++; if(w < 4) sus++; if(h < 4) sus++; if(w > 1600) sus++; if(h > 1200) sus++;
36+
if(attr&0x10) sus++; // that's right-to-left
3637
if(!cmsz && cmlen) return false;
3738
if(cmt == 1 && (it == 2 || it == 10)) sus++; //shouldn't have colour maps with True-color
3839
if(cmsz < 15 || isWithin(cmsz,17,23) || isWithin(cmsz,25,31)) sus++; if(cmlen > 256) sus++; if(cmin) sus++;
39-
if(it == 0) { if(cmin) sus++; if(cmlen) sus++; if(cmsz) sus++ }
40+
if(it == 2 || it == 10) { if(cmin) sus++; if(cmlen) sus++; if(cmsz) sus++ }
4041
if(it != 1 && it != 9 && it != 32 && it != 33) depth = bpp <= 8 ? 8 : (bpp <= 16 ? 5 : 8);
4142
else depth = cmsz <= 8 ? 8 : (cmsz <= 16 ? 5 : 8);
4243
var col = 1 << depth;
@@ -141,9 +142,7 @@ function detect(bShowType,bShowVersion,bShowOptions) {
141142
if(co != "rle" || File.isDeepScan()) sOption(outSz(p),"sz:")
142143
}
143144
if(bad != "") sVersion += "/malformed"+bad;
144-
145145
bDetected = true;
146-
return result(bShowType,bShowVersion,bShowOptions);
147-
148-
return result();
146+
147+
return result();
149148
}

Diff for: db/Binary/text.OBC.sg

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
init("source", "OBC");
88

99
function detect() {
10-
// Check if the string "'OBC Copyright MDO'" is present in the script
1110
if (Binary.compare("'OBC Copyright MDO'")) {
1211
sVersion = "Compiled DEV7 object";
13-
bDetected = true; // Mark as detected
12+
bDetected = true;
1413
} else {
15-
bDetected = false; // Mark as not detected if the string is not found
14+
bDetected = false;
1615
}
1716

18-
return result(); // Return the result of the detection
17+
_setLang("Script (Syntax like Java)", bDetected);
18+
19+
return result();
1920
}

0 commit comments

Comments
 (0)