codesign an old Director projector on OS X 10.13 - perhaps manipulate __LINKEDIT segment value

前端 未结 3 1650
一向
一向 2021-01-24 06:55

(See Updates at end of this post)

For $reasons, I need to codesign an old Director projector that we can no longer re-publish (no access to original source code or to Di

相关标签:
3条回答
  • 2021-01-24 07:26

    __LINKEDIT's File Offset + File Size should be equal to physical executable size. You can tinker with File Size in MachOView by double clicking the value, editing it and saving - the executable should be fine. Just don't touch File Offset because this will definitely break it.

    0 讨论(0)
  • 2021-01-24 07:34

    If the app can't find its external resources when being run normally from the Finder, that sounds like a result of Gatekeeper Path Randomization. The OS moves the app to a hidden read-only location when it's run, and it can't find the resources.

    I don't think that signing the app binary itself will fix this problem and prevent the OS from doing path randomization. The user either needs to move the application to a different directory after extracting it, or you need to distribute the application inside a disk image that has been signed with your Developer ID certificate. DropDMG (linked from the post above) can create signed disk images, that might be worth a quick try.

    0 讨论(0)
  • 2021-01-24 07:36

    DIrector uses a scheme widely used on Windows called "Overload". I attaches some data at the end of the physical file, but beyond the size of the executable image. This approach is not supported with Mach-O files. The physical image has to end with the last byte covered by the LINKEDIT segment, and even the order of items inside the LINKEDIT segment is well defined. Reason for this was prebinding in the past, now it is codesigning.

    The appended data is the initial DIR/DXR Directory wants to load first. I guess this has been fixed later by adding the DIR/DXR into the application bundle. But I am not anymore into Director, so I am not sure about this.

    0 讨论(0)
提交回复
热议问题