Skip to content

Commit

Permalink
fix: do not deref the integrity buffer (#1699)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound authored Mar 28, 2024
1 parent 224cc6a commit d421d4b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/resedit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,15 @@ export async function resedit(exePath: string, options: ExeMetadata) {

// Asar Integrity
if (options.asarIntegrity) {
const integrityList = Object.keys(options.asarIntegrity).map((file) => ({
file,
alg: options.asarIntegrity![file].algorithm,
value: options.asarIntegrity![file].hash,
}));
res.entries.push({
type: 'Integrity',
id: 'ElectronAsar',
bin: Buffer.from(JSON.stringify(options.asarIntegrity)).buffer,
type: 'INTEGRITY',
id: 'ELECTRONASAR',
bin: Buffer.from(JSON.stringify(integrityList), 'utf-8'),
lang: languageInfo[0].lang,
codepage: languageInfo[0].codepage,
});
Expand Down

0 comments on commit d421d4b

Please sign in to comment.