Re: Odd binary differences
Re: Odd binary differences
- Subject: Re: Odd binary differences
- From: Nick Blievers <email@hidden>
- Date: Tue, 09 Apr 2013 17:02:54 -0500
- Acceptlanguage: en-US
- Thread-topic: Odd binary differences
How about rather than recompiling the binary after you have the CRC you just patch the binary directly? If the table is not dynamically generated it probably resides in a fixed offset into one of the sections of the binary.
I assume this isn't the only anti-debugging you have, as it will be fairly trivial to work around by itself.
If you are set on recompiling, you may need to look at what compiler/linker flags you are using. You can force a particular ordering with ld's -order_file option, and possibly group all the CRC'd functions at the start of the section, which may help avoiding differences. Trying small -O value may also help. I would be very curious if you can reproduce this behaviour in a small test case, because I agree that the binary should be the same between compilations.
Nick
On 10/04/2013, at 4:59 AM, Eyal Redler wrote:
>
> On Apr 9, 2013, at 4:23 PM, Rich Siegel <email@hidden> wrote:
>>> So this is the problem: For the same exact c code, xcode will produce
>>> a slightly different object code.
>>
>> It sounds like the linker is organizing your code a little differently each time, perhaps depending on the content of that table. (For example, if it compresses differently.) I am not sure if there's a way to influence that, or not.
>
> I am getting different results even if I don't change the table. Sometimes I just try again and it works.
>
>>
>> One question I have is whether you could avoid the issue entirely by using the OS's built-in code signing infrastructure...?
>
> I'm looking into it but for now I really need a solution for the CRC issue. I also find it very curios that xcode will do that.
>
> Eyal
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden