Aimbot Algorithm

Aimbot Algorithm

Post by brodeur235 on Tue Aug 12, 2008 5:03 pm
([msg=9478]see Aimbot Algorithm[/msg])

I'm looking to expand on the concept I learned while completing programming challenge #2 on HTS to create an aimbot, the will automate mouse movement and click when a pixel of a cetern coloref from the windows api is encountered, however the algorithm I have right now works but is slow and misses fast pixel flashes of the target color because it takes so long for my program to loop 1280x800 times and perform an if-then each go around to catch everything. Better alg solutions?

Brodeur235
brodeur235
New User
New User
 
Posts: 11
Joined: Fri May 23, 2008 2:54 pm
Location: United States, TX
Blog: View Blog (0)


Re: Aimbot Algorithm

Post by nathandelane on Wed Aug 13, 2008 8:48 am
([msg=9536]see Re: Aimbot Algorithm[/msg])

brodeur235 wrote:I'm looking to expand on the concept I learned while completing programming challenge #2 on HTS to create an aimbot, the will automate mouse movement and click when a pixel of a cetern coloref from the windows api is encountered, however the algorithm I have right now works but is slow and misses fast pixel flashes of the target color because it takes so long for my program to loop 1280x800 times and perform an if-then each go around to catch everything. Better alg solutions?


First of all what does moving your mouse and clicking have to do with finding the ASCII value of the encoded message? Basically, you just need a bit map. I'd use some method to download the image directly - the image is always named the same "/missions/prog/2/PNG" so you can easily grab it every time. After that you just need to analyze it - you can use many languages to load it into an image buffer and find out where the white pixels occur. I haven't tried this one yet, but my methodology seems logical.
Me, Nathandelane, Highly influential to Hackerdom, Premature Optimization=http://c2.com/cgi/wiki?PrematureOptimization
User avatar
nathandelane
Poster
Poster
 
Posts: 204
Joined: Thu Jun 26, 2008 11:26 am
Location: Utah
Blog: View Blog (0)


Re: Aimbot Algorithm

Post by brodeur235 on Wed Aug 13, 2008 9:33 pm
([msg=9646]see Re: Aimbot Algorithm[/msg])

First off, please read previous posts before getting bitter. No disrespect intended, but I don't appreciate the implied sarcasm.

First of all what does moving your mouse and clicking have to do with finding the ASCII value of the encoded message


I'm looking to expand on the concept I learned while completing programming challenge #2 on HTS to create an aimbot, the will automate mouse movement and click when a pixel of a cetern coloref from the windows api is encountered


Ignoring bad spelling and grammer, I think I made it fairly clear that I've completed HTS' programming challenge 2 and am working on creating an aimbot whose function I don't want to repeat along with the things I already have; read the quote.

I understand you were just trying to help and made a simple mistake - everyone does it - however please be more thorough in the future,

Anyways, still looking for alg solutions. Help appreciated,

Brodeur235
brodeur235
New User
New User
 
Posts: 11
Joined: Fri May 23, 2008 2:54 pm
Location: United States, TX
Blog: View Blog (0)


Re: Aimbot Algorithm

Post by nathandelane on Thu Aug 14, 2008 5:13 pm
([msg=9718]see Re: Aimbot Algorithm[/msg])

No sarcasm was used in my previous post. I read it several times and I still didn't understand what you're trying to do. Ok I didn't get out of your post that you completed HTS Programming Challenge 2. You don't need an algorithm, you need to find an API that allows you to take a screenshot and look at the pixels in various locations or every location on the screen. What language did you write your program in? I can help you in Visual Basic .NET (probably C#.NET) and Java. What do you have already? The algorithm you've already defined - look for a pixel of a certain color and click on it.

I understand you were just trying to help and made a simple mistake - everyone does it - however please be more thorough in the future,


Don't assume you're always right - somebody not me could take serious offense to that statement. As far as I am concerned I didn't make any mistakes and I was very thorough.
Me, Nathandelane, Highly influential to Hackerdom, Premature Optimization=http://c2.com/cgi/wiki?PrematureOptimization
User avatar
nathandelane
Poster
Poster
 
Posts: 204
Joined: Thu Jun 26, 2008 11:26 am
Location: Utah
Blog: View Blog (0)


Re: Aimbot Algorithm

Post by brodeur235 on Thu Aug 14, 2008 11:18 pm
([msg=9734]see Re: Aimbot Algorithm[/msg])

I read it several times... Ok I didn't get out of your post that you completed HTS Programming Challenge 2

looking to expand on the concept I learned while completing programming challenge #2

Note the statement where I definitively state that >> I have completed programming challenge #2 << since your apparently thorough reading, and rereading couldn't pick up on that.

Don't assume you're always right...

I didn't assume I was right. I was, there was no assumption. The facts speak for themselves. In case you still don't understand, your mistake was, you asked an irrelevant question that you wouldn't have, had you in truth been thorough; you weren't:
First of all what does moving your mouse and clicking have to do with finding the ASCII value of the encoded message?


... somebody not me could take serious offense to that statement.

Offense to what statement?! I was more than congenial in pointing out your rude fault. You were the one who offended me by suggesting my post sporadically and inexplicably switched topics when in fact you were sloppy in reading. You abviously didn't read several times and thoroughly, otherwise I suggest hooked on phonix for your disorder. The more I read your arrogant posts the more worked up I get.

As far as I am concerned I didn't make any mistakes and I was very thorough.

Then you're not very concerned, are you? You made several. Don't be petulant; admit to your mistakes - perhaps apologize - and move on. Don't, however, pretend you weren't in the wrong when there is clear evidence to prove otherwise. It's simply naive and frustrating.

Cut out the childishness; as you can tell it pisses me off fairly well.

Getting back to the reason I created this thread...

I wrote it in C++ using the win32 API. The main functions used were the GetAsyncKeyState() to load/unload the bot and the GetPixel() to examine each one's colorref. Here is the source if anyone cares to look:
[spoiler]
Code: Select all
#include <windows.h>
#include <fstream>
using namespace std;

void LeftClick();

int main()
{
    //Warning
    MessageBox(NULL, "Review the readme.txt file NOW if you have not already done so.", "Review Readme", MB_OK);
   
    //Readme and FAQ
    ofstream faq_file;
    faq_file.open("F.A.Q.txt");
    faq_file << "-|-|-|-|-|-|-|-|-W4RLOCK's AIMBOT-|-|-|-|-|-|-|-|-" << endl
             << "          (C) 2008 All Rights Reserved." << endl
             << "              A W4RLOCK PRODUCTION." << endl
             << "           Release Date: January 1, 2008" << endl
             << "                   Version: 1.0" << endl << endl << endl
             << "Frequently Asked Questions" << endl << endl
             << "Question: After I select the target color pixel and press shift W4RLOCK's AIMBOT does not do anything." << endl
             << "Answer: If you're on an OS simulator such as VirtualPC or Parallels the win32 library can be defective." << endl << endl;
    faq_file.close();
   
    ofstream readme_file;
    readme_file.open("readme.txt");
    readme_file << "-|-|-|-|-|-|-|-|-W4RLOCK's AIMBOT-|-|-|-|-|-|-|-|-" << endl
                << "          (C) 2008 All Rights Reserved." << endl
                << "              A W4RLOCK PRODUCTION." << endl
                << "           Release Date: January 1, 2008" << endl
                << "                   Version: 1.0" << endl << endl << endl
                << "You MUST READ AND FOLLOW THESE INSTRUCTIONS since you" << endl
                << "have initiated your copy of W4RLOCK's AIMBOT." << endl << endl
                << "1.) Run this application (already done if you're reading this)" << endl
                << "2.) Navigate to the screen with the target color pixel on it." << endl
                << "3.) Press the CONTROL key to let W4RLOCK's AIMBOT know that you're ready." << endl
                << "4.) Hold your cursor over the color pixel to be targetted and press ENTER." << endl
                << "5.) You will be notified that the bot is now on 'standby'." << endl
                << "6.) To alternate between the 'in use' and 'standby' statuses press SHIFT." << endl
                << "    NOTE: You'll benotified every time the status is changed." << endl
                << "7.) To turn the bot completely off, press the CONTROL key." << endl
                << "    NOTE: This will work weather you're in 'standby' mode or the 'in use' mode.";
    readme_file.close();
    system("START readme.txt");
   
    //Loop
    for(;;)
    {
        if(GetAsyncKeyState(VK_CONTROL)<0)
        {
            break;
        }
    }
    MessageBox(NULL, "Select The Color Pixel To Be Targetted.", "Select Pixel", MB_OK);
   
    //Get Pixel Color
    for(;;)
    {
        if(GetAsyncKeyState(VK_RETURN)<0)
        {
            break;
        }
    }
   
    POINT position;
    GetCursorPos(&position);
    int xpos = position.x;
    int ypos = position.y;
    COLORREF target_pixel_color;\
    HDC desktop = GetDC(HWND_DESKTOP);
    target_pixel_color = GetPixel(desktop, xpos, ypos);
    //ofstream file1;file1.open("a.txt");file1<<"POS:"<<xpos<<"x"<<ypos<<endl<<"COLOR:"<<target_pixel_color;file1.close();system("START a.txt");
    MessageBox(NULL, "                     The Pixel Has Been Selected.\n\r\n\r Press and hold CONTROL to turn W4RLOCK's AIMBOT off.", "Pixel Selected", MB_OK);
   
    //Loop
    for(;;)
    {
        int quit = 0;
        //While on standby
        MessageBox(NULL, "W4RLOCK's AIMBOT on standby. Press SHIFT to activate.", "Bot Temporarily Paused", MB_OK);
        for(;;)
        {
            if(GetAsyncKeyState(VK_SHIFT)<0)
            {
                MessageBox(NULL, "W4RLOCK's AIMBOT now in use. Press SHIFT to return to standby.", "Bot Engaged", MB_OK);
                break;
            }
            if(GetAsyncKeyState(VK_CONTROL)<0)
            {
                quit = 1;
                break;
            }
        }
       
        if(quit==1)
        {
            break;
        }
       
        //While in use
        for(;;)
        {
            int temp_quit = 0;
            for(int x = 0; x < 1280; x++)
            {
                for(int y = 0; y < 800; y++)
                {
                    if(GetPixel(desktop, x, y)==target_pixel_color)
                    {
                        SetCursorPos(x, y);
                        LeftClick();
                    }
                    if(GetAsyncKeyState(VK_SHIFT)<0)
                    {
                        temp_quit = 1;
                        break;
                    }
                    if(GetAsyncKeyState(VK_CONTROL)<0)
                    {
                        quit = 1;
                        break;
                    }
                }//yloop
                if(temp_quit==1)
                {
                    break;
                }
                if(quit==1)
                {
                    break;
                }
            }//xloop
            if(temp_quit==1)
            {
                break;
            }
            if(quit==1)
            {
                break;
            }
        }//INUSE loop
       
        if(quit==1)
        {
            break;
        }
       
    }//ON/OFF loop
   
    MessageBox(NULL, "W4RLOCK's AIMBOT is off.", "Bot Disengaged", MB_OK);
    return 0;
}

void LeftClick()
{
POINT mousexy;
GetCursorPos(&mousexy);
mouse_event(MOUSEEVENTF_LEFTDOWN, mousexy.x, mousexy.y, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, mousexy.x, mousexy.y, 0, 0);

}

/*
void LeftClick()
{
    INPUT    Input={0};
    Input.type      = INPUT_MOUSE;
    Input.mi.dwFlags  = MOUSEEVENTF_LEFTDOWN;
    ::SendInput(1,&Input,sizeof(INPUT));
    ::ZeroMemory(&Input,sizeof(INPUT));
    Input.type      = INPUT_MOUSE;
    Input.mi.dwFlags  = MOUSEEVENTF_LEFTUP;
    ::SendInput(1,&Input,sizeof(INPUT));
}
*/

[/spoiler]

Brodeur235
brodeur235
New User
New User
 
Posts: 11
Joined: Fri May 23, 2008 2:54 pm
Location: United States, TX
Blog: View Blog (0)


Re: Aimbot Algorithm

Post by nathandelane on Fri Aug 15, 2008 9:39 am
([msg=9775]see Re: Aimbot Algorithm[/msg])

Yeah there ya go. You have a nice little attitude going on. Please feel free to help yourself. Nobody else has come to your aid, and you just shot me in the foot. Thanks for providing the source finally.
Me, Nathandelane, Highly influential to Hackerdom, Premature Optimization=http://c2.com/cgi/wiki?PrematureOptimization
User avatar
nathandelane
Poster
Poster
 
Posts: 204
Joined: Thu Jun 26, 2008 11:26 am
Location: Utah
Blog: View Blog (0)


Post by brodeur235 on Fri Aug 15, 2008 12:37 pm
([msg=9805]see [/msg])

My "llittle attitude" is a result of your childish arrogance. You made mistakes and got upset at me. Forgive me if I didn't appreciate that. As for getting shot in the foot, you did that to yourself; way to go! You were the one who was rude; I was the one who was polite; and you were the one pretending to take offense. Don't waste my time. Someone more helpful will come and if worst comes to worst I'll give you back your pacifier and blanky and take matters into my own hands. I'm capable of it; I was looking to save some research time by posing some questions here. If you don't want to help, or, as in this case, are incapable of it, then don't. You've got the maturity level of an adolescent grudge-holding toddler. The scheme of things went as follows:
- I ask a question:
I'm looking to expand on the concept I learned while completing programming challenge #2 on HTS to create an aimbot ... Alg solutions?

- You don't read carefully and ask your own silly question, prompting me to repeat myself:
First of all what does moving your mouse and clicking have to do with finding the ASCII value of the encoded message?

- I very politely steer you in the right direction
Ignoring bad spelling and grammer, I think I made it fairly clear that I've completed HTS' programming challenge 2 and am working on creating an aimbot ... I understand you were just trying to help and made a simple mistake - everyone does it - however please be more thorough in the future.

- Here's the good part; You blatantly lie about having been thorough. I know I made at least this point - and a few others - clear in my previous post in this thread.
I read it several times and I still didn't understand what you're trying to do.

- Now to take another swat, getting indignant on me when, in plain truth, you were wrong and I was right. Prove to me otherwise? You can't.
Don't assume you're always right - somebody not me could take serious offense to that statement. As far as I am concerned I didn't make any mistakes and I was very thorough.


I never assumed anything. It is blatantly obvious you made a mistake. Please, I invite you to prove to me otherwise. If I am in the wrong I swear to you and everyone else who has ever browsed the net that i will apologize. However, you won't find my making a mistake in being upset at you in this thread, because that would imply reading between the lines whereas you allegedly can't even read the lines themselves. Prove me wrong; I will apologize. Don't, and do me the same courtesy. Otherwise don't waste mine or this forums time with another one of your arrogant, argumentative and unproductive threads.

I want you to know that I am by no means a difficult person to interact with. If I make a mistake I will take responsability. If someone else does, I might ignore it. Otherwise I will politely notify them, as I did for you in the statement you apparently took offense to. Don't make the mistake of actually fooling yourself into believing I brought this entire episode on you. You got upset at my polite correction of your silly mistake. Then you started lying. If I'm wrong in saying you lied - referring to the part you claimed to have thoroughly read and reread - then you are illiterate and I am honestly sorry for persecuting you for it. However, I don't need or want an illiterate's help and honestly doubt the sincerity of your claim to be in the state. I don't think you are that stupid.

In you own interests, Nathandelane, learn to take responsibility for your actions and move on. Life gets much better when you decide to cross this barrier. Men are not men because they are 40 years old and children are not children because they are 6 years old. I personally know 40 year old children and 6 year old adults. The differentiating characteristic is responsibility. Take it, and in my book you're mature; Don't and you're a child. I don't even mind getting advice from children if they know what they're talking about. However don't let your immaturity get mixed in with you advice. One thing even so many adults don't realize is that there is a right and wrong; a black and a white. Grey areas don't exist. In this particular instance you assumed the position of wrong and I countered with right - being polite about it as well. I am not in any way claiming to be the voice of God. I have my own faults and am in the wrong my own fair share of times. The difference between you and I is that I accept it when I make a mistake. You argue and persist. Please understand that no demeaning sarcasm is implied in this paragraph; I think I've vented it all out by now. I am sitting here typing this, wasting my time out of my life, solely in you interest. Take it as you will.

STILL, as hard as it is to believe, real help is still being awaited and openly accepted here,

Brodeur235
brodeur235
New User
New User
 
Posts: 11
Joined: Fri May 23, 2008 2:54 pm
Location: United States, TX
Blog: View Blog (0)


Re: Aimbot Algorithm

Post by sniper15 on Sun Aug 24, 2008 2:04 pm
([msg=10376]see Re: Aimbot Algorithm[/msg])

alright i don't really have a solution for you but i can tell you that the reason why the for loop your using to check the pixels, is slow is the use of the GetPixel function. it is one of the slowest ways to check pixels. I'm not sure what the fastest way is for your purpose but you might look into finding a different function. but as far as everything else goes it looks pretty solid. good job!

as far as nathandelane is concerned this is a person who even though he is posting in the C++ section can't seem to figure which language people are programming in. however in fairness to him people misplace posts all the time and you didn't post the source but assuming you did everything right and posted in the right section it is safe to assume you programmed your aimbot in c++... but other than that look into what i said. I'll look into it myself and if i find a solution for your problem I'll let you know.

-sniper15
sniper15
New User
New User
 
Posts: 10
Joined: Mon Apr 28, 2008 12:40 am
Blog: View Blog (0)


Re: Aimbot Algorithm

Post by BhaaL on Sun Aug 24, 2008 2:10 pm
([msg=10377]see Re: Aimbot Algorithm[/msg])

Writing an Aimbot based on Pixel values is not the way to go. Relies too heavily on stuff like brightskins and certain signal colors, apart from being slow as hell.

You should look into Memory hooking (OpenProcess, Read/WriteProcessMemory, ...) and try to get out informatino from the process you try to hook (which is your game). Look for position data, calculate the best vector that will hit, and just shoot.
Not gonna go into detail, implementation is up to you.
BhaaL
Poster
Poster
 
Posts: 270
Joined: Sun Apr 13, 2008 11:16 am
Blog: View Blog (0)


Re: Aimbot Algorithm

Post by Casval on Thu Aug 28, 2008 11:39 am
([msg=10587]see Re: Aimbot Algorithm[/msg])

I've seen aimbots programmed for other games and they work much differently from yours. The pixel checking method is very slow and won't always produce the best results. Some games have players as objects assigned with IDs generated upon account/char creation and uses those IDs to keep track of the character. You might want to check how your game is programmed and then go from there.

As for the argument, you don't need to call anyone childish when you're carrying on an argument, it doesn't take a lot of balls to stop arguing and not respond.
Casval
New User
New User
 
Posts: 24
Joined: Mon Apr 14, 2008 7:05 am
Blog: View Blog (0)


Next

Return to C and C++

Who is online

Users browsing this forum: No registered users and 0 guests