Skip to content

gatekeeper1122/PS4RemotePlayInterceptor

 
 

Repository files navigation

PS4 Remote Play Interceptor

nuget

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.

using PS4RemotePlayInterceptor;

class Program
{
    static void Main(string[] args)
    {
        // Setup callback to interceptor
        Interceptor.Callback = new InterceptionDelegate(OnReceiveData);
        // Start watchdog to automatically inject when possible
        Interceptor.Watchdog.Start();

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

        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
  • Emulating DualShock controller

Troubleshoot

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

SOLUTION: Restart PS4 Remote Play.

  • DualshockState Could not be found

SOLUTION: Rename to DualShockState for version >= 0.2.0

  • 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

About

A small .NET library to intercept and inject controls on PS4 Remote Play for Windows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%