Skip to content

Fix ASAR parsing failure with unpacked entries - #213

Merged
crskycode merged 1 commit into
crskycode:masterfrom
asterlore:master
Aug 6, 2026
Merged

Fix ASAR parsing failure with unpacked entries#213
crskycode merged 1 commit into
crskycode:masterfrom
asterlore:master

Conversation

@asterlore

Copy link
Copy Markdown

Description

Fix Electron ASAR archives failing to open when they contain unpacked entries.

Problem

GARbro already supports the ASAR format, but some valid Electron application archives cannot be opened.

For example:

  • Queens_Casino/resources/app.asar (~977 MB)

The failure was caused by Electron's asarUnpack feature.
asarUnpack is a supported and commonly used Electron packaging feature that stores selected files outside the ASAR archive in app.asar.unpacked.

These unpacked entries do not contain an offset field in the ASAR JSON index.

The previous implementation assumed every file node had an offset:

Offset = uint.Parse(dict.Offset)

When encountering unpacked entries, this caused ArgumentNullException, preventing the entire archive from being opened.

Changes

  • Added unpacked and link fields to the ASAR node model.
  • Skip unpacked/link nodes or nodes without valid offsets.
  • Use long.TryParse for offsets to support larger ASAR archives.
  • Added additional validation for truncated ASAR files and malformed JSON headers.
  • Validate entry ranges during opening.

@crskycode
crskycode merged commit 48d7066 into crskycode:master Aug 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants