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 


Hotkeys for Debugging

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Eurochron89
Newbie cheater
Reputation: 1

Joined: 12 Aug 2015
Posts: 17

PostPosted: Thu Aug 13, 2015 3:41 pm    Post subject: Hotkeys for Debugging Reply with quote

Is it possible to add all the debug Hotkeys to the "Settings > Hotkeys" Tab?

Right now there is only "Debug -> Run" available in that Tab.
But I really need a way to use all the Debug Commands as global hotkeys.

And before you ask why:
I have my game in window mode on one of my screens, and CE is on the other screen.
When I switch to CE the game will automatically enable the ingame menu and therefore most parts of the game are paused.

I need to be able to control the debugging while the game is the active window.
Can this be done with plugins or any other way?
Back to top
View user's profile Send private message
Eurochron89
Newbie cheater
Reputation: 1

Joined: 12 Aug 2015
Posts: 17

PostPosted: Fri Aug 14, 2015 7:46 pm    Post subject: Reply with quote

Well, I just answered this myself: it is possible to do this with a Plugin DLL. Wink
Took me some hours to figure this out and add the global HotKeys, but now it works just fine.

I used the 'Exported.debug_continueFromBreakpoint' function:
Code:
      // debug_continueFromBreakpoint(int continueoption)
      // 0 = Debug -> Run (F9)
      // 1 = Debug -> Step into (F7)
      // 2 = Debug -> Step over (F8)



@DarkByte:
Would you please tell me the easiest way to get the current selected address from the Memory View into the 'Exported.debug_setBreakpoint()' function?

So when I press my hotkey, the DLL loads the current selected address and uses it like this: 'Exported.debug_setBreakpoint(<current address>, 0, 1);'

This is the only part I could not figure out yet, the other hotkeys for Step + Step Over work fine.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 465

Joined: 09 May 2003
Posts: 25540
Location: The netherlands

PostPosted: Fri Aug 14, 2015 7:56 pm    Post subject: Reply with quote

lua hotkeys can work too (createHotkey)

Code:

debug_continueFromBreakpoint(continueMethod) : if the debugger is currently waiting to continue you can continue with this. Valid parameters are :co_run (just continue), co_stepinto(when on top of a call, follow it), co_stepover (when on top of a call run till after the call)


getting the current selected address from Memview is only possible using the lua interface (plugins can use lua too, the lua_state is provided in the exportlist, honestly, I recommend using all lua)

Code:

getMemoryViewForm().disassemblerView.SelectedAddress


And if multiple lines are selected the range end is in
Code:

getMemoryViewForm().disassemblerView.SelectedAddress2




SelectedAddress is both a read and write property so you can use it to change the currently selected address

_________________
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
View user's profile Send private message MSN Messenger
Eurochron89
Newbie cheater
Reputation: 1

Joined: 12 Aug 2015
Posts: 17

PostPosted: Fri Aug 14, 2015 8:16 pm    Post subject: Reply with quote

Dark Byte wrote:
lua hotkeys can work too (createHotkey)

Oh... very easy. Just tested this, works fine. Razz
Too bad I did not know it was possible with Lua... wasted some time on the DLL. Laughing

Dark Byte wrote:
getting the current selected address from Memview is only possible using the lua interface

This works very nice. Thanks for your help!
Back to top
View user's profile Send private message
Eurochron89
Newbie cheater
Reputation: 1

Joined: 12 Aug 2015
Posts: 17

PostPosted: Sun Aug 16, 2015 1:57 am    Post subject: This post has 1 review(s) Reply with quote

When I started to add the global HotKeys to the Lua Script, I had to use different keys than CE,
because otherwise the functions would get triggered twice, when the Memory Viewer was the active window.

So I just looked around the CE Lua Wiki, and finally came up with this:
(note: I did not add [F9], because it is in CE's Settings > HotKeys already)

Code:
-- --------------------------------------------------------------
-- This Script adds global HotKeys for CE's Debugger
-- -> Memory Viewer does not have to be the active window
-- -> debugging can be triggered from any window now
-- --------------------------------------------------------------
-- [F5] Debug: Toggle BreakPoint   - name = Setbreakpoint1
-- [F6] Debug: Execute till return - name = Executetillreturn1
-- [F7] Debug: Step Into           - name = Step1
-- [F8] Debug: Step Over           - name = StepOver1
-- --------------------------------------------------------------
-- [F10] Debug: set BreakPoint at current address +2
-- -> this can be usefull to get out of loops
-- --------------------------------------------------------------

-- [F5] Debug: Toggle BreakPoint
function DebugToggleBreakPoint()
         -- check if the Memory Viewer Window is the current active Window
         -- only execute the function if the Memory Viewer is not active now
         if (getMemoryViewForm().isForegroundWindow() == false) then
                  -- is the debugger already attached?
                  if (debug_isDebugging() == true) then
                              -- Memory Viewer Window Menu: Debug -> Toggle Breakpoint [F5]
                              getMemoryViewForm().Setbreakpoint1.doClick();
                  end
         end
end

-- [F6] Debug: Execute till return
function DebugExecuteTillReturn()
         -- check if the Memory Viewer Window is the current active Window
         -- only execute the function if the Memory Viewer is not active now
         if (getMemoryViewForm().isForegroundWindow() == false) then
                  -- is the debugger already attached?
                  if (debug_isDebugging() == true) then
                              -- Memory Viewer Window Menu: Debug -> Execute till return [F6]
                              getMemoryViewForm().Executetillreturn1.doClick();
                  end
         end
end

-- [F7] Debug: Step Into
function DebugStepInto()
         -- check if the Memory Viewer Window is the current active Window
         -- only execute the function if the Memory Viewer is not active now
         if (getMemoryViewForm().isForegroundWindow() == false) then
                  -- is the debugger already attached?
                  if (debug_isDebugging() == true) then
                              -- Memory Viewer Window Menu: Debug -> Step Into [F7]
                              getMemoryViewForm().Step1.doClick();
                  end
         end
end

-- [F8] Debug: Step Over
function DebugStepOver()
         -- check if the Memory Viewer Window is the current active Window
         -- only execute the function if the Memory Viewer is not active now
         if (getMemoryViewForm().isForegroundWindow() == false) then
                  -- is the debugger already attached?
                  if (debug_isDebugging() == true) then
                              -- Memory Viewer Window Menu: Debug -> Step Over [F8]
                              getMemoryViewForm().StepOver1.doClick();
                  end
         end
end

-- [F10] set BreakPoint at current address +2
-- -> this can be usefull to get out of loops
function CustomBreakPoint2()
         -- is the debugger already running?
         if (debug_isDebugging() == true) then
                  -- get current selected address and add '2'
                  local cAdress = getMemoryViewForm().disassemblerView.SelectedAddress + 2;
                  -- set a new BreakPoint at that changed address
                  debug_setBreakpoint(cAdress);
         end
end

-- --------------------------------------------------------------

-- create global HotKey [F5] Debug: Toggle BreakPoint
createHotkey(DebugToggleBreakPoint, VK_F5);

-- create global HotKey [F6] Debug: Execute till return
createHotkey(DebugExecuteTillReturn, VK_F6);

-- create global HotKey [F7] Debug: Step Into
createHotkey(DebugStepInto, VK_F7);

-- create global HotKey [F8] Debug: Step Over
createHotkey(DebugStepOver, VK_F8);

-- create global HotKey [F10]: set BreakPoint at current address +2
createHotkey(CustomBreakPoint2, VK_F10);

-- --------------------------------------------------------------


Took me some time to figure this all out. It is now working really good. Wink
Maybe someone with the same problem can use this some day, when he finds this thread. ^^
Back to top
View user's profile Send private message
SunBeam
I post too much
Reputation: 65

Joined: 25 Feb 2005
Posts: 4022
Location: Romania

PostPosted: Sun Oct 18, 2015 5:28 pm    Post subject: Reply with quote

For sure Wink Good job!
Back to top
View user's profile Send private message
VENAtory
How do I cheat?
Reputation: 0

Joined: 15 Nov 2024
Posts: 1

PostPosted: Fri Nov 15, 2024 12:29 pm    Post subject: Change Default CE Hotkeys Reply with quote

Is there a way to change the default Debug hotkeys (Memory View)?

Instead of F5/F6/F... I want to use different hotkeys.
I searched for files where these defaults could be stored but found nothing. Sad Crying or Very sad
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
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