Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C]CKiller / AdKilla

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Sat Mar 22, 2008 4:02 am    Post subject: [C]CKiller / AdKilla Reply with quote

some stuff i wrote while i was banned, i was bored i wanted to train my C skills (still learning)

Code:
//This is a sample of how to close the boot up ad in C-Style console

#include "windows.h" //We use SendMessage && FindWindow && GetAsyncKeyState (Win32 API)
#include "stdio.h" //We use the printf function (ReadLn in Pascal, this is for console ONLY)

HWND BootAd; //we declare a global HWND variable
bool mybool; //we declare a global boolean (true/false) variable
DWORD ms=2000; //we declare a global DWORD (DoubleWORD, 4 byte) variable

void main() //the main function
{ //begins here
   printf("Waiting for StartUpDlgClass class...\n"); //self explained (obvious)

   mybool = true; //we turn the boolean to true
   while (mybool == true) //we use the "While" loop, so while mybool is true
   { //it will execute this code
      BootAd = FindWindow("StartUpDlgClass",NULL); //it searches for "StartUpDlgClass" class, we null the lpWindowName because we don't need it
      if( BootAd ) //if "StartUpDlgClass" is found
      { //this code will execute
         printf("StartUpDlgClass class found!!\n"); //a message in the console will be showen within what's in the ""
         SendMessage(BootAd,WM_CLOSE,NULL,NULL); //we use PostMessage to close the window, by aiming it to the class handle, using WM_CLOSE message to close it, the w(word)Param and l(LongInt)Param arn't needed, so we null them
         Sleep(ms); //Added this line so people could see the message without instant close
         mybool = false; //we escape from the loop here
      } //we finish this routine here, but
      else //if the class is NOT found
      { //this block will execute
         Sleep(5); //we avoid high cpu useage by using the Sleep(); function
      } //end of this block
   } //we close here the while loop

    //while(!GetAsyncKeyState(VK_F8)){Sleep(5);} //i added this line so the program wont instant close when escaping from the loop
} //end of main function

//For those who want to kill the CloseAd, here's its class - NexonADBallon
//FindWindow("NexonADBallon",NULL);

//For those who want the app to close after killing the ad, leave it like this
//or just comment the line Sleep(ms); [remove the var] and uncomment the line While(!GetAs..)
//Note: you may manual set the delay when the app will instant close at the global declaration
//by Rot1 @ CEF, March 06, 2008



AdKilla - Kills both
Code:
#include "windows.h"
#include "stdio.h"
#include "shellapi.h"

HWND BootAd,CloseAd;
bool baBool,caBool;
DWORD ms=50,ms2=1000;

void BootUpAd()
{
   printf("Waiting for StartUpDlgClass class...\n");

   baBool = true;
   while (baBool == true)
   {
      BootAd = FindWindow("StartUpDlgClass",NULL);
      if( BootAd )
      {
         printf("StartUpDlgClass class found!!\n");
         SendMessage(BootAd,WM_CLOSE,NULL,NULL);
         Sleep(ms);
         baBool = false;
      }
      else {Sleep(5);}
   }
}

void CloseDownAd()
{
   printf("Waiting for NexonADBallon class...\n");

   caBool = true;
   while (caBool == true)
   {
      CloseAd = FindWindow("NexonADBallon",NULL);
      if( CloseAd )
      {
         printf("NexonADBallon class found!!\n");
         SendMessage(CloseAd,WM_CLOSE,NULL,NULL);
         Sleep(ms2);
         caBool = false;
      }
      else {Sleep(5);}
   }
}

void main()
{
   BootUpAd();
   CloseDownAd();
}
Back to top
View user's profile Send private message
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Sat Mar 22, 2008 5:30 am    Post subject: Reply with quote

i didn't know, that the adds from maple, got different class names?, im gonna test that now Razz, if they got, ill remake my add killer Razz

edit: omg! they got different class names!
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat Mar 22, 2008 9:35 am    Post subject: Reply with quote

You could just open up Spy++ to get the class names Rolling Eyes this isn't something big.

Why are you making DWORD variables for sleep.... you just just put the value in Sleep Laughing

And in your messy commenting in the first piece of coding you use SendMessage... then in the comment you say "we use PostMessage to.." not to mention all the pointless "the block starts here" comments.

and in the second piece of code your including shellapi.h... why? i see no API's in the code that require that header.

Next, why not just have the boolean begin true by defining it that outside the function instead of leaving it uninitialized.. and hell, if your not calling the variables anywhere outside the function cept for in that certain function why would u define them as global variables -.-

last but not least, why void main? bad bad practice! use int main

_________________
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Sat Mar 22, 2008 11:30 am    Post subject: Reply with quote

i used void main() because as x0r said, i'd get a warning "no return value", there's no point to return a value in this case, trust me i know what i'm doing and i know when to use int or void.

lurc wrote:
You could just open up Spy++ to get the class names Rolling Eyes this isn't something big.

Why are you making DWORD variables for sleep.... you just just put the value in Sleep Laughing

And in your messy commenting in the first piece of coding you use SendMessage... then in the comment you say "we use PostMessage to.." not to mention all the pointless "the block starts here" comments.

and in the second piece of code your including shellapi.h... why? i see no API's in the code that require that header.

Next, why not just have the boolean begin true by defining it that outside the function instead of leaving it uninitialized.. and hell, if your not calling the variables anywhere outside the function cept for in that certain function why would u define them as global variables -.-

last but not least, why void main? bad bad practice! use int main


at first i used PostMessage, but then i decided to use SendMessage since it gets the handle back so it's okay to use both.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites