Skip to content

Commit f8d62be

Browse files
authored
Add support for Windows registry hive file (.dat) (#767)
1 parent 0db61ec commit f8d62be

File tree

6 files changed

+15
-1
lines changed

6 files changed

+15
-1
lines changed

core.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,13 @@ export class FileTypeParser {
947947
};
948948
}
949949

950+
if (this.checkString('regf')) {
951+
return {
952+
ext: 'dat',
953+
mime: 'application/x-ft-windows-registry-hive',
954+
};
955+
}
956+
950957
// -- 5-byte signatures --
951958

952959
if (this.check([0x4F, 0x54, 0x54, 0x4F, 0x00])) {

fixture/fixture-unicode-tests.dat

8 KB
Binary file not shown.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@
245245
"ppsm",
246246
"ppsx",
247247
"tar.gz",
248-
"reg"
248+
"reg",
249+
"dat"
249250
],
250251
"dependencies": {
251252
"@tokenizer/inflate": "^0.3.1",

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ abortController.abort(); // Abort file-type reading from the Blob stream.
494494
- [`cr3`](https://fileinfo.com/extension/cr3) - Canon Raw image file (v3)
495495
- [`crx`](https://developer.chrome.com/extensions/crx) - Google Chrome extension
496496
- [`cur`](https://en.wikipedia.org/wiki/ICO_(file_format)) - Icon file
497+
- [`dat`](https://en.wikipedia.org/wiki/Windows_Registry) - Windows registry hive file
497498
- [`dcm`](https://en.wikipedia.org/wiki/DICOM#Data_format) - DICOM Image File
498499
- [`deb`](https://en.wikipedia.org/wiki/Deb_(file_format)) - Debian package
499500
- [`dmg`](https://en.wikipedia.org/wiki/Apple_Disk_Image) - Apple Disk Image

supported.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ export const extensions = [
176176
'ppsx',
177177
'tar.gz',
178178
'reg',
179+
'dat',
179180
];
180181

181182
export const mimeTypes = [
@@ -351,4 +352,5 @@ export const mimeTypes = [
351352
'application/java-archive',
352353
'application/vnd.rn-realmedia',
353354
'application/x-ms-regedit',
355+
'application/x-ft-windows-registry-hive',
354356
];

test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,9 @@ const names = {
287287
'fixture-win2000',
288288
'fixture-win95',
289289
],
290+
dat: [
291+
'fixture-unicode-tests',
292+
],
290293
};
291294

292295
// Define an entry here only if the file type has potential

0 commit comments

Comments
 (0)