Reverse Engineering : Finalising the patches and save the file



Finalising the patches

For finalizing the patches and saving the changes that we have made. We first have to reload the code then modify the code a little(these modifications are going to reflect the same behavior as did by the flags after flipping). After all this we just have to save the code with a different name. The procedure is elaborated below.

Step 1

  • After reloading the app on Olly, we make a few changes in the code( at the places where we tried to avoid the error message).
  • The first change would be the JNZ instruction. The JNZ instruction is changed to JMP, as this jumps the entire CALL block it was about to follow.

  • We follow the exact same procedure for another JNZ (after the TEST instruction)
  • To do all this we have select each instruction(double click). We will see a dialogue box make the changes in the dialogue box and click on execute and then cancel. 


The two images above depicts the two scenarios, one with the JNZ instruction and other with the JMP isntruction.

Step 2

    • The next instruction is the JL instruction, the one of the option available is to perform no operation instead of JL. And this could be done by replacing the JL with NOP(stands for no operation performed).
    • To do this double click on the instruction and then replace the whole statement with “NOP” then select “fill with nop” check box at the left bottom and click on execute and then on cancel.

    Note -: We could have also used the JMP instruction instead of NOP.

    The images above again shows the two scenarios.

    Step 3

    Next we have is one more JL instruction this could easily be avoided by using the same process mentioned in the Step 2.


    Step 4

    In this step we are going to save the changes to a new exe file which will be error free.
    • Select the area we have made the changes
    • Right click on the shaded area
    • Go to “edit” and then click on “copy to executable”

    • We see a smaller window of the executable instructions. Right click on the window and choose the save option to save the file.

    Step 5

    • open the new file and run it we will see the congrats message box.   
    • We will see the congrats message box on running the app now.
    This was the last part of the first tutorial from series of R.E. I will continue to post more lectures on R.E. and other topics as well. For any query you can leave a comment below or contact me directly.

    1 comments:

    Post a Comment