Advertisement
Guest User

Wa

a guest
Aug 1st, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <windows.h>
  4. int main()
  5. {
  6. int iChoice; // Store users choice.
  7. DWORD dwProcId; // Store Star
  8. Sonata Process ID
  9. HWND hStarSonata; //
  10. HANDLE hProcess; // Handle to Star
  11. Sonata process
  12. // Always do error checking, even
  13. if it takes a few seconds more to
  14. type!
  15. if ((hStarSonata = FindWindow
  16. (NULL, "Star Sonata")) == NULL) { //
  17. Try to find the Star Sonata window.
  18. printf("Cannot find Star Sonata
  19. window!"); // We couldn't find it
  20. exit(1); // So let the user know
  21. and exit.
  22. }
  23. if (! GetWindowThreadProcessId
  24. (hStarSonata, &dwProcId)) { // Try to
  25. get the Process ID for use in
  26. OpenProcess
  27. printf("Cannot retrieve process
  28. Id!"); // Let them know we cant get it
  29. exit(1); // Exit...
  30. }
  31. // Now we are going to get a
  32. process handle to the game
  33. if ((hProcess = OpenProcess
  34. (PROCESS_VM_WRITE, FALSE,
  35. dwProcId)) == NULL) { // Call
  36. OpenProcess to get VM Write access
  37. printf("Cannot open process!")
  38. ; // Failed to open process. Wrong
  39. priviliges?
  40. exit(1);
  41. }
  42. printf("Star Sonata Speed Hack
  43. (Noz3001)\n\n(1)Enable Speed Hack\t
  44. (2)Disable Speed Hack\t(3)Quit\n\n")
  45. ; // Show Options
  46. while(iChoice != 3) { // Whilst
  47. option is not 3
  48. printf("NOZ> _\b");
  49. scanf("%i", &iChoice); // Get next
  50. option
  51. switch(iChoice) {
  52. case 1:
  53. // Enable speed hack
  54. if (! WriteProcessMemory
  55. (hProcess, (void*)0x00463de0, 0x75,
  56. 1, NULL)) { // Try to write 0x75 (jne)
  57. to 0x00463de0 (my address)
  58. printf("Failed to write to
  59. memory!\n");
  60. }
  61. printf("Speed hack enabled.
  62. \n");
  63. break;
  64. case 2:
  65. // Disable speed hack
  66. if (! WriteProcessMemory
  67. (hProcess, (void*)0x00463de0, 0x74,
  68. 1, NULL)) { // 0x74 is (je). The original
  69. opcode.
  70. printf("Failed to write to
  71. memory!\n");
  72. }
  73. printf("Speed hack disabled.
  74. \n");
  75. break;
  76. case 3:
  77. printf("Leaving...\n");
  78. continue;
  79. default:
  80. printf("No such option!\n");
  81. break;
  82. }
  83. }
  84. CloseHandle(hProcess);
  85. exit(0);
  86. }
  87. About these ads
  88. Loading...
  89. Related
  90. Writing a Trainer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement