So yeah, i started doing some fugly stuff, read some books did most of the examples in them and i wanted to do some very basic stuff, just trying out some stuff in c++ and the memory reading. But im not really sure this is the best way to do it or even a way to do it. Had successful attempts at reading the W7 calculator and it went fine, tried some different while infinite loops etc
The address is wrong, but using CE to find it for each new instance of Calculator and update it in the code works perfectly, any ideas for a nicer way to do this? (the whole concept?)
i know there are several mistakes, but for me its good enough if it works.
Code:
int main()
{
using namespace std;
int infLewp = 1;
HWND handle = FindWindow(0,TEXT("Calculator"));
if(handle == 0)
{
cout << "Could not find Process! \n" << endl;
}
else
{
DWORD ID;
GetWindowThreadProcessId(handle,&ID);
HANDLE hProcess = OpenProcess( PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION , FALSE, ID);
if(!hProcess)
{
Beep(1000,1000);
}
else
{
int buffer;
while (infLewp == 1) {
if (ReadProcessMemory(hProcess,(void*)0x0030CD6C,&buffer,4,NULL))
{
cout << "Value is : " << buffer << "\n";
while (buffer >= 2001) {
Beep(500,800);
int infLewp = 1;
}
while (buffer <= 2000) {
Beep(14000,250);
int infLewp = 1;
}
int infLewp = 1;
Sleep(5);
}
else
{
cout << "Cant read address! \n ";
Sleep(500);
int infLewp = 1;
}
}
}
CloseHandle(hProcess);
int c;
printf( "\nPress ENTER to Install Virus..." );
fflush( stdout );
do c = getchar(); while ((c != '\n') && (c != EOF));
}
}