15 lines
508 B
JavaScript
15 lines
508 B
JavaScript
const fs = require('fs');
|
|
|
|
const fileData = fs.readFileSync('downloaded_test.hwpx');
|
|
const hex = fileData.subarray(0, 16).toString('hex').toUpperCase();
|
|
console.log('Hex signature of first 16 bytes:');
|
|
console.log(hex.match(/.{1,2}/g).join(' '));
|
|
|
|
if (hex.startsWith('D0CF11E0A1B11AE1')) {
|
|
console.log('File type: OLE Compound File (standard HWP binary)');
|
|
} else if (hex.startsWith('504B0304')) {
|
|
console.log('File type: ZIP file (standard HWPX)');
|
|
} else {
|
|
console.log('File type: Unknown');
|
|
}
|