Lua:debugProcess

From Cheat Engine
Jump to navigation Jump to search

<> Lua API Reference

function debugProcess(interface OPTIONAL) : void

Starts the debugger for the currently opened process without asking the user.

If no debugger interface is specified, the default debugger interface is used.

Function Parameters

Parameter Type Description
interface Integer OPTIONAL The debugger interface to use. 0 = default, 1 = Windows debugger, 2 = VEH debugger, 3 = kernel debugger.

Debugger Interfaces

Value Interface Description
0 Default Uses Cheat Engine's default debugger interface.
1 Windows debugger Uses the Windows debugging interface.
2 VEH debugger Uses the VEH debugger.
3 Kernel debugger Uses the kernel debugger.

Returns

This function does not return a value.

Examples

Start the debugger with the default interface

1 debugProcess()

Start the debugger explicitly with the default interface

1 debugProcess(0)

Start the Windows debugger

1 debugProcess(1)

Start the VEH debugger

1 debugProcess(2)

Start the kernel debugger

1 debugProcess(3)

Open a process and start debugging it

1 openProcess("target.exe")
2 
3 if getOpenedProcessID() ~= 0 then
4   debugProcess()
5 end

Choose the debugger interface through a variable

1 local debuggerInterface = 2
2 
3 debugProcess(debuggerInterface)

Use a guarded debugger selection

 1 local debuggerInterface = 2
 2 
 3 if debuggerInterface < 0 or debuggerInterface > 3 then
 4   print("Invalid debugger interface")
 5   return
 6 end
 7 
 8 if getOpenedProcessID() ~= 0 then
 9   debugProcess(debuggerInterface)
10 end

Ask for the debugger interface

 1 local result, value = inputQuery("Debugger", "Interface: 0=Default, 1=Windows, 2=VEH, 3=Kernel", "0")
 2 
 3 if result then
 4   local debuggerInterface = tonumber(value)
 5 
 6   if debuggerInterface == nil or debuggerInterface < 0 or debuggerInterface > 3 then
 7     print("Invalid debugger interface")
 8     return
 9   end
10 
11   debugProcess(debuggerInterface)
12 end

Main Pages

Core Lua documentation entry points

Lua
Script Engine