From e9b435fa85b30a3bb0021cbe8f967ba57a615686 Mon Sep 17 00:00:00 2001 From: Alexander O'Mara Date: Sat, 18 Jan 2025 21:27:12 -0500 Subject: [PATCH] Added architectures --- macho/universal.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/macho/universal.ts b/macho/universal.ts index e25c8da..0ceedc2 100644 --- a/macho/universal.ts +++ b/macho/universal.ts @@ -221,6 +221,29 @@ export class Universal { } } + /** + * Get set of architectures. + * + * @param archs Set of architectures to populate into. + */ + public architectures(archs: Set): void { + if (this.isUniversal()) { + const mArchList = this.mArchList!; + for (let i = 0; i < this.mArchCount; i++) { + const arch = mArchList[i]; + archs.add(new Architecture(arch.cputype, arch.cpusubtype)); + } + } else { + const mThinArch = this.mThinArch!; + archs.add( + new Architecture( + mThinArch.cpuType(), + mThinArch.cpuSubtypeFull(), + ), + ); + } + } + /** * Is a universal binary. *