mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
User local MachoNode
This commit is contained in:
parent
5bce0c5dc3
commit
c04da29933
1 changed files with 6 additions and 1 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
import bufferApi from 'buffer'
|
import bufferApi from 'buffer'
|
||||||
|
|
||||||
|
import { Parser as MachoNodeParser } from './macho-node/parser.js'
|
||||||
|
|
||||||
function makeFileBuffer ( buffer ) {
|
function makeFileBuffer ( buffer ) {
|
||||||
const fileBuffer = new bufferApi.Buffer.alloc( buffer.byteLength )
|
const fileBuffer = new bufferApi.Buffer.alloc( buffer.byteLength )
|
||||||
|
|
||||||
|
|
@ -9,6 +11,8 @@ function makeFileBuffer ( buffer ) {
|
||||||
return fileBuffer
|
return fileBuffer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const machoNodeParser = new MachoNodeParser()
|
||||||
|
|
||||||
// Tends to not support universal architecture
|
// Tends to not support universal architecture
|
||||||
// but support some MachoManiac doesn't and fails faster
|
// but support some MachoManiac doesn't and fails faster
|
||||||
// so we run it first
|
// so we run it first
|
||||||
|
|
@ -61,7 +65,8 @@ export class MachoNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
async run () {
|
async run () {
|
||||||
const { parse } = await import( 'macho' )
|
|
||||||
|
// console.log( 'machoNodeParser', machoNodeParser )
|
||||||
|
|
||||||
const machoNodeMeta = machoNodeParser.execute( makeFileBuffer( this.machoFileInstance.buffer ) )
|
const machoNodeMeta = machoNodeParser.execute( makeFileBuffer( this.machoFileInstance.buffer ) )
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue