Skip to content

Tried to make this work and failed :-( #5

@nfrydenholm

Description

@nfrydenholm

Hi

I have tried to follow your impressive blog post to make this arm64 simulator hack work on Googles "AFSNative" framework
(https://developers.google.com/custom-search-ads/ios/afsnative)

I was hoping you might be able to point me in the right direction of where I've failed along the way?

I did the file command and saw the 4 architectures are all there.

The lipo to get the arm64 and extracting that also went just fine.

Now, with the folder full of .o files, I went on doing the following (but to be honest I'm not completely sure if that is in fact the next step).
for file in *.o; do arm64-to-sim $file; done;

I didn't see any errors while doing this, so I went on with this
ar crv ../AFSNative.arm64-reworked *.o

But that part did not go so well. I get this kind of error
object: ../AFSNative.arm64-reworked(aligned_new_bca0ac320467a2457b3e306bfed17856.o) malformed object (section contents at offset 640 with a size of 312, overlaps Mach-O headers at offset 0 with a size of 648)

I did notice your section that says

The process requires performing extensive checks to confirm each object is a valid executable, and, thankfully, yields detailed errors. If we made any mistakes or omissions in our offset reconstructions, ar will tell us which section is faulty and what is it overlapping with. From here, we just need to keep hammering on the edits in our code.

But I'm not really sure what parts to look into changing to fix these errors (or if the errors appear, because I didn't do the initial steps correct 🤷 ).

Any ideas/hints to move on with this would be much appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions