Comparing version 1.0.4 to 1.1.0
@@ -17,2 +17,7 @@ #!/usr/bin/env node | ||
if (process.argv.indexOf('--user-data') > -1) { | ||
process.stdout.write(archive.readUserData().toString('binary')); | ||
return; | ||
} | ||
// Read the "(listfile)" file that every archive has. It lists the contents of | ||
@@ -19,0 +24,0 @@ // the archive separated by newlines. |
@@ -15,5 +15,8 @@ var bzip = require('bzip2'); | ||
var isUserData = this.buffer.readUInt8(3) === 0x1b; | ||
if (!isUserData) throw new Error('Could not find user data.') | ||
if (!isUserData) { | ||
throw new Error('Could not find user data.') | ||
} | ||
this.offset = this.buffer.readUInt32LE(8); | ||
this.userDataSize = this.buffer.readUInt32LE(12); | ||
@@ -33,4 +36,10 @@ var offset = this.offset + this.buffer.readUInt32LE(this.offset + 16); | ||
this.blockTable = table.readAsBlockTable(entries); | ||
this.readUserData(); | ||
} | ||
Archive.prototype.readUserData = function () { | ||
return this.buffer.slice(16, 16 + this.userDataSize); | ||
}; | ||
Archive.prototype.readFile = function (filename) { | ||
@@ -37,0 +46,0 @@ var hash = hashTableLookup(this.hashTable, filename); |
{ | ||
"name": "nopq", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "NoPQ is a Node.js library that lets you unpack MPQ archives such as those used with several Blizzard games.", | ||
@@ -5,0 +5,0 @@ "main": "lib/nopq.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8238
160