Η RipDev κυκλοφόρησαν εχτές, μέσω του Installer, το PseudoSubstrate 1.0, το οποίο και αποτελεί την δική τους πρόταση έναντι του MobileSubstrate του Cydia.
Επί της ουσίας, το PseudoSubstrate επιτρέπει την εγκατάσταση εφαρμογών οι οποίες είναι διαθέσιμες στο Cydia και χρειάζονται το MobileSubstrate για να εγκατασταθούν.
PseudoSubstrate is used for situations when you don’t have Cydia installed or prefer Installer over the former and requires no additional work from developers’ side. And it’s faster, too.
Στη συνέχεια του post, οι RipDev προσπαθούν να μας πείσουν ότι το PseudoSubstrate είναι ανώτερο του MobileSubstrate:
* MobileSubstrate is using a simple way of patching C functions where multiple patches for the same function will conflict.
* The way of patching Objective C methods used by MobileSubstrate is puzzling me. Instead of just swapping the IMP addresses of the functions, it does that, but also adds a new method into the class methods list. While I can understand, why (it’s easier for the developer to write [self orig_patchedFunction:arg1] than gPatchedFunction(obj, sel, arg1); ) but in the end it causes a separate call to objc_msgSend resulting in 50 to 400 extra instructions to be executed just to call the original function. Talk about speed, huh.
* The way MobileSafety works (it controls the Safe Mode commonly seen in the SpringBoard) is okay for a UN*X diehard - but it relies on some assumptions it shouldn’t. For example, it traps common signals sent when the app is crashed (SIGSEGV, SIGBUS, etc) but doesn’t passes the extra information to next handlers in chain! Hello, this is 21st century, and we’re not talking of command line tools here - it’s done inside a full-fledged GUI app, and who knows, that extra information MobileSafety discards may be useful - you never know!
* The loader itself is written in Objective C which means it is much more slower than compared to the one written in pure C - and that affects every application launch.
Η RipDev βλέπει τον “πόλεμο” με το Cydia να χάνεται μέρα με τη μέρα και προσπαθεί να ανατρέψει την κατάσταση… Δεν νομίζουμε πως θα τα καταφέρει.
[Via ripdev.org]
PseudoSubstrate vs MobileSubstrate
Από
sepsis
, 16/12/2008 22:36
8 μηνύματα σε αυτό το θέμα
#1
Δημοσίευση 16/12/2008 - 22:36
Ad
#2
Δημοσίευση 17/12/2008 - 11:08
Και η απάντηση από τον Sauric:
"(This is the author of MobileSubstrate.) Ok, I would normally totally ignore something like this, but now you are getting into the world of personal misinformation. :-(
For the record, my day job actually is (at least often) doing these kind of hacks. I have spent the last few years doing embedded ARM development, working for a client that wants code they wrote 20 years ago to work on their new device, often without source code or documentation. This requires drastic reverse engineering efforts and various hooks into the code.
/Now/, however, my day job is iPhone/Android development, and has been for months. After I released Cycorder I started spending less and less time doing consulting, and now I simply don't do it at all.
Finally, my PhD work is in "Post-Compile-Time Code Modification and Optimization". As an undergraduate I even published a paper on hooking method calls in pre-existing Java applications (which is actually more difficult than doing the same for C/Objective-C, as you can't just back-patch the already loaded code).
I therefore find your assertions that my expertise is lacking in this area surprising ;P.
You also happen to be making a couple incorrect claims about my work, which I will now address. As an example: the way I do C hooking /definitely/ allows multiple hooks to coexist. I highly recommend reading the code again: each time someone hooks the function, they will lift out a trampoline which contains code to call the previous hook.
This is difficult to see as it is a side effect of the hooking process as opposed to an explicit feature, so I understand why you missed it. To be honest, even I have to rethink through why it works if I haven't looked at it in a couple months.
In the case of MobileSafety's signal hooks, you have a point, but it is a dubious one: remember that inserted libraries are loaded before the original application. This means that the application is going to be forced to hook them after I do: I can't stop those hooks, and can only hope that they call through to me afterwards. The only time there should be another handler I'd have to call through to is if another library made such a hook.
I will, therefore, fix this issue, but it should be made very clear that this is not even remotely the big deal you are making it out to be, and that your specific complaint about "insert a full-fledged GUI application" is simply false. Even then, the entire concept of the argument is weird: the mobile safe mode mechanism /only/ hooks SpringBoard.
Past that, you make a few correct, but unimportant claims: the fact that MobileSubstrate attempts to use Objective-C'isms when possible ever so slightly slows it down. However, when you are already hooking Objective-C messages this cost isn't noticeable. I would love to see some high-level numbers where you show the costs.
Specifically, for example, I can't imagine the startup penalty of MobileSubstrate is even measurable. An application already takes about two seconds to load. I know that all of the measurements I've done simply haven't mattered.
As for the 50-400 instructions per hook, that is only going to cause issues when you are hooking something at the lowest possible depths of a program (where only a foolish developer used Objective-C to begin with). Think about it: what is the hook even doing? It's probably/hopefully going to be sending a number of further messages, which will swamp the couple hundred nanoseconds you are concerned about.
That said, I agree: it would be nice to provide that option, and I thank you for the suggestion. The next version of MobileSubstrate will also support an IMP pass-through method of calling the next hook (although given that, as you say, it is slightly more bothersome to the developer, I doubt many people will prefer it).
This is one of the wonderful aspects of open source: you were able to read MobileSubstrate, and give me a useful suggestion. A patch would have been even cooler, but this is still awesome.
On that note, I didn't even know that Mobile Enhancer was something that third parties could use. (To be very frank: I wasn't even certain that Mobile Enhancer did anything similar to MobileSubstrate until today.) Is there any documentation for it, or any examples? If you Google search for it you just get confused users trying to guess what it is for. One gets the feeling that you preferred that technology to be for RiPDev's internal usage on their projects, not something to be used by everyone.
Really, AFAIK, MobileSubstrate is in use by as many people as it is only because I wrote WinterBoard, which I designed because A) SummerBoard was dead, I don't remember FaceLift fully working on 2.x at the time, and C) even if it did, it was commercial anyway and I felt the most bang-for-the-buck could be had giving that part away. While doing this, everyone really wanted WinterBoard to be open source, especially given that SummerBoard simply got abandoned and FaceLift was stagnating.
Originally, therefore, I simply wrote it. At that same time, a number of other people /also/ wanted to hook things, and were coming to me for the techniques (which, as you know, were more complex on 2.x due to the new Objective-C ABI). I just kept pointing them to WinterBoard's source code. As far as I still know, this is because no one knew how to use Mobile Enhancer to do this, assuming that they even were able to.
After a couple weeks of this, I finally decided to abstract that part of the code out of WinterBoard into a library, in order to A) make this easier and allow the hooks to be centralized (which makes installing them much simpler: too many developers were messing up their installation programs and SWOD'ing people's devices). So that's the story of why it was written.
If Mobile Enhancer had been "out there" and documented (which something that is closed source kind of has to be to be usable ;P), maybe no one would have come to me, and maybe no one would be using Mobile Substrate. You never know."
"(This is the author of MobileSubstrate.) Ok, I would normally totally ignore something like this, but now you are getting into the world of personal misinformation. :-(
For the record, my day job actually is (at least often) doing these kind of hacks. I have spent the last few years doing embedded ARM development, working for a client that wants code they wrote 20 years ago to work on their new device, often without source code or documentation. This requires drastic reverse engineering efforts and various hooks into the code.
/Now/, however, my day job is iPhone/Android development, and has been for months. After I released Cycorder I started spending less and less time doing consulting, and now I simply don't do it at all.
Finally, my PhD work is in "Post-Compile-Time Code Modification and Optimization". As an undergraduate I even published a paper on hooking method calls in pre-existing Java applications (which is actually more difficult than doing the same for C/Objective-C, as you can't just back-patch the already loaded code).
I therefore find your assertions that my expertise is lacking in this area surprising ;P.
You also happen to be making a couple incorrect claims about my work, which I will now address. As an example: the way I do C hooking /definitely/ allows multiple hooks to coexist. I highly recommend reading the code again: each time someone hooks the function, they will lift out a trampoline which contains code to call the previous hook.
This is difficult to see as it is a side effect of the hooking process as opposed to an explicit feature, so I understand why you missed it. To be honest, even I have to rethink through why it works if I haven't looked at it in a couple months.
In the case of MobileSafety's signal hooks, you have a point, but it is a dubious one: remember that inserted libraries are loaded before the original application. This means that the application is going to be forced to hook them after I do: I can't stop those hooks, and can only hope that they call through to me afterwards. The only time there should be another handler I'd have to call through to is if another library made such a hook.
I will, therefore, fix this issue, but it should be made very clear that this is not even remotely the big deal you are making it out to be, and that your specific complaint about "insert a full-fledged GUI application" is simply false. Even then, the entire concept of the argument is weird: the mobile safe mode mechanism /only/ hooks SpringBoard.
Past that, you make a few correct, but unimportant claims: the fact that MobileSubstrate attempts to use Objective-C'isms when possible ever so slightly slows it down. However, when you are already hooking Objective-C messages this cost isn't noticeable. I would love to see some high-level numbers where you show the costs.
Specifically, for example, I can't imagine the startup penalty of MobileSubstrate is even measurable. An application already takes about two seconds to load. I know that all of the measurements I've done simply haven't mattered.
As for the 50-400 instructions per hook, that is only going to cause issues when you are hooking something at the lowest possible depths of a program (where only a foolish developer used Objective-C to begin with). Think about it: what is the hook even doing? It's probably/hopefully going to be sending a number of further messages, which will swamp the couple hundred nanoseconds you are concerned about.
That said, I agree: it would be nice to provide that option, and I thank you for the suggestion. The next version of MobileSubstrate will also support an IMP pass-through method of calling the next hook (although given that, as you say, it is slightly more bothersome to the developer, I doubt many people will prefer it).
This is one of the wonderful aspects of open source: you were able to read MobileSubstrate, and give me a useful suggestion. A patch would have been even cooler, but this is still awesome.
On that note, I didn't even know that Mobile Enhancer was something that third parties could use. (To be very frank: I wasn't even certain that Mobile Enhancer did anything similar to MobileSubstrate until today.) Is there any documentation for it, or any examples? If you Google search for it you just get confused users trying to guess what it is for. One gets the feeling that you preferred that technology to be for RiPDev's internal usage on their projects, not something to be used by everyone.
Really, AFAIK, MobileSubstrate is in use by as many people as it is only because I wrote WinterBoard, which I designed because A) SummerBoard was dead, I don't remember FaceLift fully working on 2.x at the time, and C) even if it did, it was commercial anyway and I felt the most bang-for-the-buck could be had giving that part away. While doing this, everyone really wanted WinterBoard to be open source, especially given that SummerBoard simply got abandoned and FaceLift was stagnating.
Originally, therefore, I simply wrote it. At that same time, a number of other people /also/ wanted to hook things, and were coming to me for the techniques (which, as you know, were more complex on 2.x due to the new Objective-C ABI). I just kept pointing them to WinterBoard's source code. As far as I still know, this is because no one knew how to use Mobile Enhancer to do this, assuming that they even were able to.
After a couple weeks of this, I finally decided to abstract that part of the code out of WinterBoard into a library, in order to A) make this easier and allow the hooks to be centralized (which makes installing them much simpler: too many developers were messing up their installation programs and SWOD'ing people's devices). So that's the story of why it was written.
If Mobile Enhancer had been "out there" and documented (which something that is closed source kind of has to be to be usable ;P), maybe no one would have come to me, and maybe no one would be using Mobile Substrate. You never know."
#3
Δημοσίευση 17/12/2008 - 15:12
τι ειναι αυτα ρε παιδια? εξιγιστε κ σε μας τουσ ασχετουσ!!
#4
Δημοσίευση 17/12/2008 - 17:00
Το MySMS χρησιμοποιεί MobileSubstrate? Αν ναι γιατί δεν το βλέπω στα εγκατεστημένα πακέτα του Cydia ?
#5
Δημοσίευση 17/12/2008 - 19:47
Sorry guys! Αλλά o Saurik είναι πολύ μικρός για να φτάσει την RiPDev! peace!
#6
Δημοσίευση 17/12/2008 - 20:06
Μία 'μετάφραση' στα Ελληνικά των λεγόμενων του Sauric, όπως την πήρα από το myphone:
* Η επισήμανση του σφάλματος στην λειτουργία του MobileSafety γίνεται αποδεκτή και θα διορθωθεί. Ωστόσο, υπογραμμίζει ότι δεν πρόκειται για σημαντικό πρόβλημα, όπως παρουσιάζεται από την RipDev.
* Οι καθυστερήσεις οι οποίες οφείλονται στη λειτουργία του MobileSubstrate, σύμφωνα με τον saurik, είναι αμελητέες και εμπίπτουν στον χρόνο που χρειάζεται μία εφαρμογή για την εκτέλεση της. Οι επισημάνσεις γίνονται και πάλι αποδεκτές και θα υπάρξουν βελτιώσεις. Και πάλι, δεν πρόκειται για θέμα μείζονος σημασίας όπως παρουσιάστηκε.
* Ο open source χαρακτήρας του MobileSubstrate επιτρέπει να γίνονται επισημάνσεις και βελτιώσεις από όλους.
Συνεχίζοντας τον σχολιασμό, ο saurik αναφέρει ότι αντιλήφθηκε για πρώτη φορά ότι το Mobile Enhancer και το MobileSubstrate έχουν παρόμοια λειτουργία έπειτα από το συγκεκριμένο σχόλιο της RipDev μετά την κυκλοφορία του PseudoDubstrate.
Υπογραμμίζει το γεγονός ότι δεν υπάρχει πρόσβαση σε πληροφορίες για το Enhancer καθώς επίσης και ότι μέχρι τώρα έχει χρησιμοποιηθεί αποκλειστικά από την RipDev σε δικά τους projects. Αναφέρει ακόμη ότι η διαδεδομένη χρήση του MobileSubstrate οφείλεται αρχικά στην εφαρμογή WinterBoard και συμπληρώνει κάποια στοιχεία σχετικά με το πως προέκυψε η συγκεκριμένη εφαρμογή.
Σύμφωνα, λοιπόν, με τον saurik το MobileSubstrate γράφτηκε κατά τη δημιουργία του WinterBoard και μετά απλά χρησιμοποιήθηκε το source από διάφορους δημιουργούς οι οποίοι ήθελαν να προσθέσουν στις εφαρμογές τους παρόμοιες, εξειδικευμένες λειτουργίες. Η ανάγκη αυτή τον ώθησε να εξαγάγει τον κώδικα του MobileSubstrate από το WinterBoard και να το καταστήσει εύκολα προσβάσιμο και διαθέσιμο σε όσους το χρειάζονταν.
Κλείνοντας, ως απάντηση στην προτροπή της RipDev να υπάρξει μία κοινή πορεία, τονίζει ότι δεν θα προέκυπτε ανάγκη να υπάρξει το MobileSubstrate σε περίπτωση που το Mobile Enhancer είχε καταγεγραμμένες πληροφορίες για την χρήση του και οι δημιουργοί γνώριζαν πως θα μπορούσαν να το έχουν στην διάθεση τους εφόσον το επιθυμούσαν.
Η RipDev κράτησε το Mobile Enhancer κλειστό για να μπορεί να ελέγχει τις εφαρμογές οι οποίες θα το χρησιμοποιούσαν, πιθανότατα ως προς το οικονομικό κομμάτι. Αυτό που δεν λογάριασαν είναι ότι ο Installer δημιουργήθηκε για να προσφέρει λύσεις σε μία ανοιχτή κοινότητα. Η Apple έκανε ήδη καταπληκτική δουλειά στο να θωρακίσει τη συσκευή, η RipDev ακροβατεί μεταξύ της πολιτικής της Apple και της ιδεολογίας των hackers. Κι όταν περπατάς σε τεντωμένα σχοινιά, υπάρχει πάντοτε κίνδυνος να πέσεις...
Συμφωνώ απόλυτα με τον προλαλήσαντα... Κάνανε τόσο καιρό τους μάγκες κρατώντας το Mobile Enhancer κλειστό, και τώρα που έχουν χάσει όλον τον κόσμο λόγο της ανωτερότητας του Cydia, τρέχουν και δεν φτάνουν... Δεν πειράζει, ας πρόσεχαν! Ο Installer είναι νεκρός εδώ και καιρό. Οι developers τον έχουν εγκαταλείψει και δεν πρόκειται ποτέ να γυρίσουν πίσω :-)
* Η επισήμανση του σφάλματος στην λειτουργία του MobileSafety γίνεται αποδεκτή και θα διορθωθεί. Ωστόσο, υπογραμμίζει ότι δεν πρόκειται για σημαντικό πρόβλημα, όπως παρουσιάζεται από την RipDev.
* Οι καθυστερήσεις οι οποίες οφείλονται στη λειτουργία του MobileSubstrate, σύμφωνα με τον saurik, είναι αμελητέες και εμπίπτουν στον χρόνο που χρειάζεται μία εφαρμογή για την εκτέλεση της. Οι επισημάνσεις γίνονται και πάλι αποδεκτές και θα υπάρξουν βελτιώσεις. Και πάλι, δεν πρόκειται για θέμα μείζονος σημασίας όπως παρουσιάστηκε.
* Ο open source χαρακτήρας του MobileSubstrate επιτρέπει να γίνονται επισημάνσεις και βελτιώσεις από όλους.
Συνεχίζοντας τον σχολιασμό, ο saurik αναφέρει ότι αντιλήφθηκε για πρώτη φορά ότι το Mobile Enhancer και το MobileSubstrate έχουν παρόμοια λειτουργία έπειτα από το συγκεκριμένο σχόλιο της RipDev μετά την κυκλοφορία του PseudoDubstrate.
Υπογραμμίζει το γεγονός ότι δεν υπάρχει πρόσβαση σε πληροφορίες για το Enhancer καθώς επίσης και ότι μέχρι τώρα έχει χρησιμοποιηθεί αποκλειστικά από την RipDev σε δικά τους projects. Αναφέρει ακόμη ότι η διαδεδομένη χρήση του MobileSubstrate οφείλεται αρχικά στην εφαρμογή WinterBoard και συμπληρώνει κάποια στοιχεία σχετικά με το πως προέκυψε η συγκεκριμένη εφαρμογή.
Σύμφωνα, λοιπόν, με τον saurik το MobileSubstrate γράφτηκε κατά τη δημιουργία του WinterBoard και μετά απλά χρησιμοποιήθηκε το source από διάφορους δημιουργούς οι οποίοι ήθελαν να προσθέσουν στις εφαρμογές τους παρόμοιες, εξειδικευμένες λειτουργίες. Η ανάγκη αυτή τον ώθησε να εξαγάγει τον κώδικα του MobileSubstrate από το WinterBoard και να το καταστήσει εύκολα προσβάσιμο και διαθέσιμο σε όσους το χρειάζονταν.
Κλείνοντας, ως απάντηση στην προτροπή της RipDev να υπάρξει μία κοινή πορεία, τονίζει ότι δεν θα προέκυπτε ανάγκη να υπάρξει το MobileSubstrate σε περίπτωση που το Mobile Enhancer είχε καταγεγραμμένες πληροφορίες για την χρήση του και οι δημιουργοί γνώριζαν πως θα μπορούσαν να το έχουν στην διάθεση τους εφόσον το επιθυμούσαν.
Η RipDev κράτησε το Mobile Enhancer κλειστό για να μπορεί να ελέγχει τις εφαρμογές οι οποίες θα το χρησιμοποιούσαν, πιθανότατα ως προς το οικονομικό κομμάτι. Αυτό που δεν λογάριασαν είναι ότι ο Installer δημιουργήθηκε για να προσφέρει λύσεις σε μία ανοιχτή κοινότητα. Η Apple έκανε ήδη καταπληκτική δουλειά στο να θωρακίσει τη συσκευή, η RipDev ακροβατεί μεταξύ της πολιτικής της Apple και της ιδεολογίας των hackers. Κι όταν περπατάς σε τεντωμένα σχοινιά, υπάρχει πάντοτε κίνδυνος να πέσεις...
Συμφωνώ απόλυτα με τον προλαλήσαντα... Κάνανε τόσο καιρό τους μάγκες κρατώντας το Mobile Enhancer κλειστό, και τώρα που έχουν χάσει όλον τον κόσμο λόγο της ανωτερότητας του Cydia, τρέχουν και δεν φτάνουν... Δεν πειράζει, ας πρόσεχαν! Ο Installer είναι νεκρός εδώ και καιρό. Οι developers τον έχουν εγκαταλείψει και δεν πρόκειται ποτέ να γυρίσουν πίσω :-)
#7
Δημοσίευση 18/12/2008 - 14:53
Εγώ πάντως θα ήθελα πολύ να δοκιμάσω το pseudosubstrate... απεγκατέστησα τα πακέτα του MySMS και MobileSubstrate που είχα από το Cydia και πέρασα το MySMS από τον Installer... για την ώρα δεν έχω δει κάποια διαφορά αλλά θα ήθελα να δοκιμάσω το Winterboard με το pseudosubstrate... υπάρχει τρόπος να το περάσω από το Cydia χωρίς να εγκαταστήσει αυτόματα το MobileSubstrate?
#8
Δημοσίευση 30/03/2009 - 15:38
Ρε παιδια ωραια ολα αυτα αλλα μια ερωτηση...
Συμβιωνουν αυτα τα δυο ή "τρακαρουν";
Συμβιωνουν αυτα τα δυο ή "τρακαρουν";
#9
Δημοσίευση 09/06/2009 - 14:51
μαλλον τρακαρουν!
Χρήστες που διαβάζουν αυτό το θέμα: 4
0 μέλη, 4 επισκέπτες, 0 ανώνυμοι χρήστες