HOW TO FIND THE ADDRESS WHEN THE BUTTON/KEY IS PRESSED?!!!

Anything Cheat Engine related, bugs, suggestions, helping others, etc..
Post Reply
sherkhan
What is cheating?
What is cheating?
Posts: 1
Joined: Thu Jan 09, 2020 7:56 am
Reputation: 0

HOW TO FIND THE ADDRESS WHEN THE BUTTON/KEY IS PRESSED?!!!

Post by sherkhan » Thu Jan 09, 2020 8:02 am

HELLO GUYZ,
I am new here in this forum,
Can any one please tell me that " how can we find the Address and the Value of the Button/key pressed in the game?"
I use PCSX2 - PS2 EMULATOR. and Cheat engine for hacking.
Thanks

User avatar
TheyCallMeTim13
Administration
Administration
Posts: 1715
Joined: Fri Mar 03, 2017 12:31 am
Reputation: 676

Re: HOW TO FIND THE ADDRESS WHEN THE BUTTON/KEY IS PRESSED?!!!

Post by TheyCallMeTim13 » Thu Jan 09, 2020 10:59 am

In ASM it's a standard windows function, so just do a search for getAsyncKeyState and you should be able to find plenty of posts on it (you can even refine it with "site:cheatengine.org"). With Lua you'll need a timer or a thread and use isKeyPressed or getXBox360ControllerState. I tend to use lua so here is an example key reader from one of my tables.

Code: Select all

{$lua}
if syntaxcheck then return end
------------------------------ ENABLE ------------------------------
[ENABLE]
RunFireSelectKeyReader = true
local function keyReader(thread)
	while RunFireSelectKeyReader do
		local xcs = getXBox360ControllerState()
		if (xcs.LeftTrigger > 50 and xcs.GAMEPAD_DPAD_LEFT)
		or (isKeyPressed(VK_RBUTTON) and isKeyPressed(VK_NUMPAD1)) then
			-- Keys are pressed, do something here
			sleep(300)
		else
			-- Keys aren't press, do nothing
			sleep(0)
		end
		if process == nil or readInteger(process) == 0 then
			-- Process is no longer available so stop key reader
			RunFireSelectKeyReader = false
		end
	end
	thread.terminate()
end
if syntaxcheck then return end
createThread(keyReader)
------------------------------ DISABLE ------------------------------
[DISABLE]
RunFireSelectKeyReader = false
CE wiki - Tutorials CE wiki - Auto Assembler Basics - CE wiki - Lua Basics If it's not a Personal Message don't PM me, use the forum. I ignore PMs that should be asked on the forum.

Post Reply

Who is online

Users browsing this forum: No registered users