C# Класс Binarysharp.MemoryManagement.Threading.ThreadCore

Static core class providing tools for manipulating threads.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

CreateRemoteThread() публичный статический Метод

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.
Результат Binarysharp.MemoryManagement.Native.SafeMemoryHandle

GetExitCodeThread() публичный статический Метод

Retrieves the termination status of the specified thread.
public static GetExitCodeThread ( SafeMemoryHandle threadHandle ) : IntPtr?
threadHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the thread.
Результат IntPtr?

GetThreadContext() публичный статический Метод

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.
Результат Binarysharp.MemoryManagement.Native.ThreadContext

GetThreadSelectorEntry() публичный статический Метод

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.
Результат Binarysharp.MemoryManagement.Native.LdtEntry

NtQueryInformationThread() публичный статический Метод

Retrieves information about the specified thread.
public static NtQueryInformationThread ( SafeMemoryHandle threadHandle ) : ThreadBasicInformation
threadHandle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the thread to query.
Результат Binarysharp.MemoryManagement.Native.ThreadBasicInformation

OpenThread() публичный статический Метод

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.
Результат Binarysharp.MemoryManagement.Native.SafeMemoryHandle

ResumeThread() публичный статический Метод

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.
Результат uint

SetThreadContext() публичный статический Метод

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.
Результат void

SuspendThread() публичный статический Метод

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.
Результат uint

TerminateThread() публичный статический Метод

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.
Результат void

WaitForSingleObject() публичный статический Метод

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.
Результат WaitValues

WaitForSingleObject() публичный статический Метод

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.
Результат WaitValues