Advertisement
Combreal

reAssembleExe_SKipTest.cpp

Aug 6th, 2020
2,592
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. int main(void)
  6. {
  7.     int tohack = 9;
  8.     if (tohack == 9)
  9.     {
  10.         printf("you got to jump uppon me.\n");
  11.         return 0;
  12.     }
  13.     printf("you got it!\n");
  14.     return 0;
  15. }
  16. //gcc -W -Wall -o testHackJump01.exe testHackJump01.C
  17.  
  18. //skip the test tohack is equal to 9
  19.  
  20. //On Windows
  21. //Disassemble with ollydbg
  22. //Search for string
  23. //Locate JNZ change it to JZ
  24. //Assemble & Save
  25.  
  26. //On linux
  27. //objdump -d /path/to/exe
  28. //Loacte JNZ (disass in gdb is clearer to identify where to mod)
  29. //83 7c 24 1c 09
  30. //0x08048422 <+22>: turn jne to je  75 13
  31. //c7 04 24 e0 84 04 08
  32. //vi /path/to/exe
  33. //escape+:  % !xxd
  34. ///75 13
  35. //shift+r
  36. //replace 75 with 74
  37. //escape+:  % !xxd -r
  38. //escape+:  wq!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement