electron / asar

Simple extensive tar-like archive format with indexing
MIT License
2.53k stars 244 forks source link

[windows] "RangeError: Out of the range index" when the package is only one file, and file size less than 100 bytes #116

Closed gaosiming closed 2 weeks ago

gaosiming commented 7 years ago

[windows] "RangeError: Out of the range index" when the package is only one file, and file size less than 100 bytes

resources >> New Text Document.txt

In "new text document. TXT", there are one hundred characters "a", then run the pack command, work fine, But is there a error in 99 characters "a"

command as > asar p .\resources app.asar

RangeError: Out of range index
    at Buffer.fill (buffer.js:703:11)
    at Pickle.writeBytes (x:\code\electron_src\electron\node_modules\chromium-pickle-js\lib\pickle.js:197:19)
    at Pickle.writeString (x:\code\electron_src\electron\node_modules\chromium-pickle-js\lib\pickle.js:173:19)
    at Object.module.exports.writeFilesystem (x:\code\electron_src\electron\node_modules\asar\lib\disk.js:60:20)
    at x:\code\electron_src\electron\node_modules\asar\lib\asar.js:155:19
    at x:\code\electron_src\electron\node_modules\mkdirp\index.js:48:26
    at FSReqWrap.oncomplete (fs.js:123:15)
gengjiawen commented 7 years ago

I run into this issue too. Here Github Desktop you can download the linux AppImage, and try to unpack the asar, you can reproduce this.

gengjiawen commented 7 years ago

I tried linux (Ubuntu 17.04) too, still not working.

buffer.js:851
    throw new RangeError('Index out of range');
    ^

RangeError: Index out of range
    at checkOffset (buffer.js:851:11)
    at Buffer.readUInt32LE (buffer.js:913:5)
    at Pickle.getPayloadSize (/usr/lib/node_modules/asar/node_modules/chromium-pickle-js/lib/pickle.js:192:24)
    at new PickleIterator (/usr/lib/node_modules/asar/node_modules/chromium-pickle-js/lib/pickle.js:27:28)
    at Pickle.createIterator (/usr/lib/node_modules/asar/node_modules/chromium-pickle-js/lib/pickle.js:144:12)
    at Object.module.exports.readArchiveHeaderSync (/usr/lib/node_modules/asar/lib/disk.js:81:23)
    at Object.module.exports.readFilesystemSync (/usr/lib/node_modules/asar/lib/disk.js:97:25)
    at Object.module.exports.extractAll (/usr/lib/node_modules/asar/lib/asar.js:183:27)
    at Command.<anonymous> (/usr/lib/node_modules/asar/bin/asar.js:60:15)
    at Command.listener (/usr/lib/node_modules/asar/node_modules/commander/index.js:301:8)
gengjiawen commented 7 years ago

I tried macOS, and it works...

acrazing commented 6 years ago

I tried macOS, it does not work....

aztack commented 6 years ago

I tried to extract app.asar file of Cocos Creator 1.8.2 in /Applications/CocosCreator.app/Contents/Resources/app.asar and got this error message.

ghost commented 6 years ago

+1

fengzhike commented 5 years ago

I tried to extract app.asar on macOS, got this error message too

hussainb commented 5 years ago

facing the same issue here on a windows 10 machine, does this need a specific version of node or asar to successfully unpack?

aztack commented 5 years ago

I tried to extract app.asar file of Cocos Creator 1.8.2 in /Applications/CocosCreator.app/Contents/Resources/app.asar and got this error message.

I extracted app.asar with 7-zip+asar.dll To my surprise, it contains two binary files: app.x64 and app.x86 🤣

thorn5918 commented 4 years ago

在Windows 10计算机上面临同样的问题,这是否需要特定版本的节点或asar才能成功解压缩?

MarshallOfSound commented 2 weeks ago

Closing this old issue as it is likely fixed by now, if not please raise a new issue.