C# Class Binarysharp.MemoryManagement.Threading.ThreadCore

Static core class providing tools for manipulating threads.
Afficher le fichier Open project: ZenLulz/MemorySharp Class Usage Examples

Méthodes publiques

Méthode Description
CreateRemoteThread ( SafeMemoryHandle processHandle, IntPtr startAddress, IntPtr parameter, ThreadCreationFlags creationFlags = ThreadCreationFlags.Run ) : SafeMemoryHandle

Creates a thread that runs in the virtual address space of another process.

GetExitCodeThread ( SafeMemoryHandle threadHandle ) : IntPtr?

Retrieves the termination status of the specified thread.

GetThreadContext ( SafeMemoryHandle threadHandle, ThreadContextFlags contextFlags = ThreadContextFlags.Full ) : ThreadContext

Retrieves the context of the specified thread.

GetThreadSelectorEntry ( SafeMemoryHandle threadHandle, uint selector ) : LdtEntry

Retrieves a descriptor table entry for the specified selector and thread.

NtQueryInformationThread ( SafeMemoryHandle threadHandle ) : ThreadBasicInformation

Retrieves information about the specified thread.

OpenThread ( ThreadAccessFlags accessFlags, int threadId ) : SafeMemoryHandle

Opens an existing thread object.

ResumeThread ( SafeMemoryHandle threadHandle ) : uint

Decrements a thread's suspend count. When the suspend count is decremented to zero, the execution of the thread is resumed.

SetThreadContext ( SafeMemoryHandle threadHandle, ThreadContext context ) : void

Sets the context for the specified thread.

SuspendThread ( SafeMemoryHandle threadHandle ) : uint

Suspends the specified thread.

TerminateThread ( SafeMemoryHandle threadHandle, int exitCode ) : void

Terminates a thread.

WaitForSingleObject ( SafeMemoryHandle handle ) : WaitValues

Waits an infinite amount of time for the specified object to become signaled.

WaitForSingleObject ( SafeMemoryHandle handle, System.TimeSpan timeout ) : WaitValues

Waits until the specified object is in the signaled state or the time-out interval elapses.

Method Details

CreateRemoteThread() public static méthode

Creates a thread that runs in the virtual address space of another process.
public static CreateRemoteThread ( SafeMemoryHandle processHandle, IntPtr startAddress, IntPtr parameter, ThreadCreationFlags creationFlags = ThreadCreationFlags.Run ) : SafeMemoryHandle
processHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the process in which the thread is to be created.
startAddress System.IntPtr A pointer to the application-defined function to be executed by the thread and represents the starting address of the thread in the remote process.
parameter System.IntPtr A pointer to a variable to be passed to the thread function.
creationFlags ThreadCreationFlags The flags that control the creation of the thread.
Résultat Binarysharp.MemoryManagement.Native.SafeMemoryHandle

GetExitCodeThread() public static méthode

Retrieves the termination status of the specified thread.
public static GetExitCodeThread ( SafeMemoryHandle threadHandle ) : IntPtr?
threadHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the thread.
Résultat IntPtr?

GetThreadContext() public static méthode

Retrieves the context of the specified thread.
public static GetThreadContext ( SafeMemoryHandle threadHandle, ThreadContextFlags contextFlags = ThreadContextFlags.Full ) : ThreadContext
threadHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the thread whose context is to be retrieved.
contextFlags ThreadContextFlags Determines which registers are returned or set.
Résultat Binarysharp.MemoryManagement.Native.ThreadContext

GetThreadSelectorEntry() public static méthode

Retrieves a descriptor table entry for the specified selector and thread.
public static GetThreadSelectorEntry ( SafeMemoryHandle threadHandle, uint selector ) : LdtEntry
threadHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the thread containing the specified selector.
selector uint The global or local selector value to look up in the thread's descriptor tables.
Résultat Binarysharp.MemoryManagement.Native.LdtEntry

NtQueryInformationThread() public static méthode

Retrieves information about the specified thread.
public static NtQueryInformationThread ( SafeMemoryHandle threadHandle ) : ThreadBasicInformation
threadHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the thread to query.
Résultat Binarysharp.MemoryManagement.Native.ThreadBasicInformation

OpenThread() public static méthode

Opens an existing thread object.
public static OpenThread ( ThreadAccessFlags accessFlags, int threadId ) : SafeMemoryHandle
accessFlags ThreadAccessFlags The access to the thread object.
threadId int The identifier of the thread to be opened.
Résultat Binarysharp.MemoryManagement.Native.SafeMemoryHandle

ResumeThread() public static méthode

Decrements a thread's suspend count. When the suspend count is decremented to zero, the execution of the thread is resumed.
public static ResumeThread ( SafeMemoryHandle threadHandle ) : uint
threadHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the thread to be restarted.
Résultat uint

SetThreadContext() public static méthode

Sets the context for the specified thread.
public static SetThreadContext ( SafeMemoryHandle threadHandle, ThreadContext context ) : void
threadHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the thread whose context is to be set.
context Binarysharp.MemoryManagement.Native.ThreadContext A pointer to a structure that contains the context to be set in the specified thread.
Résultat void

SuspendThread() public static méthode

Suspends the specified thread.
public static SuspendThread ( SafeMemoryHandle threadHandle ) : uint
threadHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the thread that is to be suspended.
Résultat uint

TerminateThread() public static méthode

Terminates a thread.
public static TerminateThread ( SafeMemoryHandle threadHandle, int exitCode ) : void
threadHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the thread to be terminated.
exitCode int The exit code for the thread.
Résultat void

WaitForSingleObject() public static méthode

Waits an infinite amount of time for the specified object to become signaled.
public static WaitForSingleObject ( SafeMemoryHandle handle ) : WaitValues
handle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the object.
Résultat WaitValues

WaitForSingleObject() public static méthode

Waits until the specified object is in the signaled state or the time-out interval elapses.
public static WaitForSingleObject ( SafeMemoryHandle handle, System.TimeSpan timeout ) : WaitValues
handle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the object.
timeout System.TimeSpan The time-out interval. If this parameter is NULL, the function does not enter a wait state if the object is not signaled; it always returns immediately.
Résultat WaitValues