From 61cbabf60a3617b48dd47c4e756d008502f7d446 Mon Sep 17 00:00:00 2001 From: p-x9 <50244599+p-x9@users.noreply.github.com> Date: Tue, 14 May 2024 19:05:35 +0900 Subject: [PATCH] Add `addend` property to dyld chained import protocol --- .../MachOKit/Model/DyldChain/DyldChainedImport.swift | 12 ++++++++++++ .../Protocol/DyldChainedImportProtocol.swift | 1 + 2 files changed, 13 insertions(+) diff --git a/Sources/MachOKit/Model/DyldChain/DyldChainedImport.swift b/Sources/MachOKit/Model/DyldChain/DyldChainedImport.swift index 90e906d..1e04039 100644 --- a/Sources/MachOKit/Model/DyldChain/DyldChainedImport.swift +++ b/Sources/MachOKit/Model/DyldChain/DyldChainedImport.swift @@ -38,6 +38,10 @@ public struct DyldChainedImportGeneral: DyldChainedImportProtocol { public var nameOffset: Int { numericCast(layout.name_offset) } + + public var addend: Int { + 0 + } } public struct DyldChainedImportAddend: DyldChainedImportProtocol { @@ -55,6 +59,10 @@ public struct DyldChainedImportAddend: DyldChainedImportProtocol { public var nameOffset: Int { numericCast(layout.name_offset) } + + public var addend: Int { + numericCast(layout.addend) + } } public struct DyldChainedImportAddend64: DyldChainedImportProtocol { @@ -72,6 +80,10 @@ public struct DyldChainedImportAddend64: DyldChainedImportProtocol { public var nameOffset: Int { numericCast(layout.name_offset) } + + public var addend: Int { + numericCast(layout.addend) + } } extension DyldChainedImportGeneral { diff --git a/Sources/MachOKit/Protocol/DyldChainedImportProtocol.swift b/Sources/MachOKit/Protocol/DyldChainedImportProtocol.swift index 91417e1..54baebf 100644 --- a/Sources/MachOKit/Protocol/DyldChainedImportProtocol.swift +++ b/Sources/MachOKit/Protocol/DyldChainedImportProtocol.swift @@ -12,6 +12,7 @@ public protocol DyldChainedImportProtocol: LayoutWrapper { var libraryOrdinal: Int { get } var isWeakImport: Bool { get } var nameOffset: Int { get } + var addend: Int { get } } extension DyldChainedImportProtocol {