What are If Statements?
The following picture shows a if statement.If statements test a condition:Tools:
We will be using Simple Assembly Explorer to patch if statements.Click Me to Download
You will also need a program to patch.
Click me to Download
Patching:
1.I have made a program which checks my name (Ultimate Coder).If the user enters a wrong name it informs the user that he/she entered a wrong name.2.Open Up SAE and browse to the place where you downloaded the program shown in the screen above.Right click the file then click on “Class Editor”.
3.A window should appear.Browse to the place show in the picture and right click on the line shown below and click on edit.
4.Another window should pop up.Now to patch the if statement we have to reverse it.Before, The if statement checked that if the value of MyName is Ultimate Coder.If yes then it would show That the name was correct else it showed that the name was not correct.The line selected in the picture above checks if the value of MyName is Ultimate Coder if false then it would jump to to line 14 and show a message
box.We will change it so that if the value is false then it would show You Got My Name.Now change the operand to the selected one in the picture below.
5.So now instead of going to line 14 it goes straight to line 10 which says You Got My Name.Click on Ok and then press on save in the menu bar.Save it to a place and then run the program.Put in any value and you will always see You Got My Name.
Congratulations.You have successfully patched a program.