-
Notifications
You must be signed in to change notification settings - Fork 3
/
injector.cpp
62 lines (53 loc) · 1.25 KB
/
injector.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <windows.h>
#include <iostream>
using namespace std;
int main()
{
DWORD pid;
HWND hwnd;
int tries = 0;
//Search for the RS window
hwnd = FindWindow(NULL, L"Rocksmith 2014");
system("start steam://rungameid/221680");
hwnd = FindWindow(NULL, L"Rocksmith 2014");
while (!hwnd)
{
tries++;
Sleep(2000);
if (tries >= 10)
{
cout << "Rocksmith not found! \n Make sure everything is ok!\n";
cin.get();
exit(1);
}
hwnd = FindWindow(NULL, L"Rocksmith 2014");
}
GetWindowThreadProcessId(hwnd, &pid);
//Get the appropriate PID
HANDLE phandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
if (!phandle)
{
cout << "Could not get handle!\n";
cin.get();
}
else
{
//55 8B EC 83 EC 08 8B 47 14 <-- ORIGINAL!
//B0 01 C3 90 EC 08 RB 47 17 <-- HACKED!
cout << "Ok, now let's try that signature stuff... \n";
DWORD sigAddr = 0x0054B5C0; //Initial RAM Address TODO: Search for the HEX string
byte sig[4] = { 0xB0, 0X01, 0XC3, 0X90 };
DWORD newdatasize = sizeof(sig[0]);
for (int i = 0; i < 4; i++)
{
if (WriteProcessMemory(phandle, (void*)(sigAddr + i), &sig[i], newdatasize, NULL))
cout << "GOOD SIGN " << i << endl;
else
{
cout << "Frak! Something went wrong! \n";
break;
}
}
return 0;
}
}