PDA

View Full Version : HPC Need help with a Spambot that I'm making in C#



tylerp14
February 2nd, 2012, 02:29 AM
I need some coding help, Idk what I'm doing wrong in the code but this isn't working for the chat box on Halo or any other game...
I'll post the code, I really wanna get this working for Games. Any help would be greatly appreciative.


using System;using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;


namespace AutoTyper
{
public partial class Form1 : Form
{
public Keys chat_key;


//http://msdn.microsoft.com/en-us/library/ms646304(v=vs.85).aspx
[DllImport("user32.dll")]
static extern void keybd_event(Keys bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo);


//http://msdn.microsoft.com/en-us/library/ms646293(v=vs.85).aspx
[DllImport("user32.dll")]
static extern short GetAsyncKeyState(UInt16 virtualKeyCode);


public bool IsKeyDown(Keys keyCode)
{
Int16 result = GetAsyncKeyState((UInt16)keyCode);
return (result < 0);
}


public Form1()
{
InitializeComponent();
chat_key = Keys.None;
}


private void timer1_Tick(object sender, EventArgs e)
{
if (IsKeyDown(Keys.F5))
{
awesome_timer.Enabled = true;
int interval;
if (int.TryParse(textBox2.Text, out interval))
{
awesome_timer.Interval = interval;
}
//Thread.Sleep(100);
}
else if (IsKeyDown(Keys.F6))
{
awesome_timer.Enabled = false;
//Thread.Sleep(100);
}
}


private void button2_Click(object sender, EventArgs e)
{
Close();
}


private void button1_Click(object sender, EventArgs e)
{
if (chat_key != Keys.None)
{
//Thread.Sleep(100);
keybd_event(chat_key, 14, 0, System.UIntPtr.Zero);
//Thread.Sleep(100);
keybd_event(chat_key, 14, 2, System.UIntPtr.Zero);
}
SendKeys.SendWait(textBox1.Text);
//keybd_event(Keys.Enter, 14, 0, System.UIntPtr.Zero);
SendKeys.Send("{ENTER}");
}


private void awesome_timer_Tick(object sender, EventArgs e)
{
button1.PerformClick();
}


private void txtbx_chatkey_KeyDown(object sender, KeyEventArgs e)
{
e.SuppressKeyPress = true;


chat_key = e.KeyCode;
txtbx_chatkey.Text = e.KeyCode.ToString();
}


private void btn_none_Click(object sender, EventArgs e)
{
chat_key = Keys.None;
txtbx_chatkey.Text = "none";
}
}
}

Amit
February 2nd, 2012, 04:17 AM
Why would you need this? Especially for Halo?

Ryx
February 2nd, 2012, 10:03 AM
you do realize that either the server will automatically textban you or you'll get textbanned by some moderator?

Limited
February 2nd, 2012, 10:11 AM
Yeah, you will never get it to work using SendKeys. Halo isnt just a simple Win32 application that can handle that API call. You are looking at this completely the wrong way.

Because I dont want to increase the amount of annoying arseholes spamming the chat windows I'm not going to tell you how to do it, I'm just saying SendKeys will never work.

tylerp14
February 2nd, 2012, 12:20 PM
I asked for help, not for you guys to criticize me. Please, I really need help with this... And it's not just for Halo, its for other games as well, I got a request from a few people that they wanted a Gaming Spambot that would work for any game, so thats what I'm trying to do. And I need help. Please guys I'm stuck on this one...

chrisk123999
February 2nd, 2012, 12:26 PM
http://www.autohotkey.com/

Just know that you'll most likely be kicked/banned/muted in most Halo servers for spamming.

Amit
February 2nd, 2012, 01:28 PM
I consider spamming an offensive way to play a game and highly discourage it. However, if I had the knowledge of what you wanted to know I'd help you privately since I know many MMO's almost required the use of spamming for trade purposes.

Limited
February 2nd, 2012, 01:29 PM
http://www.autohotkey.com/

Just know that you'll most likely be kicked/banned/muted in most Halo servers for spamming.
Did you not read my post? SendKeys won't work.

You won't be able to get something that works universally in all games, its just not going to happen.

Heres one more hint, look into the buffer.

chrisk123999
February 2nd, 2012, 01:42 PM
Autohotkey works fine for Halo.

tylerp14
February 2nd, 2012, 02:58 PM
It's not just for Halo. And I'm only making this for a few requests from people I know and so I can get better in my C# learning experience.

Pooky
February 2nd, 2012, 08:32 PM
I used to just use the 9999 character limit trick and a keyboard macro that spammed 'niggers niggers niggers' all the way across everyone's screen.

Donut
February 2nd, 2012, 08:44 PM
I asked for help, not for you guys to criticize me. Please, I really need help with this... And it's not just for Halo, its for other games as well, I got a request from a few people that they wanted a Gaming Spambot that would work for any game, so thats what I'm trying to do. And I need help. Please guys I'm stuck on this one...
you asked us to help you do something really fucking annoying, is what you did. youre asking us to help you make an app that lets you (and whoever you give it to) have fun with a game at the expense of others. of course youre going to get criticized for it, are you kidding me right now? thats almost (almost) as bad as asking us what memory addresses you need to lock onto enemy players for an aimbot.

im pretty sure i have the majority of modacity's user base behind me when i say: no. you dont "really need" help with this. you "really want" it, and due to the nature of this, we dont want to give it to you.

now, i understand where youre coming from here. im also currently learning c#. if you really want to learn c#, come up with a less... obnoxious project, and we (at least I) would be glad to help.

tylerp14
February 2nd, 2012, 09:13 PM
A project like what?

Donut
February 2nd, 2012, 10:28 PM
like one thats not intended to spam the fucking chat, lol.

someone here.... i think it was Pat, made a minecraft autotyper for servers. you could enter some text into a box, hotkey it to a number, and then that number becomes the key you press to automatically type that message into the chat. the idea was to allow you to use things like the /give command without having to type it a thousand times. thats just an example.

E: please dont think im telling you what you can and cant do btw. im just saying youre much more likely to get help if youre not trying to piss people off with the end product.

Ryx
February 2nd, 2012, 10:50 PM
Oh god... here's one to start out. It's an idea I had awhile ago but never finished in c++.

You only need haloce.exe+252028 = rcon input text, or since haloce base is always 00400000, just add them together.

1. Make a console window to ask for the rcon password.

continuously read the address (only about once every second) for common commands. Find a list somewhere.
(I mean SAPP style commands, like /kick, /b, /pl)
Have your script read it, then put it into a command, ie:


LONG address = 0x00652028;
cout << "Enter RCON: ";
cin >> pass;
while(1)
{
string command = "rcon pass command";
ReadProcessMemory(hProcess,(LPCVOID)address,&moreinput,sizeof(valueAtAddress),NULL);
ReadProcessMemory(hProcess,(LPCVOID)address,&backupinput,sizeof(valueAtAddress),NULL);
moreinput.replace (3,4,null);
if(moreinput == \k)
{
command.replace (5,4,pass);
command.replace (10,7,backupinput);
WriteProcessMemory(hProcess,(LPVOID)address,&command,sizeof(command),NULL);
SendKeys(VK_ENTER);
} else { Sleep(100);
}
}



whoops, just found a backup, and wrote some new sections on it. Don't expect it to compile. It's psuedocode right now.

that's pseudocode for c++, but you get the idea. It'll read the password, read the command inside the game console, then output it correctly and submit the command.

Limited
February 3rd, 2012, 01:12 PM
How about you make a chat logger? You go into any server and it will save whatever appears in the chat window. That could be a useful tool and isn't annoying.

Cloud
February 3rd, 2012, 05:40 PM
How about you make a chat logger? You go into any server and it will save whatever appears in the chat window. That could be a useful tool and isn't annoying.

I like this idea better than a chat spam.

Higuy
February 4th, 2012, 08:39 AM
How about you make a chat logger? You go into any server and it will save whatever appears in the chat window. That could be a useful tool and isn't annoying.

He's making a tool based upon request, and like he stated before just wants to further his education. While I agree that a spam bot is annoying yes, it could possibly help him with something he may needed to know in the future. So honestly, I don't see what harm it has, as long as it'd be put to good use, like others examples that have posted before me.

Limited
February 4th, 2012, 02:19 PM
He's making a tool based upon request, and like he stated before just wants to further his education. While I agree that a spam bot is annoying yes, it could possibly help him with something he may needed to know in the future. So honestly, I don't see what harm it has, as long as it'd be put to good use, like others examples that have posted before me.
So why not follow my request? More people will find it useful, more people will want to use it and it doesn't have a negative impact on the Halo community - its a win win situation. It will also allow him to progress in his knowledge.

Higuy
February 4th, 2012, 02:32 PM
So why not follow my request? More people will find it useful, more people will want to use it and it doesn't have a negative impact on the Halo community - its a win win situation. It will also allow him to progress in his knowledge.

Like he said, hes doing it upon request for probably some friends of his and hes just looking for help. A chat saver and a chat spammer are two totally different things - perhaps he could make the chat saver once he has finished this project?

=sw=warlord
February 4th, 2012, 03:25 PM
A chat spammer can be used for other things than to piss users off.
You could use it to have a time determined announcement from the server repeating instructions such as server rules or where to find the server online for forums and such.

Limited
February 4th, 2012, 04:14 PM
A chat spammer can be used for other things than to piss users off.
You could use it to have a time determined announcement from the server repeating instructions such as server rules or where to find the server online for forums and such.
No it cant. It even says it in the name - spam. If he had said "I want to make a chat relay program" or "A program that execute chat commands" then I could envision him wanting that.

But you can clearly see his intentions of the program, as he labeled it a Spambot. We all know the meaning of the word spam.

=sw=warlord
February 4th, 2012, 04:23 PM
No it cant. It even says it in the name - spam. If he had said "I want to make a chat relay program" or "A program that execute chat commands" then I could envision him wanting that.

But you can clearly see his intentions of the program, as he labeled it a Spambot. We all know the meaning of the word spam.
You do realize Spam has others uses than just malicious intent right?

Ryx
February 4th, 2012, 04:38 PM
You do realize Spam has others uses than just malicious intent right?
try actually reading his code. It's meant to maliciously spam and has no timer function for server commands.

=sw=warlord
February 4th, 2012, 05:01 PM
try actually reading his code. It's meant to maliciously spam and has no timer function for server commands.
How does that relate to what I just said?
My point is spam can be used both ways.

Ryx
February 4th, 2012, 05:08 PM
How does that relate to what I just said?
My point is spam can be used both ways.
It's irrelevant and moot. We already established he's not going to be using it that way.

Limited
February 4th, 2012, 10:54 PM
How does that relate to what I just said?
My point is spam can be used both ways.
Our posts are relating to how hes going to use it...

The global perception of Spam is also that it is bad and unwanted messages.

Like Ryx said you need to look at his post, what he said and then look at his code.


I'll post the code, I really wanna get this working for Games.
He wants to get his code to work, his code has no method of adding multiple lines to be printed, it simple spits out the same line over and over. So his intent is malicious.

urbanyoung
February 5th, 2012, 03:43 AM
You could just read/write to the buffer that holds the text. Here are some pc addresses that may be useful. The addresses are for HPC 1.09 though but should give you an idea where to look.


Chat processing (after hitting enter in the chat dialog):
004AABD0 /$ A0 58386B00 MOV AL,BYTE PTR DS:[6B3858]

Chat box building:
004AA9FD |> \E8 8E83FBFF CALL halo.00462D90 ; Case 1 of switch 004AA95F
004AAA02 |. 84C0 TEST AL,AL
(case not func call)

Chat box active (1/0);
004AAAF3 |. C605 58386B00>MOV BYTE PTR DS:[6B3858],1

Destroy control:
004AAB20 > 51 PUSH ECX

t3h m00kz
February 5th, 2012, 04:42 AM
idgaf if someone spams.

If someone spams "I WOKE UP COVERED IN BLOOD, CUM, WISKEY, PISTACHIOS AND TEARS" in the chat it just fuels my twisted, juvenile sense of humor.

Cloud
February 5th, 2012, 02:28 PM
stop wasting time on this there is already chat spammers makes something worth while.

Donut
February 5th, 2012, 03:48 PM
idgaf if someone spams.

If someone spams "I WOKE UP COVERED IN BLOOD, CUM, WISKEY, PISTACHIOS AND TEARS" in the chat it just fuels my twisted, juvenile sense of humor.
see, that would be fucking funny if somebody actually typed that, but not if it just spewed across the screen like nobody cares about it's comedic value.

but, if youre gonna do something like that, at least make a list of ridiculous things for it to pick from so you get a random goofy thing each time.

{XG}Gijs007
February 5th, 2012, 06:07 PM
I can see why someone would want this for normal halo, for example to host a client server and automatically press enter so it doesn't get stuck and for automatic rules and things like that.

Why would you want a client server if you can get a dedi that can do all these things? With a client server you can change maps easier then with rcon. and its quicker to set up for a lan party with a few friends or for an online scrim.


How about you make a chat logger? You go into any server and it will save whatever appears in the chat window. That could be a useful tool and isn't annoying.
Offtopic: Actually sehé is working on something like this.
http://kepfeltoltes.hu/120205/hcv2l2_www.kepfeltoltes.hu_.png

It also fixed chat lag.

tylerp14
February 11th, 2012, 01:05 AM
New Project: I wanna make a Xfire/Steam AFK Typer that Auto sends messages that your AFK every 1 minute. Could somebody help me with that? Cause I have no Idea where to start or how to do it yet lol...

urbanyoung
February 11th, 2012, 04:24 AM
Why would you send messages about you being AFK every minute? Wouldn't it be better to wait until someone messages you?

tylerp14
February 11th, 2012, 11:57 AM
Yes...Thats what I ment, is there a way to do it, and can I get some help?

Limited
February 11th, 2012, 03:49 PM
Yes...Thats what I ment, is there a way to do it, and can I get some help?
First place to start is detecting if your away. Perhaps you can read the status address, I'm assuming it has declarations for online, afk, offline etc. You'll need to detect that.

When you say afk, do you mean you manually set yourself AFK in xfire, or the one that occurs after your idle for 5 minutes or so. Because the 5 minute idle one will break, when your app sends the message across :D

tylerp14
February 11th, 2012, 05:08 PM
First place to start is detecting if your away. Perhaps you can read the status address, I'm assuming it has declarations for online, afk, offline etc. You'll need to detect that.

When you say afk, do you mean you manually set yourself AFK in xfire, or the one that occurs after your idle for 5 minutes or so. Because the 5 minute idle one will break, when your app sends the message across :D

Both... If I can lol, could I get some help?

And what do you mean it'll break? O.o

Ryx
February 11th, 2012, 09:29 PM
New Project: I wanna make a Xfire/Steam AFK Typer that Auto sends messages that your AFK every 1 minute. Could somebody help me with that? Cause I have no Idea where to start or how to do it yet lol...
Sends messages to who? Updates your status, or spams everyone of your friends? :P

tylerp14
February 11th, 2012, 10:38 PM
Sends messages to who? Updates your status, or spams everyone of your friends? :P
Send a message to any messagebox that appears, it wont spam them, it will send a message that your AFK and to get back to you later.

Ryx
February 11th, 2012, 11:00 PM
Solution: find what calls xfire to make dialogs, monitor it, then when one appears, find the chat box element and input text.

tylerp14
February 11th, 2012, 11:07 PM
Thanks for the help

vnlagrla
February 12th, 2012, 12:08 AM
Check this out http://www.vivid-abstractions.net/programming/tutorials/video-tutorial-send-keys-to-an-inactive-window-windows-messages/
(http://www.vivid-abstractions.net/programming/tutorials/video-tutorial-send-keys-to-an-inactive-window-windows-messages/) find a way to detect that you have a new message and have it auto send a response, I'll look into this sometime this week and if it works i'll send you a source

tylerp14
February 12th, 2012, 01:26 AM
For an Xfire/Steam AFK Typer? Sweet thanks, just let me know on Xfire.