Continue investigating classes that you think are important to understand the behaviour of the application.Click on the Pseudo-code mode button on the top bar and you'll get, as the name suggests, a pseudo-code view of the assembly: This is a class method on the SBXCard class that creates a fake Starbucks card of type "US", "CA" or "UK" and fills all the required fields with dummy data.Search the term " fakeCardOfType" in Hopper and scroll down in the assembly view, you'll see the following:.In another post I'll show you how using Hopper you can modify (patch) a binary and generate a new one, then repackage it and install it back on a device. We could spend hours and hours going through the binary, so I'll let you play around with it from here. Let Hopper process the mach-o file format information of the binary and disassemble the binary data.Press CMD (⌘) + O and locate the Starbucks.app/Starbucks binary.Download, install and open the Hopper Disassembler.The good news is that the full version costs only $99 for a personal license ( unlike its more expensive friend that costs thousands of dollars, because it's aimed at more experienced users and has many, many more features). You can download a trial version here, it gives you 30min sessions but you cannot save your work. I've been using Hopper Disassembler for a few years now and I love it, it's perfect for beginners like me. We need to understand what is happening inside the methods? what are the rules that the application follows? and to do this we'll need a disassembler. Having the name of the classes, methods and instance variables is a great way to start RE an iOS app, but we are still missing the core of the application, its business logic. Starbucks app class dump Disassemble the Starbucks app using Hopper There might be some missing information because class-dump couldn't parse it. You can open the starbucks-dump.txt file in any text editor and you'll see most of the classes, methods and even instance variables.> class-dump-swift Starbucks > ~/Downloads/starbucks-dump.txt Run class-dump-swift on the binary and save the output in a file.Change directories to the folder where you have the Starbucks App binary you extracted following my previous post.> chmod +x /usr/local/bin/class-dump-swift Download the Swift version of class-dump, move it to /usr/local/bin ( this is to be able to execute it from any folder in the system) and give it execution permissions.The Starbucks app has swift code in it so you'll have to use the Swift version of class-dump. You can download them from here (Objc class-dump) and here (Swift class-dump). This means the tools we used before to dump iOS apps classes won't work when there is Swift code in the binary, because of this I have 2 versions of class-dump. As you probably know by now, iOS apps are no longer exclusively written in Objective-C, they now can also be written (and Apple is encouraging developers to do so) in Swift or a mix of both. One of the best ways to understand the behaviour of an iOS app is to read the interfaces exposed when dumping it's classes.
0 Comments
Leave a Reply. |