Difference between revisions of "Lua:debugProcess"
Jump to navigation
Jump to search
m (moved debugProcess to Lua:debugProcess) |
(Major overhaul of the post.) |
||
| Line 1: | Line 1: | ||
[[Category:Lua]] | [[Category:Lua]] | ||
| − | '''function''' debugProcess('' | + | {{CodeBox|'''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=== | ===Function Parameters=== | ||
| − | {|width="85%" cellpadding="10 | + | {|width="85%" cellpadding="10%" cellspacing="0" border="0" |
!align="left"|Parameter | !align="left"|Parameter | ||
!align="left"|Type | !align="left"|Type | ||
!style="width: 80%;background-color:white;" align="left"|Description | !style="width: 80%;background-color:white;" align="left"|Description | ||
|- | |- | ||
| − | | | + | |interface |
| − | |Integer | + | |Integer OPTIONAL |
| − | | | + | |The debugger interface to use. 0 = default, 1 = Windows debugger, 2 = VEH debugger, 3 = kernel debugger. |
| − | 0=default | ||
| − | 1= | ||
| − | 2= | ||
| − | 3= | ||
|} | |} | ||
| + | ===Debugger Interfaces=== | ||
| + | {|width="85%" cellpadding="10%" cellspacing="0" border="0" | ||
| + | !align="left"|Value | ||
| + | !align="left"|Interface | ||
| + | !style="width: 80%;background-color:white;" align="left"|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==== | ||
| + | <syntaxhighlight lang="lua" line highlight="1"> | ||
| + | debugProcess() | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====Start the debugger explicitly with the default interface==== | ||
| + | <syntaxhighlight lang="lua" line highlight="1"> | ||
| + | debugProcess(0) | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====Start the Windows debugger==== | ||
| + | <syntaxhighlight lang="lua" line highlight="1"> | ||
| + | debugProcess(1) | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====Start the VEH debugger==== | ||
| + | <syntaxhighlight lang="lua" line highlight="1"> | ||
| + | debugProcess(2) | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====Start the kernel debugger==== | ||
| + | <syntaxhighlight lang="lua" line highlight="1"> | ||
| + | debugProcess(3) | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====Open a process and start debugging it==== | ||
| + | <syntaxhighlight lang="lua" line highlight="4"> | ||
| + | openProcess("target.exe") | ||
| + | |||
| + | if getOpenedProcessID() ~= 0 then | ||
| + | debugProcess() | ||
| + | end | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====Choose the debugger interface through a variable==== | ||
| + | <syntaxhighlight lang="lua" line highlight="3"> | ||
| + | local debuggerInterface = 2 | ||
| + | |||
| + | debugProcess(debuggerInterface) | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====Use a guarded debugger selection==== | ||
| + | <syntaxhighlight lang="lua" line highlight="9"> | ||
| + | local debuggerInterface = 2 | ||
| + | |||
| + | if debuggerInterface < 0 or debuggerInterface > 3 then | ||
| + | print("Invalid debugger interface") | ||
| + | return | ||
| + | end | ||
| + | |||
| + | if getOpenedProcessID() ~= 0 then | ||
| + | debugProcess(debuggerInterface) | ||
| + | end | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====Ask for the debugger interface==== | ||
| + | <syntaxhighlight lang="lua" line highlight="11"> | ||
| + | local result, value = inputQuery("Debugger", "Interface: 0=Default, 1=Windows, 2=VEH, 3=Kernel", "0") | ||
| + | |||
| + | if result then | ||
| + | local debuggerInterface = tonumber(value) | ||
| + | |||
| + | if debuggerInterface == nil or debuggerInterface < 0 or debuggerInterface > 3 then | ||
| + | print("Invalid debugger interface") | ||
| + | return | ||
| + | end | ||
| + | |||
| + | debugProcess(debuggerInterface) | ||
| + | end | ||
| + | </syntaxhighlight> | ||
{{LuaSeeAlso}} | {{LuaSeeAlso}} | ||
Latest revision as of 00:48, 27 June 2026
Starts the debugger for the currently opened process without asking the user.
If no debugger interface is specified, the default debugger interface is used.
Contents
- 1 Function Parameters
- 2 Debugger Interfaces
- 3 Returns
- 4 Examples
- 4.1 Start the debugger with the default interface
- 4.2 Start the debugger explicitly with the default interface
- 4.3 Start the Windows debugger
- 4.4 Start the VEH debugger
- 4.5 Start the kernel debugger
- 4.6 Open a process and start debugging it
- 4.7 Choose the debugger interface through a variable
- 4.8 Use a guarded debugger selection
- 4.9 Ask for the debugger interface
Function Parameters[edit]
| Parameter | Type | Description |
|---|---|---|
| interface | Integer OPTIONAL | The debugger interface to use. 0 = default, 1 = Windows debugger, 2 = VEH debugger, 3 = kernel debugger. |
Debugger Interfaces[edit]
| 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[edit]
This function does not return a value.
Examples[edit]
Start the debugger with the default interface[edit]
1 debugProcess()
Start the debugger explicitly with the default interface[edit]
1 debugProcess(0)
Start the Windows debugger[edit]
1 debugProcess(1)
Start the VEH debugger[edit]
1 debugProcess(2)
Start the kernel debugger[edit]
1 debugProcess(3)
Open a process and start debugging it[edit]
1 openProcess("target.exe")
2
3 if getOpenedProcessID() ~= 0 then
4 debugProcess()
5 end
Choose the debugger interface through a variable[edit]
1 local debuggerInterface = 2
2
3 debugProcess(debuggerInterface)
Use a guarded debugger selection[edit]
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[edit]
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