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 


Distinguish between real and fake keystrokes
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
Deine Mutter
Expert Cheater
Reputation: 1

Joined: 05 Apr 2006
Posts: 181

PostPosted: Sun Dec 09, 2007 2:24 pm    Post subject: Distinguish between real and fake keystrokes Reply with quote

Hello,

At the moment i'm writing a bot for the game "Cabal online". I use the SendInput function. I can send keys but it doesn't has an effect. For example if i send the "2"-key for attacking, my character doesn't attack, but the key is sent (i can write in the chatbox ..). So is it possible that cabel uses a function, which distinguish between real keystrokes and fake keystrokes which are sent by SendInput (and if it is possible, how can i bypass it?)?

I really become fucking desperate, because I spent a lot of time in bypassing SendInput in kernel-mode, and now the shit is not working ..

_________________
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sun Dec 09, 2007 2:32 pm    Post subject: Reply with quote

post your SendInput code with all the parameters please
_________________
Back to top
View user's profile Send private message
Deine Mutter
Expert Cheater
Reputation: 1

Joined: 05 Apr 2006
Posts: 181

PostPosted: Sun Dec 09, 2007 2:38 pm    Post subject: Reply with quote

Code:
procedure MySendInput(nInputs: UINT; var pInputs: TInput; cbSize: Integer);stdcall;
[...]
procedure TForm1.Button1Click(Sender: TObject);
var Input: array of TInput;
begin
  Sleep(3000);
  SetLength(Input, 2);
  Input[0].Itype := INPUT_KEYBOARD;
  Input[0].ki.dwFlags := KEYEVENTF_EXTENDEDKEY;
  Input[0].ki.wVk := 50;
  Input[1].Itype := INPUT_KEYBOARD;
  Input[1].ki.dwFlags := KEYEVENTF_KEYUP;
  Input[1].ki.wVk := 50;
  MySendInput(1, Input[0], sizeof(TInput));
  Sleep(100);
  MySendInput(1, Input[1], sizeof(TInput));
end;


I think my function isn't the problem .. because the keys are sent

_________________
Back to top
View user's profile Send private message
fl00d
Newbie cheater
Reputation: 0

Joined: 21 Nov 2007
Posts: 14

PostPosted: Sun Dec 09, 2007 2:50 pm    Post subject: Reply with quote

is this game protected by anything?
Back to top
View user's profile Send private message
Deine Mutter
Expert Cheater
Reputation: 1

Joined: 05 Apr 2006
Posts: 181

PostPosted: Sun Dec 09, 2007 2:51 pm    Post subject: Reply with quote

fl00d wrote:
is this game protected by anything?


GameGuard

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

Joined: 29 Dec 2006
Posts: 804

PostPosted: Sun Dec 09, 2007 3:25 pm    Post subject: Reply with quote

Deine Mutter wrote:
fl00d wrote:
is this game protected by anything?


GameGuard
There's your problem. You've to bypass SendInput and all the hooked functions SendInput is using.
Back to top
View user's profile Send private message
Deine Mutter
Expert Cheater
Reputation: 1

Joined: 05 Apr 2006
Posts: 181

PostPosted: Sun Dec 09, 2007 3:33 pm    Post subject: Reply with quote

Did you read, that i bypassed SendInput in user and kernel-mode (NtUserSendInput)? And did you read that i can send keys?


btw: What do you mean with all the functions SendInput is using?

_________________
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Sun Dec 09, 2007 3:42 pm    Post subject: Reply with quote

Works just like this in Ghost Online. Your problem is DirectInput.

Or... it could be a focus issue. By default your keys are sent to the chatbox unless you set your keyboard focus on the main game, which is easier to remedy.

_________________
Back to top
View user's profile Send private message
Deine Mutter
Expert Cheater
Reputation: 1

Joined: 05 Apr 2006
Posts: 181

PostPosted: Sun Dec 09, 2007 3:46 pm    Post subject: Reply with quote

and what would you suggest me if it is DirectInput or the focus problem?
_________________
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Sun Dec 09, 2007 3:57 pm    Post subject: Reply with quote

DI -> Send keystrokes not at the OS level, but at the game level
FP -> Study how the game determines if the window is active, or that you're in game and mimic it.

_________________
Back to top
View user's profile Send private message
Deine Mutter
Expert Cheater
Reputation: 1

Joined: 05 Apr 2006
Posts: 181

PostPosted: Sun Dec 09, 2007 4:11 pm    Post subject: Reply with quote

I don't think that it is the focus problem .. so .. i'm gonna read something about DirectInput .. thank you
_________________
Back to top
View user's profile Send private message
Cx
Master Cheater
Reputation: 0

Joined: 27 Jul 2007
Posts: 367

PostPosted: Sun Dec 09, 2007 6:34 pm    Post subject: Reply with quote

It's neither; it's how the game reads the input. You can't use just a VKK.
_________________

armed with this small butterfly net
i will face the world alone
& never be lonely.
Back to top
View user's profile Send private message
Deine Mutter
Expert Cheater
Reputation: 1

Joined: 05 Apr 2006
Posts: 181

PostPosted: Mon Dec 10, 2007 4:08 pm    Post subject: Reply with quote

Cx wrote:
It's neither; it's how the game reads the input. You can't use just a VKK.


And what shall i use instead? Scancode?

[EDIT]

Before i will start to learn about DirectInput, i have a question about something what confuses me:



It seems like the lParam of the WM_CHAR message of the original Input (green box) and the lParam of the WM_CHAR message of my fake Input are not the same (although there is the same Virtual Key in both cases). What do i need to modify to change the lParam. I tried to change some parameters when using SendInput .. without success.

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

Joined: 27 Jul 2007
Posts: 367

PostPosted: Mon Dec 10, 2007 5:37 pm    Post subject: Reply with quote

That's the answer.
You don't need to look into DX.
It's because of the hardware keycode; you need to use it.

_________________

armed with this small butterfly net
i will face the world alone
& never be lonely.
Back to top
View user's profile Send private message
Deine Mutter
Expert Cheater
Reputation: 1

Joined: 05 Apr 2006
Posts: 181

PostPosted: Tue Dec 11, 2007 3:28 pm    Post subject: Reply with quote

My bot is working now, thank you very much Mr. Green
_________________
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