User local MachoNode

This commit is contained in:
Sam Carlton 2022-07-19 22:27:37 -05:00
parent 5bce0c5dc3
commit c04da29933

View file

@ -1,5 +1,7 @@
import bufferApi from 'buffer'
import { Parser as MachoNodeParser } from './macho-node/parser.js'
function makeFileBuffer ( buffer ) {
const fileBuffer = new bufferApi.Buffer.alloc( buffer.byteLength )
@ -9,6 +11,8 @@ function makeFileBuffer ( buffer ) {
return fileBuffer
}
const machoNodeParser = new MachoNodeParser()
// Tends to not support universal architecture
// but support some MachoManiac doesn't and fails faster
// so we run it first
@ -61,7 +65,8 @@ export class MachoNode {
}
async run () {
const { parse } = await import( 'macho' )
// console.log( 'machoNodeParser', machoNodeParser )
const machoNodeMeta = machoNodeParser.execute( makeFileBuffer( this.machoFileInstance.buffer ) )