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 


Sending Keys to D3D Windows [Help]
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
madeinqc
Master Cheater
Reputation: 0

Joined: 25 Jul 2006
Posts: 356

PostPosted: Wed Nov 26, 2008 11:54 am    Post subject: Sending Keys to D3D Windows [Help] Reply with quote

I'm trying to send keys to D3D Window to make a bot using PostMessage

for now I have:

push 1
push 00000057 //'W' key
push 00000100 //keydown
push hWnd
call PostMessageA

And

push C0110001
push 00000057 //'W' key
push 00000101 //KeyUp
push hWnd
call PostMessageA


In fact, the key work in the 2d part of the screen (such as chat window) but dont work in 3d part of the game (such as character control key... like the looting key)

anyone here know why? is it the game that protect himself from false keystroke? I've checked API and none are hooked so is there an other way it can protect? is there something special for keys send to a d3d window that I should know?

thx for answering ^^ hoping I can solve my problem

_________________
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Wed Nov 26, 2008 12:06 pm    Post subject: Reply with quote

If the game uses gameguard, then PostMessage is hooked, but that's probably not the case because you're able to send keys to the chat window.
A possibility would be that the game uses DirectInput. This is for example the case with Maplestory's directional keys. I'm not sure how to send keys to directinput. Have you tried SendInput?
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Wed Nov 26, 2008 12:38 pm    Post subject: Reply with quote

Well it would be easier if you told us what compiler you were using and your IDE.
Back to top
View user's profile Send private message
GMZorita
Grandmaster Cheater Supreme
Reputation: 0

Joined: 21 Mar 2007
Posts: 1361

PostPosted: Wed Nov 26, 2008 12:56 pm    Post subject: Reply with quote

Code:

push 00000057 != (push 0x000057 || push 00000057h)

=]

_________________
Gone
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Wed Nov 26, 2008 3:40 pm    Post subject: Reply with quote

GMZorita wrote:
Code:

push 00000057 != (push 0x000057 || push 00000057h)

=]
Depends on what he's coding with.
_________________
Back to top
View user's profile Send private message
GMZorita
Grandmaster Cheater Supreme
Reputation: 0

Joined: 21 Mar 2007
Posts: 1361

PostPosted: Wed Nov 26, 2008 3:57 pm    Post subject: Reply with quote

sponge wrote:
GMZorita wrote:
Code:

push 00000057 != (push 0x000057 || push 00000057h)

=]
Depends on what he's coding with.

I mean in general.

Edit1: Mind giving me an example? Just curious.

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

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Wed Nov 26, 2008 10:39 pm    Post subject: Reply with quote

GMZorita wrote:
sponge wrote:
GMZorita wrote:
Code:

push 00000057 != (push 0x000057 || push 00000057h)

=]
Depends on what he's coding with.

I mean in general.

Edit1: Mind giving me an example? Just curious.


Ex. Auto Assembly.
Back to top
View user's profile Send private message
madeinqc
Master Cheater
Reputation: 0

Joined: 25 Jul 2006
Posts: 356

PostPosted: Wed Nov 26, 2008 11:37 pm    Post subject: Reply with quote

I'm programing in ASM with auto assembly for now... it's for windslayer and it use HackShield...that you can bypass by deleting it... so it's not a hacking protection...

I use post message to make it minimized... so I didn't tried the others

push 00000057 mean what it mean in asm... no need to put aob I think :p

and that's it for now, I'll search more on DirectInput tomorow

thx for answer and idea

PS: I use olly and cheatengine to hack it...

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

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Thu Nov 27, 2008 7:06 pm    Post subject: Reply with quote

oh if ur using ce then it is in hex.
Back to top
View user's profile Send private message
madeinqc
Master Cheater
Reputation: 0

Joined: 25 Jul 2006
Posts: 356

PostPosted: Fri Nov 28, 2008 4:08 am    Post subject: Reply with quote

ok, for now I see 2 choices...

1-emulate a keyboard completely (can't do it loll too much job and I dont have the knowledge for)

2- find and hook the game's directinput (still dont have enough knowledge for that...)

any others way?? if not, I'll try to find more about DI and see what I can do about number 2

thx for help

_________________
Back to top
View user's profile Send private message
Zand
Master Cheater
Reputation: 0

Joined: 21 Jul 2006
Posts: 424

PostPosted: Fri Nov 28, 2008 5:46 am    Post subject: Reply with quote

Use the KBC; this is R0 though.
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Fri Nov 28, 2008 10:38 am    Post subject: Reply with quote

Did you already try SendInput?
If you can bypass Hackshield then it shouldn't be a problem.
Back to top
View user's profile Send private message
madeinqc
Master Cheater
Reputation: 0

Joined: 25 Jul 2006
Posts: 356

PostPosted: Fri Nov 28, 2008 12:13 pm    Post subject: Reply with quote

sendinput and keybd_event work but I would like to have it minimized... that's why

and thx Zand, I'll check for KBC

_________________
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Fri Nov 28, 2008 3:21 pm    Post subject: Reply with quote

I had a look at msdn's information on DirectInput
http://msdn.microsoft.com/en-us/library/bb206171.aspx

The page at this link is a part of a tutorial on getting keyboard input. As you can see in the code on that page, the application/game can use this to check for keys that are pressed:
g_lpDIDevice->GetDeviceState(sizeof(buffer),(LPVOID)&buffer);
So if you hook that function, you can modify the buffer:
For example: everytime when the function is called, you check if your bot should be pressing the up key. If so, you could change the part of the buffer containing the up-key information so the game thinks the up-key is pressed.

However, msdn also says that there are multiple ways to receive input from DirectInput. It can also be done in a way where DirectInput calls functions of the application when a key is pressed. So I think the way to 'bypass' this all, depends on the way your game uses DirectInput.
Back to top
View user's profile Send private message
madeinqc
Master Cheater
Reputation: 0

Joined: 25 Jul 2006
Posts: 356

PostPosted: Sat Nov 29, 2008 10:10 pm    Post subject: Reply with quote

thx a lot to all, I'll try to find how it use DirectInput, I may have an idea, I'll need to check... there's a part of code in the game that I found that have the key value pushed so maybe it's with that function that the game know it, I'll check how it react to different API (like if I use Post message, is the good key used trought this code, etc) and I'll give news

thx a lot again ^^

_________________
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
Goto page 1, 2  Next
Page 1 of 2

 
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