‫-: Hi. Within this lecture we are going to see the overview
‫of this hopper disassembler and then we're going to learn
‫about something called hexadecimal.
‫So let's start over here.
‫At the left hand side you will see a panw containing labels.
‫So if you scroll down or scroll up a little bit
‫you will see some sort
‫of labels that can identify what they're used for.
‫Like did finish launching with options
‫or will resign active or view did load actually.
‫So you can try to find the functions that you are
‫looking for when you come over here and click on them.
‫For example, I clicked on the view did load
‫and it took me to the related assembly code
‫for view did load.
‫So we understand that this is the beginning
‫of the view did load and maybe you don't know assembly
‫maybe you don't know how this work
‫but it really doesn't matter.
‫For example, over here you will see a command like push
‫and you will see what it does on the right hand site.
‫For example, if you look over here
‫the command here is that push, okay?
‫At the right hand side you see some R7 and LR
‫and it's regarding to some registers.
‫So let me explain
‫in this section so you will understand it better.
‫So it moves some values.
‫So R7 is a register
‫it's kind of a location that we hold values, okay?
‫And what it does on this line is to move this SP value
‫into the R7 register.
‫So it's changing places
‫like it's having this value of SP
‫in its register.
‫And as you can see there is add command over here as well.
‫So it adds these two values together.
‫So every line does something, okay?
‫And of course you have to know every term
‫you have to know every command
‫in order to fully understand this.
‫As I said before, it will take a lot of time.
‫So if you wanna do that, it's great.
‫Just take an assembly course from scratch
‫that would be great for you
‫but you don't need to know that much
‫in order to reverse engineer.
‫So what we are going to do
‫during this lectures is to understand how
‫we can gather information with reading this codes
‫and so that we can use it to manipulate our apps.
‫Okay? And at the right hand side over here
‫you'll see some comment like green ones.
‫So over here you can see very useful information
‫that you can leverage in your reverse engineering process.
‫And that's it.
‫That's different sections for different methods,
‫different functions,
‫and all the lines are doing some stuff that we
‫can understand by looking at the command
‫and the values and the comment site at the right
‫at the right side of the screen.
‫If you come over here to this tab,
‫you can see a diagram, okay?
‫And this is the same code, but it actually visualizes it
‫so that we can understand it in a better way.
‫Like it shows us the connections between these coding blocks
‫so we can understand which block leads
‫to another and what does that block do in real coding life.
‫So as you can see there is a third tab as well.
‫And this is like a pseudo code.
‫And this is a hypothetical code that is generated
‫by the hopper disassembler itself
‫and is trying to represent a real code like this.
‫So maybe you can understand the code structure
‫in a better way, but
‫by just looking at the third tab over here.
‫Of course, this is not the source code,
‫this is only a representation,
‫a guess out of the assembly code, okay?
‫And as you can see, we still see the strings that commence
‫like this, like private jailbreak txt.
‫So these are actual values that can be very useful for us.
‫Like it's looking for Cydia app obviously.
‫And remember the Cydia app
‫in jail breaking device, jail breaking section.
‫So it's most probably looking for a Cydia app
‫and if it's there then it means that it's jail broken.
‫Okay? So there a lot of hints
‫a lot of clues that we can gather out of this
‫IOS hopper disassembler reverse engineering section
‫even though we are not masters of assembly.
‫And at the fourth tab we see a representation
‫by hexadecimal values.
‫Now this is kind of binary but it's not.
‫So in binary we had ones
‫and zeros and in hexadecimals we have different numbers.
‫So in order to comprehend this in a better way
‫I'm going to start with decimals.
‫So this has 10 bays
‫this has 10 figures in order to represent numbers
‫and this is what we use in real life.
‫So let me explain this with an example.
‫So maybe you have done this example
‫in high school or middle school, I don't know.
‫In math class we have the 215 number
‫and we can represent it by just breaking it down.
‫For example,
‫we can multiply the numbers like this, five times 10
‫to the power zero, one times 10
‫to the power of one, and two times 10 to the power two.
‫So if we add all this numbers together
‫of course we get 215.
‫So this is 10, this is five, and two times 100 is 200.
‫So why do we use this notation?
‫Why do we do this calculation?
‫It's very basic, right?
‫It's very not useful, but actually it's very useful.
‫We can break down the decimals like this
‫and we can break down the hexadecimals
‫and we can break down the binaries like this as well.
‫So if you have 514 for example, you can represent it
‫by four times 10 to the power zero, one times 10
‫to the power one, and five times 10 to the power two.
‫So this is 514, okay?
‫And this is very basic as well
‫because this is what we have used to in real life.
‫But if we come over here to binary,
‫like a machine language we'll see.
‫So there is a number over here, which is 1, 1, 0, 1, 1, 0 1.
‫So what does this mean?
‫We can actually break down this number as we have done
‫in the decimal as well.
‫So what do I mean?
‫We can just select the numbers, figures from here like that.
‫And rather than powers of 10, we can use powers of two.
‫So for example, in the first place we have one
‫and this is one times two to the power zero.
‫And this is zero times two to the power one, one times two
‫to the power two and two to the power three
‫two to the power four, five, and six.
‫So this is exactly what we have done in the decimals.
‫Now if you try to break it down by yourself,
‫then you will see that if you add them up together
‫like this okay?
‫Just make sure you write it down, just make sure you
‫calculate every number and then add them together
‫and it'll give you 109.
‫So this is in 10 base and 1, 1, 0, 1, 1, 0, 1
‫is in two base, it's, it's in binary.
‫And this 100, 109
‫is in decimal.
‫So as you can see, it's very efficient to use decimals
‫rather than binaries.
‫And there is a more efficient way as well.
‫We can make it smaller as possible,
‫smaller even than the decimal.
‫If we increase the number of figures in our data set,
‫so far we have 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
‫in decimal system.
‫But we can add much more, right?
‫So this is hexadecimal, as you can see it starts with zero
‫but I didn't write zero for some reason, I don't know.
‫But if you add zero over here
‫you will see that it has 16 figures rather than 10.
‫So it continues with A, B, C, D, E, F
‫and they coincide with 10, 11, 12, 13, 14, and 15.
‫Now we have 16 number over here
‫16 figures to represent numbers.
‫Now this is hexadecimal, just imagine zero over here.
‫It's my mistake, okay?
‫And you have 16, so it's in the base 16.
‫Now we can use power of 16 rather than
‫power of 10 like we have used
‫over year or power of two, we have used our binary.
‫Now we're going to use power of 16.
‫So for example, maybe you can try to pause the video
‫and try to change this value into decimals.
‫So this is an A, 4, F, 6, hexadecimal number
‫and you can represent it into represent it as decimal
‫as a 10 base if you change it properly.
‫So this is six times 16 to the power zero and so on.
‫And if you add them together, you have this 42, 230 number.
‫So as you can see, it's much more efficient to
‫represent numbers with hexadecimal rather than binaries.
‫So that's what you are seeing over here.
‫Okay? This is kind of machine language, but it's really not
‫because it's not binary, but it's kind of a representation.
‫So you can try to convert binary into decimal and then
‫to hexadecimal as an example, as a a practice for yourself.
‫And another reason that I'm showing all of this
‫to you is that hopper disassembler also limits
‫to you if you change something in your assembly
‫or in your hexadecimal, then you won't be able to turn it
‫into an IPA in actually free mode.
‫You have to pay for it.
‫So if you change anything then you won't be able to
‫compile it in the free version.
‫Maybe you don't even need that.
‫We are not going to do that in this section by the way
‫but I'm just telling you as a general culture.
‫So if you wanna do something like that
‫you can actually download this iHex
‫which is a hex editor, okay?
‫It's very easy to download
‫because it's already in the app store.
‫So you can search for iHex okay?
‫Like this on Google, iHex app Mac,
‫and you can find iHex editor on Mac app store.
‫It will direct you to the app store itself.
‫And then you can download it
‫by clicking on the download button over here.
‫So it's very easy to install
‫and it allows you to use hex editors
‫hexadecimals in this editor and edit it
‫and then just save it if you want.
‫That's not what we are going to do within this lecture
‫or within this section at all, but I'm just letting you know
‫that hopper disassembler won't help you
‫with that if you're using free version.
‫So this is a very good place to stop
‫and we are going to continue
‫with our reverse engineering process
‫within the next lecture.