Show / Hide Table of Contents

Class Memory

A low level memory helper

Inheritance
System.Object
Memory
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: HarmonyLib
Assembly: 0Harmony.dll
Syntax
public static class Memory

Methods

| Improve this Doc View Source

DetourMethod(MethodBase, MethodBase)

Detours a method

Declaration
public static string DetourMethod(MethodBase original, MethodBase replacement)
Parameters
Type Name Description
System.Reflection.MethodBase original

The original method/constructor

System.Reflection.MethodBase replacement

The replacement method/constructor

Returns
Type Description
System.String

An error string

| Improve this Doc View Source

GetMethodStart(MethodBase, out Exception)

Gets the start of a method in memory

Declaration
public static long GetMethodStart(MethodBase method, out Exception exception)
Parameters
Type Name Description
System.Reflection.MethodBase method

The method/constructor

System.Exception exception

[out] Details of the exception

Returns
Type Description
System.Int64

The method start address

| Improve this Doc View Source

MarkForNoInlining(MethodBase)

Mark method for no inlining (currently only works on Mono)

Declaration
public static void MarkForNoInlining(MethodBase method)
Parameters
Type Name Description
System.Reflection.MethodBase method

The method/constructor to change

| Improve this Doc View Source

WriteJump(Int64, Int64)

Writes a jump to memory

Declaration
public static string WriteJump(long memory, long destination)
Parameters
Type Name Description
System.Int64 memory

The memory address

System.Int64 destination

Jump destination

Returns
Type Description
System.String

An error string

  • Improve this Doc
  • View Source
Back to top Generated by DocFX