A small .NET library to intercept and inject controls on PS4 Remote Play for Windows
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
PS4RemotePlayInterceptor bump to 0.5.2 for nuget Jan 14, 2018
PS4RemotePlayInterceptorConsoleDemo remove test method from console demo Oct 30, 2017
PS4RemotePlayInterceptorDemo fix crashes when closing host before RemotePlay and add utility metho… Jan 2, 2018
.gitignore first commit Aug 15, 2017
LICENSE.md first commit Aug 15, 2017
PS4RemotePlayInterceptor.sln
README.md Update README.md Jan 2, 2018

README.md

PS4 Remote Play Interceptor

nuget NuGet Donate Twitter

A small .NET library to intercept controls on PS4 Remote Play for Windows, powered by EasyHook. The library can be used to automate any PS4 game. See the prototype demo.

Also check out PS4 Macro repository for a ready-to-use software built on this library.

Install

Using NuGet (Recommended)

Install-Package PS4RemotePlayInterceptor

From Source

Add reference to PS4RemotePlayInterceptor.dll.

Example Usage

This console application will hold the X button while moving the left analog stick upwards until interrupted by a keypress.

You can set EmulateController to true to use the library without a DualShock 4 controller plugged in (the real controller must be unplugged).

using PS4RemotePlayInterceptor;

class Program
{
    static void Main(string[] args)
    {
        // Setup callback to interceptor
        Interceptor.Callback = new InterceptionDelegate(OnReceiveData);
        // Emulate controller (BETA)
        Interceptor.EmulateController = false;

        // Start watchdog to automatically inject when possible
        Interceptor.Watchdog.Start();
        // Notify watchdog events
        Interceptor.Watchdog.OnInjectionSuccess = () => Console.WriteLine("Watchdog OnInjectionSuccess");
        Interceptor.Watchdog.OnInjectionFailure = () => Console.WriteLine("Watchdog OnInjectionFailure");

        // Or inject manually and handle exceptions yourself
        //Interceptor.Inject();

        Console.WriteLine("-- Press any key to exit");
        Console.ReadKey();
    }

    private static void OnReceiveData(ref DualShockState state)
    {
        /* -- Modify the controller state here -- */

        // Force press X
        state.Cross = true;

        // Force left analog upwards
        state.LY = 0;

        // Force left analog downwards
        // state.LY = 255;

        // Force left analog to center
        // state.LX = 128;
        // state.LY = 128;
    }
}

To-Do List

  • Intercept ouput reports

Troubleshoot

  • {"STATUS_INTERNAL_ERROR: Unknown error in injected C++ completion routine. (Code: 15)"}

SOLUTION: Restart PS4 Remote Play.

  • Injection IPC failed (on some machines)

SOLUTION: Inject with Compatibility mode instead

// Setup callback to interceptor
Interceptor.Callback = new InterceptionDelegate(OnReceiveData);

// Inject
Interceptor.InjectionMode = InjectionMode.Compatibility;
Interceptor.Inject();

Credits