Open
Description
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
, we need to erase it and replace it with our own (ad-hoc) signature - If a binary doesn't contain an
LC_CODE_SIGNATURE
, we need to add a new load command containing one
That's not the end of things:
LC_CODE_SIGNATURE
references the signing data, but doesn't actually contain it. It's actually hiding in the__LINKEDIT
segment. That means that we'll need to rewrite (and probably resize)__LINKEDIT
.