Switch back to imported buffer

This commit is contained in:
Sam Carlton 2022-07-21 19:52:32 -05:00
parent 7fa813fcac
commit 44eef3d075

View file

@ -8,12 +8,12 @@ import { isString, isNonEmptyString } from '~/helpers/check-types.js'
import { parsePlistBuffer } from '~/helpers/scanner/parsers/plist.js'
// import { extractMachoMeta } from '~/helpers/scanner/parsers/macho.js'
import { Buffer } from 'buffer/'
// For some reason inline 'import()' works better than 'import from'
// https://gildas-lormeau.github.io/zip.js/
const zip = await import('@zip.js/zip.js')
const bufferApi = await import('buffer')
// const FileApi = await import('file-api')
// const { parse: plistParse } = await import('simple-plist/dist/index.js')
@ -26,7 +26,7 @@ zip.configure({
function makeNodeFileBuffer ( buffer ) {
const fileBuffer = new bufferApi.Buffer.alloc( buffer.byteLength )
const fileBuffer = new Buffer.alloc( buffer.byteLength )
for (var i = 0; i < buffer.length; i++)
fileBuffer[i] = buffer[i];
@ -282,7 +282,7 @@ export class AppScan {
const machoFileInstance = new FileApi.File({
name: this.bundleExecutable.filename,
type: 'application/x-mach-binary',
buffer: bundleExecutableUint8Array,
buffer: Buffer.from( bundleExecutableUint8Array ),
})
this.machoMeta = await extractMachoMeta({ machoFileInstance, FileApi })