Using C++ to changes bytes of assembly instructions

Given as set of assembly instructions I have to change the bytes so that the binary file would accept input. I have to change the instructions so that it accepts an incorrect input. So it should run like this:
1
2
3
4
5
6
7
Enter username : attempt
Enter password : errorpassword
> Incorrect!
> Program ends
Enter username : attempt
Enter password : errorpassword
> Correct!


I think I found the instruction that I have to change, which is 0x0848578<+132>: jne 0x845ad <main+185>
I already have a code that should read the binary file byte by byte, but I'm not too sure how to change the bytes so that I can change the instruction to accept my password.
Last edited on
I Dunno; the way we always used to hack old games that had stupid security tests (go to page 1142 in the manual and get paragraph 13 word 23) was to replace it with an empty string so the thing would accept nothing as success.

to do it your way, you need to jump to the 'success' branch instead of the fail branch. One way to do that is to swap JNE to JE (jump not equals to jump equals) .. whatever hex gibberish represents that.

Topic archived. No new replies allowed.