0

I have looked everywhere online and I can't seem to find the particular answer that allows this to be fixed. This is literally the only error that I am getting, and I can't build the executable until this is fixed.

int num3 = new VAMemory(Data.processname).ReadInt32(IntPtr.op_Addition(((IEnumerable<Process>)Process.GetProcessesByName(Data.processname)).FirstOrDefault().MainModule.BaseAddress, num2));

Here is the error:

IntPtr.operator + (IntPtr, int) cannot call operator or accessor
Kevin
  • 16,549
  • 8
  • 60
  • 74

1 Answers1

0

You can either

  1. use the IntPtr.Add(IntPtr, Int32) method

    var baseAddress = Process
        .GetProcessesByName(Data.processname)
        .FirstOrDefault()
        .MainModule
        .BaseAddress;
    var address = IntPtr.Add(baseAddress, num2);
    var valueAtAddress = new VAMemory(Data.processname).ReadInt32(address);
    
  2. or transform IntPtr to Int64, add num2, and then transform it back to IntPtr
Eugene Podskal
  • 10,270
  • 5
  • 31
  • 53