Skip to content

A class library designed to help with interacting with SHAR memory. Written with support for .NET Standard 2.0 and .NET Framework 4.0.

License

Notifications You must be signed in to change notification settings

Hampo/SHARMemory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

SHARMemory

A class library designed to help with interacting with SHAR memory. Written with support for .NET Standard 2.0 and .NET Framework 4.0.

Special Thanks

A special thanks to Lucas Cardellini for the original memory classes and concept, plus all their additional help with locating the pointer addresses for the different game versions.

Setup

  • Make sure your project targets x86 (32-bit).
  • Download the latest release or clone and build the repository.
  • Add SHARMemory.dll as a reference in your project.

Usage

The first step is to get a running SHAR Process. There is a helper function, which will either return a Process, or null if not found:

var p = SHARMemory.SHAR.Memory.GetSHARProcess();
if (p == null)
    return; // Process not found, return.

Once a SHAR Process has been found, that can be passed to the constructor of SHAR.Memory:

var sharMemory = new SHARMemory.SHAR.Memory(p);

SHAR.Memory contains a Globals class for static values and a Singletons class for single instance classes. One such singleton class is HitNRunManager.

Singleton classes will return null if they're not yet initialised:

var hitNRunManager = sharMemory.Singletons.HitNRunManager;
if (hitNRunManager == null)
    return; // HitNRunManager not initialised, return.

Once you have verified the instance is initialised, you can use the properties within to affect the game:

HitNRunManager.HitAndRun = 100f;

Putting that all together you get:

void TriggerHitAndRun()
{
    var p = SHARMemory.SHAR.Memory.GetSHARProcess();
    if (p == null)
        return;
    var sharMemory = new SHARMemory.SHAR.Memory(p);

    var hitNRunManager = sharMemory.Singletons.HitNRunManager;
    if (hitNRunManager == null)
        return; // HitNRunManager not initialised, return.

    hitNRunManager.HitAndRun = 100f;
}

About

A class library designed to help with interacting with SHAR memory. Written with support for .NET Standard 2.0 and .NET Framework 4.0.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages