Exemplo n.º 1
0
        /// <summary>
        ///     Executes the assembly code located in the remote process at the specified address.
        /// </summary>
        /// <param name="address">The address where the assembly code is located.</param>
        /// <param name="parameter">The parameter used to execute the assembly code.</param>
        /// <returns>The return value is the exit code of the thread created to execute the assembly code.</returns>
        public T Execute <T>(IntPtr address, dynamic parameter)
        {
            // Execute and join the code in a new thread
            IARemoteThread thread = Process.ThreadFactory.CreateAndJoin(address, parameter);

            // Return the exit code of the thread
            return(thread.GetExitCode <T>());
        }
Exemplo n.º 2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="AFrozenThread" /> class.
 /// </summary>
 /// <param name="thread">The frozen thread.</param>
 public AFrozenThread(IARemoteThread thread)
 {
     // Save the parameter
     Thread = thread;
 }