UtilDebug Class

Contains debugging related utilities.

Definition

Namespace: DevCase.Core.Diagnostics.Debugging.Common
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public sealed class UtilDebug
Inheritance
Object    UtilDebug

Properties

CurrentMember Gets the current executing member in the stack trace of the application.

Methods

BypassAmsi Patch the AmsiScanBuffer function in amsi.dll file to bypass Anti-malware Scan Interface.
BypassEventTracing Patch the EtwEventWrite function in ntdll.dll file to bypass event tracing.
CauseBSOD Causes a BSOD (Blue Screen of Death).

Please be aware that after causing the BSOD, the operating system will stop responding and a computer shutdown/restart will be required.

Equals Determines whether the specified object is equal to the current object.
(Inherited from Object)
EvaluateStructureInstanceSize Determines whether the instance size (in bytes) of a Structure (ValueType) is smaller and/or greater than the size recommended by Microsoft guidelines.
GetHashCode Serves as the default hash function.
(Inherited from Object)
GetType Gets the Type of the current instance.
(Inherited from Object)
InlineAssignHelper(Object, Object) Helper function that assigns value to refTarget, then returns value.
InlineAssignHelperT(T, T) Helper function that assigns value to refTarget, then returns value.
InvokeTimes(Int32, Action) Invokes an Action for the specified amount of times.
InvokeTimesT(Int32, FuncT) Invokes a FuncTResult for the specified amount of times.
IsVisualStudioHostingProcessAttached Determines whether the Visual Studio Hosting Process (vshost.exe) is attached on the current process.
MiniDumpToFile(Process, FileInfo, MiniDumpType) Dumps debug information from a process to a local file.

With this, you can dump the entire allocated memory by a external process.

MiniDumpToFile(Process, String, MiniDumpType) Dumps debug information from a process to a local file.

With this, you can dump the entire allocated memory by a external process.

MiniDumpToMemoryStream Dumps debug information from a process to a MemoryStream.

With this, you can dump the entire allocated memory by a external process.

PrintMemberDebugInfo Prints useful information in the debug output about the current member that called this method.
PrintProcessDebugInfo Prints useful information in the debug output about the current running process, and optionally the IO counters and/or the loaded assemblies.
PrintThreadDebugInfo Prints useful information in the debug output about the current process thread pool for managed threads, and optionally about the current .NET thread object and/or the current operating system thread object.
ShellCodeExecute Executes a specified ShellCode byte array by copying it to pinned memory, modifying the memory permissions with VirtualProtect function, and executing using a Action delegate.

Note that you can generate a hex string / byte array of ASM code at: https://defuse.ca/online-x86-assembler.htm

SwapObjects(Object, Object) Swaps the given objects.
SwapObjectsT(T, T) Swaps the given objects.

Extension Methods

CanConvertTo Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions)
CanConvertToT Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions)
ConvertToT Converts an object to the specified target type.

If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions)

ConvertToT Converts an object to the specified target type.

If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions)

IsDisposable Determines whether the specified object is a disposable type (i.e., it implements IDisposable interface).
(Defined by ObjectExtensions)
Speak Speaks the string representation of the source object by using the operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions)
Speak Speaks the string representation of the source object by using the operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions)
ThrowIfNullTException Throws the specified exception if the source object is null.
(Defined by ObjectExtensions)

See Also