Ghidra is a software reverse engineering (SRE) framework
GP-1288: IDebugControl additions
d-millar1862e439a185
diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/DbgEngNative.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/DbgEngNative.javaindex f92849965f..2fd40d0a4a 100644--- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/DbgEngNative.java+++ b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/DbgEngNative.java@@ -459,4 +459,48 @@ public interface DbgEngNative extends StdCallLibrary {return FIELDS;}}++ public class DEBUG_SPECIFIC_FILTER_PARAMETERS extends Structure {+ public static class ByReference extends DEBUG_SPECIFIC_FILTER_PARAMETERS+ implements Structure.ByReference {+ }++ public static final List<String> FIELDS =+ createFieldsOrder("ExecutionOption", "ContinueOption", "TextSize", "CommandSize",+ "ArgumentSize");++ public ULONG ExecutionOption;+ public ULONG ContinueOption;+ public ULONG TextSize;+ public ULONG CommandSize;+ public ULONG ArgumentSize;++ @Override+ protected List<String> getFieldOrder() {+ return FIELDS;+ }+ }++ public class DEBUG_EXCEPTION_FILTER_PARAMETERS extends Structure {+ public static class ByReference extends DEBUG_EXCEPTION_FILTER_PARAMETERS+ implements Structure.ByReference {+ }++ public static final List<String> FIELDS =+ createFieldsOrder("ExecutionOption", "ContinueOption", "TextSize", "CommandSize",+ "SecondCommandSize", "ExceptionCode");++ public ULONG ExecutionOption;+ public ULONG ContinueOption;+ public ULONG TextSize;+ public ULONG CommandSize;+ public ULONG SecondCommandSize;+ public ULONG ExceptionCode;++ @Override+ protected List<String> getFieldOrder() {+ return FIELDS;+ }+ }+}diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl.javaindex 665e2493b1..5490ad044b 100644--- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl.java+++ b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl.java@@ -21,8 +21,7 @@ import com.sun.jna.platform.win32.WinNT.HRESULT;import com.sun.jna.platform.win32.COM.IUnknown;import com.sun.jna.ptr.PointerByReference;-import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_STACK_FRAME;-import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_VALUE;+import agent.dbgeng.jna.dbgeng.DbgEngNative.*;import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex;import agent.dbgeng.jna.dbgeng.breakpoint.IDebugBreakpoint;@@ -184,4 +183,38 @@ public interface IDebugControl extends IUnknown {HRESULT GetExecutingProcessorType(ULONGByReference Type);HRESULT GetDebuggeeType(ULONGByReference Class, ULONGByReference Qualifier);++ HRESULT GetNumberEventFilters(ULONGByReference SpecificEvents,+ ULONGByReference SpecificExceptions, ULONGByReference ArbitraryExceptions);++ HRESULT GetEventFilterText(ULONG Index, byte[] Buffer, ULONG BufferSize,+ ULONGByReference TextSize);++ HRESULT GetEventFilterCommand(ULONG Index, byte[] Buffer, ULONG BufferSize,+ ULONGByReference CommandSize);++ HRESULT SetEventFilterCommand(ULONG Index, String Command);++ HRESULT GetSpecificFilterParameters(ULONG Start, ULONG Count,+ DEBUG_SPECIFIC_FILTER_PARAMETERS[] Params);++ HRESULT SetSpecificFilterParameters(ULONG Start, ULONG Count,+ DEBUG_SPECIFIC_FILTER_PARAMETERS[] Params);++ HRESULT GetSpecificFilterArgument(ULONG Index, byte[] Buffer, ULONG BufferSize,+ ULONGByReference ArgumentSize);++ HRESULT SetSpecificFilterArgument(ULONG Index, String Argument);++ HRESULT GetExceptionFilterParameters(ULONG Count, ULONGByReference Codes, ULONG Start,+ DEBUG_EXCEPTION_FILTER_PARAMETERS[] Params);++ HRESULT SetExceptionFilterParameters(ULONG Count,+ DEBUG_EXCEPTION_FILTER_PARAMETERS[] Params);++ HRESULT GetExceptionFilterSecondCommand(ULONG Index, byte[] Buffer, ULONG BufferSize,+ ULONGByReference CommandSize);++ HRESULT SetExceptionFilterSecondCommand(ULONG Index, String Command);+}diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl.javaindex 6409d93929..b7268c227f 100644--- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl.java+++ b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl.java@@ -23,8 +23,7 @@ import com.sun.jna.platform.win32.WinDef.*;import com.sun.jna.platform.win32.WinNT.HRESULT;import com.sun.jna.ptr.PointerByReference;-import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_STACK_FRAME;-import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_VALUE;+import agent.dbgeng.jna.dbgeng.DbgEngNative.*;import agent.dbgeng.jna.dbgeng.UnknownWithUtils;import agent.dbgeng.jna.dbgeng.breakpoint.IDebugBreakpoint;@@ -178,4 +177,79 @@ public class WrapIDebugControl extends UnknownWithUtils implements IDebugControlreturn _invokeHR(VTIndices.GET_DEBUGGEE_TYPE, getPointer(), Class, Qualifier);}+ @Override+ public HRESULT GetNumberEventFilters(ULONGByReference SpecificEvents,+ ULONGByReference SpecificExceptions, ULONGByReference ArbitraryExceptions) {+ return _invokeHR(VTIndices.GET_NUMBER_EVENT_FILTERS, getPointer(), SpecificEvents,+ SpecificExceptions, ArbitraryExceptions);+ }++ @Override+ public HRESULT GetEventFilterText(ULONG Index, byte[] Buffer, ULONG BufferSize,+ ULONGByReference TextSize) {+ return _invokeHR(VTIndices.GET_EVENT_FILTER_TEXT, getPointer(), Index, Buffer,+ BufferSize, TextSize);+ }++ @Override+ public HRESULT GetEventFilterCommand(ULONG Index, byte[] Buffer, ULONG BufferSize,+ ULONGByReference CommandSize) {+ return _invokeHR(VTIndices.GET_EVENT_FILTER_COMMAND, getPointer(), Index, Buffer,+ BufferSize, CommandSize);+ }++ @Override+ public HRESULT SetEventFilterCommand(ULONG Index, String Command) {+ return _invokeHR(VTIndices.SET_EVENT_FILTER_COMMAND, getPointer(), Index, Command);+ }++ @Override+ public HRESULT GetSpecificFilterParameters(ULONG Start, ULONG Count,+ DEBUG_SPECIFIC_FILTER_PARAMETERS[] Params) {+ return _invokeHR(VTIndices.SET_EVENT_FILTER_COMMAND, getPointer(), Start, Count, Params);+ }++ @Override+ public HRESULT SetSpecificFilterParameters(ULONG Start, ULONG Count,+ DEBUG_SPECIFIC_FILTER_PARAMETERS[] Params) {+ return _invokeHR(VTIndices.SET_EVENT_FILTER_COMMAND, getPointer(), Start, Count, Params);+ }++ @Override+ public HRESULT GetSpecificFilterArgument(ULONG Index, byte[] Buffer, ULONG BufferSize,+ ULONGByReference ArgumentSize) {+ return _invokeHR(VTIndices.SET_EVENT_FILTER_COMMAND, getPointer(), Index, Buffer,+ BufferSize, ArgumentSize);+ }++ @Override+ public HRESULT SetSpecificFilterArgument(ULONG Index, String Argument) {+ return _invokeHR(VTIndices.SET_EVENT_FILTER_COMMAND, getPointer(), Index, Argument);+ }++ @Override+ public HRESULT GetExceptionFilterParameters(ULONG Count, ULONGByReference Codes, ULONG Start,+ DEBUG_EXCEPTION_FILTER_PARAMETERS[] Params) {+ return _invokeHR(VTIndices.SET_EVENT_FILTER_COMMAND, getPointer(), Count, Codes, Start,+ Params);+ }++ @Override+ public HRESULT SetExceptionFilterParameters(ULONG Count,+ DEBUG_EXCEPTION_FILTER_PARAMETERS[] Params) {+ return _invokeHR(VTIndices.SET_EVENT_FILTER_COMMAND, getPointer(), Count, Params);+ }++ @Override+ public HRESULT GetExceptionFilterSecondCommand(ULONG Index, byte[] Buffer, ULONG BufferSize,+ ULONGByReference CommandSize) {+ return _invokeHR(VTIndices.GET_EXCEPTION_FILTER_SECOND_COMMAND, getPointer(), Index, Buffer,+ BufferSize, CommandSize);+ }++ @Override+ public HRESULT SetExceptionFilterSecondCommand(ULONG Index, String Command) {+ return _invokeHR(VTIndices.SET_EXCEPTION_FILTER_SECOND_COMMAND, getPointer(), Index,+ Command);+ }}