Fix bootloader to work when using mac codesigning
Merge pull request #10 from secretlair/develop

Fix bootloader to work when using mac codesigning.

Similar to the way it works on Windows, we look backwards in the binary for the magic cookie. On Mac though, the signature can vary in length and can be pretty long, so we look at the mach header to determine where the signature starts. Since segments are aligned, we then scan backward from there looking for the cookie. On Mac, the segments are aligned to 4kb multiples (vs 8-bytes on Windows).