ruby-macho
ruby-macho copied to clipboard
🔩 A pure-Ruby library for parsing Mach-O files.
Similar to #87 -- we can use `yaml2obj` to generate known good and bad Mach-Os.
I currently release new versions of the ruby-macho gem from my desktop. This isn't ideal, both security wise and in terms of availability for other Homebrew maintainers. So, we should...
As we start to parse contents of various regions, it would be helpful to not hold in memory `@raw_data` but materialize as needed in MachOView. This can be accomplished by...
A pure ruby implementation of these is useful as loose dylibs no longer exist on Apple platforms
I'm going to use this issue as a dumping ground as I explore a pure-Ruby alternative to #260. At a high level: * If a binary already contains an `LC_CODE_SIGNATURE`,...
Right now, every load command (e.g., `MachO::LoadCommand::DylibCommand` just returns its type when stringified: ```ruby dylib.to_s # => "LC_DYLIB_ID" ``` This is a good default for load commands that don't have...
Currently, ruby-macho will happily parse a fat Mach-O whose `fat_archs` and internal slices have mismatching (i.e., not 1-to-1) CPU types and subtypes. Reference this LLVM object: https://github.com/llvm-mirror/llvm/blob/master/test/Object/Inputs/macho-invalid-fat_cputype Observed behavior: ```ruby...
Currently, ruby-macho will happily parse a fat Mach-O with no internal slices (i.e., `nfat_arch == 0`). This should be an error (potentially an ignorable one with `permissive: true`). Reference this...
Right now, `MachOFile.new` and `FatFile.new` read entire binaries into memory. This is efficient when manipulating their contents, but is unnecessarily expensive when testing the file's sanity (good magic, reasonable size,...