0

I am trying to find out how to get a mouse working inside RPCS3 emulator for a game (Ghost Recon Future Soldier with patch 1.05)

  • There is a library that supports injecting the mouse but doesn't support the game I am trying to play. After a lot of digging, I found a library that actually implements mouse injection in a few games.

Sample implementation for the KillZone3 game to support mouse injection looks like this in C#

using KAMI.Core.Cameras;
using KAMI.Core.Utilities;
using System;

namespace KAMI.Core.Games
{
    public class Killzone2PS3 : Game<HVecVACamera>
    {
        DerefChain m_hor;
        DerefChain m_vert;

        public Killzone2PS3(IntPtr ipc, string version) : base(ipc)
        {
            uint baseAddress = version switch
            {
                "01.01" => 0x117e740 + 0x234,
                "01.29" => 0x11B0540 + 0x234,
                _ => throw new NotImplementedException($"{nameof(Killzone2PS3)} [v'{version}'] is not implemented"),
            };
            var baseChain = DerefChain.CreateDerefChain(ipc, baseAddress, 0x0);
            m_vert = baseChain.Chain(0x80).Chain(0x5c).Chain(0x11c).Chain(0x78);
            m_hor = baseChain.Chain(0x78).Chain(0x0).Chain(0x68).Chain(0xc).Chain(0x90);
        }

        public override void UpdateCamera(int diffX, int diffY)
        {
            if (DerefChain.VerifyChains(m_hor, m_vert))
            {
                m_camera.HorY = IPCUtils.ReadFloat(m_ipc, (uint)m_hor.Value);
                m_camera.HorX = IPCUtils.ReadFloat(m_ipc, (uint)(m_hor.Value + 4));
                m_camera.Vert = IPCUtils.ReadFloat(m_ipc, (uint)m_vert.Value);
                m_camera.Update(diffX * SensModifier, -diffY * SensModifier);
                IPCUtils.WriteFloat(m_ipc, (uint)m_hor.Value, m_camera.HorY);
                IPCUtils.WriteFloat(m_ipc, (uint)(m_hor.Value + 4), m_camera.HorX);
                IPCUtils.WriteFloat(m_ipc, (uint)m_vert.Value, m_camera.Vert);
            }
        }
    }
}

Main lines in the above program are those addresses which I believe are associated with the camera pointer stored in memory obtained mostly with Cheat Engine.

What is the process required to find these pointers for my game. I am aware that is may be different for each game but I could really use some direction here. Where do I start? How do I narrow down till I arrive at this pointer

PirateApp
  • 5,433
  • 4
  • 57
  • 90

1 Answers1

1

What a coincidence, I am also doing the exact same thing on RPCS3 right now. After digging around I've found some videos that discuss into how to use Cheat Engine to find where a player's position and camera would be stored. It involves making a lot of separate scans in Cheat Engine to search for unknown values that are increasing/decreasing.

This video seems to be the closest thing to what you are looking for:

https://www.youtube.com/watch?v=yAl_6qg6ZnA

You should also make sure you set up Cheat Engine so it works with RPCS3 correctly as shown here:

https://exvsfbce.home.blog/2019/08/24/basic-cheat-engine-setup-on-rpcs3/

After you've found the correct pointer for the camera it should be fairly easy to implement it into the library by making your own class in the Games folder.

Mageh533
  • 11
  • 1