Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About small methods , can not dump the instanceMethod name and types . #34

Closed
MrLeeSr opened this issue Mar 9, 2021 · 5 comments
Closed

Comments

@MrLeeSr
Copy link

MrLeeSr commented Mar 9, 2021

After merge this change , i can get the class but i can not dump the small method name and types .

debug info : in CDObjectiveC2Processor.m , when i try to get a class instance method ,
objc2Method.name = [cursor readPtr:small];
objc2Method.types = [cursor readPtr:small];
objc2Method.imp = [cursor readPtr:small];
NSString *name = [self.machOFile stringAtAddress:objc2Method.name];
NSString *types = [self.machOFile stringAtAddress:objc2Method.types];
i got a nil value . All the instance method is this . It look like the offset or mask did not right .

@neuralmer
Copy link

Are you seeing this issue with a standard framework/library? If so which one? Or, are you otherwise able to provide a reproduction?

@MrLeeSr
Copy link
Author

MrLeeSr commented Mar 9, 2021

Thanks for reply , i got this problem which in a new project demo created in Xcode12 . I put it in this respository . When you try to get the instance method of 'ViewController' or 'LBObj' , you will get this issue . or you can create a new on use Xcode12 and get a Test.

@neuralmer
Copy link

I meant to say here that I don't presently have time to take a look at this. I will as time permits.

@neuralmer
Copy link

I am able to reproduce the issue.

@neuralmer
Copy link

It looks like there is a layer of indirection that is not being interpreted correctly. The pointers are being interpreted as pointing into __PAGE_ZERO. It looks like the method name pointers should be pointing into __DATA/__objc_selrefs, possibly being offset by 0x100000000, and the data at that location is the address of the name. Similarly for the types, but I don't know which segment/section they are pointing to right now. I don't have time to continue working on this, unfortunately.

@ghost ghost closed this as completed Sep 24, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants