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 


WoW macro in C++

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Hotrootsoup
Advanced Cheater
Reputation: 0

Joined: 26 Dec 2006
Posts: 65

PostPosted: Wed Feb 16, 2011 3:55 pm    Post subject: WoW macro in C++ Reply with quote

Alright, so I'm very new to C++. I'm wondering about some game-hacking related things in it.
First off, I assume that a program can read key-presses even when minimized, correct?
Second off, is there some special way of injecting key-presses into another program? AKA simulating the keyboard?
Third, would injecting keypresses into another program be detectable? Would it have to be "hooked" in to do that?
My goal is a program that you choose a hotkey, and then choose what buttons that hotkey presses in World of Warcraft. Macro's in that game don't allow you to cast multiple spells with one macro. I want it so that you can press F8 or something, and have the program cast a spell, wait for the global cooldown (1 second) then wait a random amount of time between .01 and .25 seconds to prevent server-side detection, and then cast another spell, and repeat for as many spells are in the list.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Wed Feb 16, 2011 4:01 pm    Post subject: Reply with quote

1. If the screen is minimized it is obtaining no input so it has no reason to be sending any type of input. Can you read input while minimized, sure, but it isn't expected since the screen isn't in focus.

2. There are multiple ways of doing it depending on how the application handles input. (SendMessage, PostMessage, SendInput, keybd_event, DirectInput, etc. to name a few.) You have to find out which the application uses before you can simulate things.

3. Yes. Applications can place hooks on known API such as what I listed above to prevent users from 'injecting' key presses and the like. It's fairly common to see preventions to botting and so on. Be hooked, depends on the application and its security. It could be something easy to bypass without hooking, or it could be something complex that may require it. Thats something you'd have to debug to find out.

WoW has Warden. I don't bother with hacking in WoW since the game is easy as is, so I can't say for sure if Warden would detect something like this as a cheat but I wouldn't risk my account on it to even try. You can accomplish similar things like this using a custom keyboard driver, for example all the Logitech G13/15 etc. series keyboards can mimic what you want inside a low level driver.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Hotrootsoup
Advanced Cheater
Reputation: 0

Joined: 26 Dec 2006
Posts: 65

PostPosted: Wed Feb 16, 2011 4:25 pm    Post subject: Reply with quote

Thank you very much =)
I wasn't planning on making this to "Bot" WoW, I just want it for party buffing and whatnot.
So theres no way of just simulating a keypress "over the head" of the program? Like I actually would have to send the keyboard call that the program uses? It can't just emulate it, like how macro programs do that move the mice? (AKA Runescape Bots)
Back to top
View user's profile Send private message
GRB
Advanced Cheater
Reputation: 0

Joined: 17 Nov 2006
Posts: 53

PostPosted: Wed Feb 16, 2011 4:30 pm    Post subject: Reply with quote

You can use the lua functions inside the game for that!

http://www.wowwiki.com/Lua
Back to top
View user's profile Send private message Visit poster's website
Hotrootsoup
Advanced Cheater
Reputation: 0

Joined: 26 Dec 2006
Posts: 65

PostPosted: Wed Feb 16, 2011 4:36 pm    Post subject: Reply with quote

You can't use any legit WoW coding to have one click/keypress do multiple things. They purposely block any "wait" event specifically for that purpose, to prevent botting. Maybe I'll just go back to good old (cant post name) hacking =)
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Wed Feb 16, 2011 4:49 pm    Post subject: Reply with quote

GRB wrote:
You can use the lua functions inside the game for that!

http://www.wowwiki.com/Lua


WoW blocks you from doing a lot of things that could in turn be used to create bots for automated playing, so things like this aren't possible.

Hotrootsoup wrote:
Thank you very much =)
I wasn't planning on making this to "Bot" WoW, I just want it for party buffing and whatnot.
So theres no way of just simulating a keypress "over the head" of the program? Like I actually would have to send the keyboard call that the program uses? It can't just emulate it, like how macro programs do that move the mice? (AKA Runescape Bots)


You simulate the keypress with an API if you aren't doing it low level. As I said though you need to figure out which the process will accept either by debugging or testing them. If the process uses DirectInput, most of the other API wont work and you will have to hook DirectInput to inject key presses.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
GRB
Advanced Cheater
Reputation: 0

Joined: 17 Nov 2006
Posts: 53

PostPosted: Wed Feb 16, 2011 5:32 pm    Post subject: Reply with quote

He said he didnt wanted to bot, and for the purpose of single click for buffs like he stated he can use the lua for it, theres plenty of addons for it also, u have pallypower, and a few other that with a click u buff ppl. Thats why i told Lua functions.
Back to top
View user's profile Send private message Visit poster's website
Hotrootsoup
Advanced Cheater
Reputation: 0

Joined: 26 Dec 2006
Posts: 65

PostPosted: Thu Feb 17, 2011 1:53 am    Post subject: Reply with quote

Well, I would like it to have the potential of more though. Such as PvP macro's that can multi-DoT someone, etc. This isn't set in stone, I'm just looking for a cool beginner C++ project.
Back to top
View user's profile Send private message
Polynomial
Grandmaster Cheater
Reputation: 5

Joined: 17 Feb 2008
Posts: 524
Location: Inside the Intel CET shadow stack

PostPosted: Sat Feb 19, 2011 4:10 am    Post subject: Reply with quote

Back when I was writing a WoW bot with some guys, we had to find the internal input buffers. Using SendKeys or firing WM events directly (SendMessage / PostMessage) on the WoW window was detected instantly. I have a feeling they have both DirectInput and standard input handlers so that they can cross reference them - if one is sent but not the other, you're probably botting.

There's plenty of bot wiki/forum pages out there with info on the internals of WoW. For example, to make you move around in the game you can write over the ClickToMove struct and set a certain address to 14 (CTM_MOVING) and your character will just walk to that position in a straight line. The better way to do this though is to inject a DLL into the WoW process and call the ClickToMove function instead of directly modifying the CTM struct, since direct modification might end up being detected with a checksum in a later update. You can achieve keyboard input through other such functions.

_________________
It's not fun unless every exploit mitigation is enabled.
Please do not reply to my posts with LLM-generated slop; I consider it to be an insult to my time.
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