 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
loginphp Cheater
Reputation: 0
Joined: 02 May 2013 Posts: 25
|
Posted: Thu Jul 25, 2013 11:56 pm Post subject: How can I create typable commands in a game? 8mth struggle! |
|
|
I guess my question is: How do I create commands in a chat console to execute my codes?
Even moreso I'd like to know how this can be done without knowing how to make code caves because I work too many hours to learn all of that for now, so I'm hoping there is actually a clever method of creating commands without having to learn a manual - at least for now. Unless there's an easy and quick way to create a code cave that you can kindly show me
So, as you may know, many different types of games have consoles in them for chatting or typing game commands.
I have a noclip, so for example I'd like to make a command that let's me type "/noclip" and then it automatically creates a JMP or CALL to the code I have create for noclip.
Is this possible? And if so, can you give me a very tiny example script of that? By the way, I have never wrote an auto-assemble script before and neither do I understand how it all goes. However I have tried once before
So how does it work? Am I supposed to find the address that shows what I type, and then make a JMP code to my noclip address when a specific alphabet is seen? If I type "/noclip" should I find the address that sees the letter "p" and then make a jump from there? I tried that before with an auto-assemble script and it doesn't work. It executes the code immediately, I don't want that. I want to be able to make commands in the console and this has been an 8 month struggle for me. I'd like to find out once and for all how this is done.
Here's how I've tried it, but it doesn't work. Keep in mind I don't understand auto-assemble scripts so I was just looking at youtube video's of scripts and thought I'd try this method.
[ENABLE]
alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
originalcode:
daa
exit:
jmp returnhere
007C7578:
jmp 0041DC1C
returnhere:
[DISABLE]
As you can see, the originalcode says "daa", in this game that code stands for the letter "p", and this is held at the address 007C7578, so I want the script to be able to detect the letter 'p' which is "daa" and make a jump to 0041DC1C which is my noclip and execute it.
How in the world do I make a command in a typable console?
Thanks guys =P You are all awesome =]
_________________
What is a "signature"? |
|
Back to top |
|
 |
loginphp Cheater
Reputation: 0
Joined: 02 May 2013 Posts: 25
|
Posted: Sat Jul 27, 2013 12:02 am Post subject: |
|
|
I guess nobody has ever done this with CE before? =\
_________________
What is a "signature"? |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25788 Location: The netherlands
|
Posted: Sat Jul 27, 2013 2:54 am Post subject: |
|
|
You have to implement this from scratch yourself if the game has no chat or console itself
(Hook the window message handler or directinput8 and then check what is typed
Perhaps also a direct3d or opengl hook to show an input box and render the text you type
Cheat engine does have a build in option to add a console to the game(d3dhook), but it's not always working in every game, and it takes lua command, not custom command. ( so noclip() instead of /noclip )
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sat Jul 27, 2013 5:02 am Post subject: |
|
|
I just made something similar (but we don't see what we type, something like "konami code"). It works like "hidden" console.
Explanation:
- you must create hotkey for each button you need, create with customCreateHotkey
- it searches for patterns, like: anychar,...,anychar,G,O,D or anychar,...,anychar,N,O,C,L,I,P
Example, you play the FPS game and you want to toggle god mode: just press G then O then D;
You want to toggle no-clip : just press N then O then C then L then I then P
Of course you have to modify toggleCheat function.
Code: | function customCreateHotkey(key,c)
local hotkey = createHotkey(pressedKeys,key)
hotkey.DelayBetweenActivate = 300
collectedHotkeys[userDataToInteger(hotkey)] = {object=hotkey, char=c}
end
function destroyHotkeys()
if collectedHotkeys==nil then return end
for k,v in pairs(collectedHotkeys) do v.object.destroy() end
collectedHotkeys = {}
end
function pressedKeys(sender)
inputString = inputString .. collectedHotkeys[userDataToInteger(sender)].char:upper()
if #inputString>50 then inputString = inputString:sub(-25) end
local cheatNumber = nil
for i=1,#cheatStrings do
if inputString:match(cheatStrings[i]:upper()) then
cheatNumber = i
inputString = ''
break
end
end
if cheatNumber then toggleCheat(cheatNumber) end
end
function toggleCheat(cheat)
print('toggle cheat #'..cheat..' '..cheatStrings[cheat])
end
cheatStrings = {}
cheatStrings[1] = "noclip"
cheatStrings[2] = "god"
inputString = ''
destroyHotkeys()
customCreateHotkey(VK_C,'c')
customCreateHotkey(VK_D,'d')
customCreateHotkey(VK_G,'g')
customCreateHotkey(VK_I,'i')
customCreateHotkey(VK_L,'l')
customCreateHotkey(VK_N,'n')
customCreateHotkey(VK_O,'o')
customCreateHotkey(VK_P,'p') |
Edit:
typo
_________________
Last edited by mgr.inz.Player on Sat Jul 27, 2013 5:37 pm; edited 1 time in total |
|
Back to top |
|
 |
loginphp Cheater
Reputation: 0
Joined: 02 May 2013 Posts: 25
|
Posted: Sat Jul 27, 2013 5:28 pm Post subject: |
|
|
Interesting guys, thanks. The game I play already has a console so I don't have to worry about creating one. What you guys just said is awesome but it went completely over my head lol I guess there's no easy explanation of this and I will not be able to do this after all.
I figured I would ask because the concept seems rather simple to pull off, but besides that I have no knowledge of making an LUA script, unless you posted me a template script that I can try using and learning from.
Anyway, thank guys =] Back to using CE the only way I guess I know how!
_________________
What is a "signature"? |
|
Back to top |
|
 |
|
|
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
|
|