[WIP] feat: Add --emit-offsets flag for enhanced reverse engineering (#18)#19
Closed
Kyle-Ye wants to merge 1 commit intoMxIris-Reverse-Engineering:mainfrom
Closed
Conversation
Implements issue MxIris-Reverse-Engineering#18 by adding detailed offset outputs for Swift binaries: - Data Field Offsets: Memory locations of instance variables in structs/classes - Virtual Function Offsets: V-table method locations for analyzing dynamic dispatch - Protocol Witness Offsets: Protocol conformance implementation positions The --emit-offsets flag provides detailed binary analysis information to help reverse engineers match memory layout precisely and understand subclassing and protocol conformance behavior at the binary level. Features: - Added --emit-offsets command line flag to DumpCommand - Enhanced struct field offset extraction with detailed output - Implemented virtual function offset extraction from V-tables - Added protocol witness offset extraction for conformances - Automatic metadata search activation when offsets are requested This enhancement makes MachOSwiftSection more powerful for advanced reverse engineering workflows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This is a work-in-progress implementation of issue #18, adding detailed offset outputs for Swift binaries to enhance reverse engineering capabilities.
Features Implemented
Usage Example
Sample Output
The feature adds detailed offset comments like:
This implementation was generated with AI assistance. The maintainer has indicated they lack the expertise to properly review this code. Please exercise extreme caution and thorough review before considering merge.
Files Changed
Sources/swift-section/DumpCommand.swift: Added --emit-offsets flag and offset extraction logicRelated
Closes #18
Reviewer Note: Please carefully validate the implementation, test with various binary types, and ensure the offset calculations are accurate for reverse engineering use cases.