views:

9

answers:

1

So I'm dealing with a fat binary, and I'm trying to find the method offset for frame [FOOClass abcdMethod].

Using otool I get the __text segment addr and offset. The only problem is that offset in decimal given in the output equals the starting address of the __text segment.

My question is. How can someone deduct the offset of the method in a 64bit environment?

A: 

otool or any Apple compiler tools accepts the argument -arch which specifies which part of the fat binary it'll look. See otool's man page, for example. nm might be useful, too.

But, why do you want to get the offset??? I guess you can ask what you want to do, which lead to this current question how you get the offset. Then people might come up with an easier way to achieve you originally wanted to do.

Yuji