DyCI / dyci-main

Dynamic Code Injection Tool for Objective-C
MIT License
1.12k stars 121 forks source link

Searching classes to inject, no update after that #18

Closed prabhakaran-p-1044 closed 10 years ago

prabhakaran-p-1044 commented 11 years ago

After configuring dyci, i am getting the success logs. but when I change my code and try to inject, it says "Searching classes to inject" and no update after that. Can't understand where it gets hanged.

jdelStrother commented 10 years ago

For some reason I get this when statically linking against the Google Analytics library. After removing that it magically started working, not sure why.

[Update: nope, it's nothing to do with Google Analytics. See below]

PaulTaykalo commented 10 years ago

Hard to say why.
It depends on the Class list in the runtime
Basically it means that there was no new compiled classes found in the runtime
https://github.com/DyCI/dyci-main/blob/master/Dynamic%20Code%20Injection/dyci/Classes/SFDynamicCodeInjection.m#L309 It will be good to notify user about that :)
So here is some possible cases need to be checked:

jdelStrother commented 10 years ago

was injected file compiled ?

yep

was injected file linked dylib

nope:

$ nm /Users/jon/.dyci/dyci5915635.dylib
                 U dyld_stub_binder
$

I think I've discovered my problem - I had "Analyze During Build" ticked. How about you, @friendtam ?

When it's ticked, clangParams['object'] in dyci-recompile.py is blank, so the compiled file doesn't get linked into the dylib. A sample project is here - https://www.dropbox.com/s/fq2c0v5bl0lehqt/dycitests.zip?dl=0 - ^X will generate empty dylibs unless you untick "Analyze During Build".

Can this be fixed, or should we just have a giant warning in the wiki telling people to disable "Analyze During Build" ?

[Update: Sigh, I see you were ahead of me: https://github.com/DyCI/dyci-main/commit/024893e0cbc1a027ce7a568c2cd60399ed236e60]

PaulTaykalo commented 10 years ago

@jdelStrother :P Should I close this issue? :) It should be fixed here https://github.com/DyCI/dyci-main/issues/53

prabhakaran-p-1044 commented 10 years ago

@PaulTaykalo : Sorry for not replying. @jdelStrother : Thanks for your analysis. This issue can be closed.