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 »

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

TimFun13
Expert Cheater
Expert Cheater
Posts: 1353
Joined: Fri Mar 03, 2017 12:31 am
Reputation: 7

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

Post by TimFun13 »

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

Post Reply

Who is online

Users browsing this forum: No registered users