Post: Problem with my tool
03-24-2014, 05:53 AM #1
Dark Spirits
Climbing up the ladder
(adsbygoogle = window.adsbygoogle || []).push({}); I keep getting

"An object reference is required for the non-static field, method, or property 'ModdingTool.Form1.PS3"

when I add the RPC CEX/DEX code in

#region RPC
private static uint function_address = 0x0049C140;
public static int CallFunction(uint func_address, params object[] parameters)
{
int length = parameters.Length;
uint num2 = 0;
for (uint i = 0; i < length; i++)
{
if (parameters is int)
{
byte[] array = BitConverter.GetBytes((int)parameters);
Array.Reverse(array);
PS3.SetMemory(0x10050000 + ((i + num2) * 4), array);
}
else if (parameters is uint)
{
byte[] buffer2 = BitConverter.GetBytes((uint)parameters);
Array.Reverse(buffer2);
PS3.SetMemory(0x10050000 + ((i + num2) * 4), buffer2);
}
else if (parameters is string)
{
byte[] buffer3 = Encoding.UTF8.GetBytes(Convert.ToString(parameters) + "\0");
PS3.SetMemory(0x10050054 + (i * 0x400), buffer3);
uint num4 = 0x10050054 + (i * 0x400);
byte[] buffer4 = BitConverter.GetBytes(num4);
Array.Reverse(buffer4);
PS3.SetMemory(0x10050000 + ((i + num2) * 4), buffer4);
}
else if (parameters is float)
{
num2++;
byte[] buffer5 = BitConverter.GetBytes((float)parameters);
Array.Reverse(buffer5);
PS3.SetMemory(0x10050024 + ((num2 - 1) * 4), buffer5);
}
}
byte[] bytes = BitConverter.GetBytes(func_address);
Array.Reverse(bytes);
PS3.SetMemory(0x1005004c, bytes);
System.Threading.Thread.Sleep(20);
byte[] memory = new byte[4];
PS3.GetMemory(0x10050050, memory);
Array.Reverse(memory);
return BitConverter.ToInt32(memory, 0);
}

public static void WritePPC()
{
PS3.SetMemory(function_address, new byte[] { 0x4e, 0x80, 0, 0x20 });
System.Threading.Thread.Sleep(20);
byte[] memory = new byte[] {
0x7c, 8, 2, 0xa6, 0xf8, 1, 0, 0x80, 60, 0x60, 0x10, 5, 0x81, 0x83, 0, 0x4c,
0x2c, 12, 0, 0, 0x41, 130, 0, 100, 0x80, 0x83, 0, 4, 0x80, 0xa3, 0, 8,
0x80, 0xc3, 0, 12, 0x80, 0xe3, 0, 0x10, 0x81, 3, 0, 20, 0x81, 0x23, 0, 0x18,
0x81, 0x43, 0, 0x1c, 0x81, 0x63, 0, 0x20, 0xc0, 0x23, 0, 0x24, 0xc0, 0x43, 0, 40,
0xc0, 0x63, 0, 0x2c, 0xc0, 0x83, 0, 0x30, 0xc0, 0xa3, 0, 0x34, 0xc0, 0xc3, 0, 0x38,
0xc0, 0xe3, 0, 60, 0xc1, 3, 0, 0x40, 0xc1, 0x23, 0, 0x48, 0x80, 0x63, 0, 0,
0x7d, 0x89, 3, 0xa6, 0x4e, 0x80, 4, 0x21, 60, 0x80, 0x10, 5, 0x38, 160, 0, 0,
0x90, 0xa4, 0, 0x4c, 0x90, 100, 0, 80, 0xe8, 1, 0, 0x80, 0x7c, 8, 3, 0xa6,
0x38, 0x21, 0, 0x70, 0x4e, 0x80, 0, 0x20
};
PS3.SetMemory(function_address + 4, memory);
PS3.SetMemory(0x10050000, new byte[0x2854]);
PS3.SetMemory(function_address, new byte[] { 0xf8, 0x21, 0xff, 0x91 });
}
#endregion

Only all the "PS3" are underlined red.
(adsbygoogle = window.adsbygoogle || []).push({});

The following user thanked Dark Spirits for this useful post:

Hori_By_Nature
03-24-2014, 12:59 PM #2
zSunriseModz
Climbing up the ladder
Create a new class called You must login or register to view this content., double click on it and add this:

    public static byte[] BIND = new byte[4];
public static uint ProcessID;
public static uint[] processIDs;
private static string usage;
public static PS3TMAPI.ConnectStatus connectStatus;
public static string Status;

public static void Connect()
{
PS3TMAPI.InitTargetComms();
PS3TMAPI.Connect(0, null);
}
public static void AttachProcess()
{
PS3TMAPI.GetProcessList(0, out processIDs);
ulong uProcess = processIDs[0];
ProcessID = Convert.ToUInt32(uProcess);
PS3TMAPI.ProcessAttach(0, PS3TMAPI.UnitType.PPU, ProcessID);
PS3TMAPI.ProcessContinue(0, ProcessID);
}
public static void GetStatus()
{
Status = Convert.ToString(PS3TMAPI.GetConnectStatus(0, out connectStatus, out usage));
}
public static void SetMemory(uint Address, byte[] Bytes)
{
PS3TMAPI.ProcessSetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, Address, Bytes);
}
public static void GetMemory(uint Address, byte[] Bytes)
{
PS3TMAPI.ProcessGetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, Address, ref Bytes);
}
}
03-24-2014, 04:41 PM #3
Dark Spirits
Climbing up the ladder
Originally posted by ResistTheSunrise View Post
Create a new class called You must login or register to view this content., double click on it and add this:

    public static byte[] BIND = new byte[4];
public static uint ProcessID;
public static uint[] processIDs;
private static string usage;
public static PS3TMAPI.ConnectStatus connectStatus;
public static string Status;

public static void Connect()
{
PS3TMAPI.InitTargetComms();
PS3TMAPI.Connect(0, null);
}
public static void AttachProcess()
{
PS3TMAPI.GetProcessList(0, out processIDs);
ulong uProcess = processIDs[0];
ProcessID = Convert.ToUInt32(uProcess);
PS3TMAPI.ProcessAttach(0, PS3TMAPI.UnitType.PPU, ProcessID);
PS3TMAPI.ProcessContinue(0, ProcessID);
}
public static void GetStatus()
{
Status = Convert.ToString(PS3TMAPI.GetConnectStatus(0, out connectStatus, out usage));
}
public static void SetMemory(uint Address, byte[] Bytes)
{
PS3TMAPI.ProcessSetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, Address, Bytes);
}
public static void GetMemory(uint Address, byte[] Bytes)
{
PS3TMAPI.ProcessGetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, Address, ref Bytes);
}
}


yes but I'm trying to get it to work with cex i do not want dex. Can you get it to work?
03-24-2014, 07:26 PM #4
flynhigh09
Little One
try with a class bracket around it.. like this
    
#region RPC //-- CEX/DEX - 1.09
private static class RPC
{
private static uint function_address = 0x0049C140;

public static int Call(uint func_address, params object[] parameters)
{
int length = parameters.Length;
uint num2 = 0;
for (uint i = 0; i < length; i++)
{
byte[] buffer;
if (parameters[i] is int)
{
buffer = BitConverter.GetBytes((int) parameters[i]);
Array.Reverse(buffer);
CEX.SetMemory(0x10050000 + ((i + num2)*4), buffer);
}
else if (parameters[i] is uint)
{
buffer = BitConverter.GetBytes((uint) parameters[i]);
Array.Reverse(buffer);
CEX.SetMemory(0x10050000 + ((i + num2)*4), buffer);
}
else if (parameters[i] is string)
{
byte[] buffer2 = Encoding.UTF8.GetBytes(Convert.ToString(parameters[i]) + "\0");
CEX.SetMemory(0x10050054 + (i*0x400), buffer2);
uint num4 = 0x10050054 + (i*0x400);
byte[] array = BitConverter.GetBytes(num4);
Array.Reverse(array);
CEX.SetMemory(0x10050000 + ((i + num2)*4), array);
}
else if (parameters[i] is float)
{
num2++;
buffer = BitConverter.GetBytes((float) parameters[i]);
Array.Reverse(buffer);
CEX.SetMemory(0x10050024 + ((num2 - 1)*4), buffer);
}
}
byte[] bytes = BitConverter.GetBytes(func_address);
Array.Reverse(bytes);
CEX.SetMemory(0x1005004C, bytes);
System.Threading.Thread.Sleep(20);
byte[] buffer5 = new byte[4];
CEX.GetMemory(0x10050050, buffer5);
Array.Reverse(buffer5);
return BitConverter.ToInt32(buffer5, 0);
}
public static void Write_RPC()
{
CEX.SetMemory(function_address, new byte[] {0x4e, 0x80, 0, 0x20});
Thread.Sleep(20);
byte[] buffer = new byte[]
{
0x7c, 8, 2, 0xa6, 0xf8, 1, 0, 0x80, 60, 0x60, 0x10, 5, 0x81, 0x83, 0, 0x4c, 0x2c, 12, 0, 0, 0x41,
130, 0,
100, 0x80, 0x83, 0, 4, 0x80, 0xa3, 0, 8,
0x80, 0xc3, 0, 12, 0x80, 0xe3, 0, 0x10, 0x81, 3, 0, 20, 0x81, 0x23, 0, 0x18,
0x81, 0x43, 0, 0x1c, 0x81, 0x63, 0, 0x20, 0xc0, 0x23, 0, 0x24, 0xc0, 0x43, 0, 40, 0xc0, 0x63, 0,
0x2c,
0xc0, 0x83, 0, 0x30, 0xc0, 0xa3, 0, 0x34, 0xc0, 0xc3, 0, 0x38,
0xc0, 0xe3, 0, 60, 0xc1, 3, 0, 0x40, 0xc1, 0x23, 0, 0x48, 0x80, 0x63, 0, 0, 0x7d, 0x89, 3, 0xa6,
0x4e,
0x80, 4, 0x21, 60, 0x80, 0x10, 5, 0x38, 160, 0, 0,
0x90, 0xa4, 0, 0x4c, 0x80, 100, 0, 80, 0xe8, 1, 0, 0x80, 0x7c, 8, 3, 0xa6, 0x38, 0x21, 0, 0x70, 0x4e,
0x80, 0, 0x20
};
CEX.SetMemory(function_address + 4, buffer);
CEX.SetMemory(0x10050000, new byte[0x2854]);
CEX.SetMemory(function_address, new byte[] {0xf8, 0x21, 0xff, 0x91});
}
}
#endregion
03-24-2014, 07:33 PM #5
Dark Spirits
Climbing up the ladder
Originally posted by flynhigh09 View Post
try with a class bracket around it.. like this
    
#region RPC //-- CEX/DEX - 1.09
private static class RPC
{
private static uint function_address = 0x0049C140;

public static int Call(uint func_address, params object[] parameters)
{
int length = parameters.Length;
uint num2 = 0;
for (uint i = 0; i < length; i++)
{
byte[] buffer;
if (parameters[i] is int)
{
buffer = BitConverter.GetBytes((int) parameters[i]);
Array.Reverse(buffer);
CEX.SetMemory(0x10050000 + ((i + num2)*4), buffer);
}
else if (parameters[i] is uint)
{
buffer = BitConverter.GetBytes((uint) parameters[i]);
Array.Reverse(buffer);
CEX.SetMemory(0x10050000 + ((i + num2)*4), buffer);
}
else if (parameters[i] is string)
{
byte[] buffer2 = Encoding.UTF8.GetBytes(Convert.ToString(parameters[i]) + "\0");
CEX.SetMemory(0x10050054 + (i*0x400), buffer2);
uint num4 = 0x10050054 + (i*0x400);
byte[] array = BitConverter.GetBytes(num4);
Array.Reverse(array);
CEX.SetMemory(0x10050000 + ((i + num2)*4), array);
}
else if (parameters[i] is float)
{
num2++;
buffer = BitConverter.GetBytes((float) parameters[i]);
Array.Reverse(buffer);
CEX.SetMemory(0x10050024 + ((num2 - 1)*4), buffer);
}
}
byte[] bytes = BitConverter.GetBytes(func_address);
Array.Reverse(bytes);
CEX.SetMemory(0x1005004C, bytes);
System.Threading.Thread.Sleep(20);
byte[] buffer5 = new byte[4];
CEX.GetMemory(0x10050050, buffer5);
Array.Reverse(buffer5);
return BitConverter.ToInt32(buffer5, 0);
}
public static void Write_RPC()
{
CEX.SetMemory(function_address, new byte[] {0x4e, 0x80, 0, 0x20});
Thread.Sleep(20);
byte[] buffer = new byte[]
{
0x7c, 8, 2, 0xa6, 0xf8, 1, 0, 0x80, 60, 0x60, 0x10, 5, 0x81, 0x83, 0, 0x4c, 0x2c, 12, 0, 0, 0x41,
130, 0,
100, 0x80, 0x83, 0, 4, 0x80, 0xa3, 0, 8,
0x80, 0xc3, 0, 12, 0x80, 0xe3, 0, 0x10, 0x81, 3, 0, 20, 0x81, 0x23, 0, 0x18,
0x81, 0x43, 0, 0x1c, 0x81, 0x63, 0, 0x20, 0xc0, 0x23, 0, 0x24, 0xc0, 0x43, 0, 40, 0xc0, 0x63, 0,
0x2c,
0xc0, 0x83, 0, 0x30, 0xc0, 0xa3, 0, 0x34, 0xc0, 0xc3, 0, 0x38,
0xc0, 0xe3, 0, 60, 0xc1, 3, 0, 0x40, 0xc1, 0x23, 0, 0x48, 0x80, 0x63, 0, 0, 0x7d, 0x89, 3, 0xa6,
0x4e,
0x80, 4, 0x21, 60, 0x80, 0x10, 5, 0x38, 160, 0, 0,
0x90, 0xa4, 0, 0x4c, 0x80, 100, 0, 80, 0xe8, 1, 0, 0x80, 0x7c, 8, 3, 0xa6, 0x38, 0x21, 0, 0x70, 0x4e,
0x80, 0, 0x20
};
CEX.SetMemory(function_address + 4, buffer);
CEX.SetMemory(0x10050000, new byte[0x2854]);
CEX.SetMemory(function_address, new byte[] {0xf8, 0x21, 0xff, 0x91});
}
}
#endregion


Alright I'll try that when I get home.. I know for all my other things on my tool I use PS3.SetMemory and stuff and they dont come up with errors I just dont get why it results into and error with the RPC region just the "PS3" lines all the "PS3" on it are underlines red. thanks i'll try what you told me to use when I get home. Smile

Also when I get this working, how to I use a button to set the RPC on like a checkbox Thanks broo I appreciate the help.
03-24-2014, 08:05 PM #6
Originally posted by Dark
I keep getting

"An object reference is required for the non-static field, method, or property 'ModdingTool.Form1.PS3"

when I add the RPC CEX/DEX code in

#region RPC
private static uint function_address = 0x0049C140;
public static int CallFunction(uint func_address, params object[] parameters)
{
int length = parameters.Length;
uint num2 = 0;
for (uint i = 0; i < length; i++)
{
if (parameters is int)
{
byte[] array = BitConverter.GetBytes((int)parameters);
Array.Reverse(array);
PS3.SetMemory(0x10050000 + ((i + num2) * 4), array);
}
else if (parameters is uint)
{
byte[] buffer2 = BitConverter.GetBytes((uint)parameters);
Array.Reverse(buffer2);
PS3.SetMemory(0x10050000 + ((i + num2) * 4), buffer2);
}
else if (parameters is string)
{
byte[] buffer3 = Encoding.UTF8.GetBytes(Convert.ToString(parameters) + "\0");
PS3.SetMemory(0x10050054 + (i * 0x400), buffer3);
uint num4 = 0x10050054 + (i * 0x400);
byte[] buffer4 = BitConverter.GetBytes(num4);
Array.Reverse(buffer4);
PS3.SetMemory(0x10050000 + ((i + num2) * 4), buffer4);
}
else if (parameters is float)
{
num2++;
byte[] buffer5 = BitConverter.GetBytes((float)parameters);
Array.Reverse(buffer5);
PS3.SetMemory(0x10050024 + ((num2 - 1) * 4), buffer5);
}
}
byte[] bytes = BitConverter.GetBytes(func_address);
Array.Reverse(bytes);
PS3.SetMemory(0x1005004c, bytes);
System.Threading.Thread.Sleep(20);
byte[] memory = new byte[4];
PS3.GetMemory(0x10050050, memory);
Array.Reverse(memory);
return BitConverter.ToInt32(memory, 0);
}

public static void WritePPC()
{
PS3.SetMemory(function_address, new byte[] { 0x4e, 0x80, 0, 0x20 });
System.Threading.Thread.Sleep(20);
byte[] memory = new byte[] {
0x7c, 8, 2, 0xa6, 0xf8, 1, 0, 0x80, 60, 0x60, 0x10, 5, 0x81, 0x83, 0, 0x4c,
0x2c, 12, 0, 0, 0x41, 130, 0, 100, 0x80, 0x83, 0, 4, 0x80, 0xa3, 0, 8,
0x80, 0xc3, 0, 12, 0x80, 0xe3, 0, 0x10, 0x81, 3, 0, 20, 0x81, 0x23, 0, 0x18,
0x81, 0x43, 0, 0x1c, 0x81, 0x63, 0, 0x20, 0xc0, 0x23, 0, 0x24, 0xc0, 0x43, 0, 40,
0xc0, 0x63, 0, 0x2c, 0xc0, 0x83, 0, 0x30, 0xc0, 0xa3, 0, 0x34, 0xc0, 0xc3, 0, 0x38,
0xc0, 0xe3, 0, 60, 0xc1, 3, 0, 0x40, 0xc1, 0x23, 0, 0x48, 0x80, 0x63, 0, 0,
0x7d, 0x89, 3, 0xa6, 0x4e, 0x80, 4, 0x21, 60, 0x80, 0x10, 5, 0x38, 160, 0, 0,
0x90, 0xa4, 0, 0x4c, 0x90, 100, 0, 80, 0xe8, 1, 0, 0x80, 0x7c, 8, 3, 0xa6,
0x38, 0x21, 0, 0x70, 0x4e, 0x80, 0, 0x20
};
PS3.SetMemory(function_address + 4, memory);
PS3.SetMemory(0x10050000, new byte[0x2854]);
PS3.SetMemory(function_address, new byte[] { 0xf8, 0x21, 0xff, 0x91 });
}
#endregion

Only all the "PS3" are underlined red.


I had the same problem with mine it's good to see some replies that can also help me Happy Tiphat
03-24-2014, 08:11 PM #7
zSunriseModz
Climbing up the ladder
Originally posted by Dark
yes but I'm trying to get it to work with cex i do not want dex. Can you get it to work?


With this class, you can use cex and dex. If you won't use dex there isn't a problem, just do like that:

That's the RPC on my tool:
You must login or register to view this content.
You must login or register to view this content.

You see some error? No.

Now, you need to do how i've already said, create a new class called Ps3Memory and add the code

    public static byte[] BIND = new byte[4];
public static uint ProcessID;
public static uint[] processIDs;
private static string usage;
public static PS3TMAPI.ConnectStatus connectStatus;
public static string Status;

public static void Connect()
{
PS3TMAPI.InitTargetComms();
PS3TMAPI.Connect(0, null);
}
public static void AttachProcess()
{
PS3TMAPI.GetProcessList(0, out processIDs);
ulong uProcess = processIDs[0];
ProcessID = Convert.ToUInt32(uProcess);
PS3TMAPI.ProcessAttach(0, PS3TMAPI.UnitType.PPU, ProcessID);
PS3TMAPI.ProcessContinue(0, ProcessID);
}
public static void GetStatus()
{
Status = Convert.ToString(PS3TMAPI.GetConnectStatus(0, out connectStatus, out usage));
}
public static void SetMemory(uint Address, byte[] Bytes)
{
PS3TMAPI.ProcessSetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, Address, Bytes);
}
public static void GetMemory(uint Address, byte[] Bytes)
{
PS3TMAPI.ProcessGetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, Address, ref Bytes);
}
}

The following user thanked zSunriseModz for this useful post:

Hori_By_Nature
03-24-2014, 08:36 PM #8
Dark Spirits
Climbing up the ladder
Originally posted by ResistTheSunrise View Post
With this class, you can use cex and dex. If you won't use dex there isn't a problem, just do like that:

That's the RPC on my tool:
You must login or register to view this content.
You must login or register to view this content.

You see some error? No.

Now, you need to do how i've already said, create a new class called Ps3Memory and add the code

    public static byte[] BIND = new byte[4];
public static uint ProcessID;
public static uint[] processIDs;
private static string usage;
public static PS3TMAPI.ConnectStatus connectStatus;
public static string Status;



public static void Connect()
{
PS3TMAPI.InitTargetComms();
PS3TMAPI.Connect(0, null);
}
public static void AttachProcess()
{
PS3TMAPI.GetProcessList(0, out processIDs);
ulong uProcess = processIDs[0];
ProcessID = Convert.ToUInt32(uProcess);
PS3TMAPI.ProcessAttach(0, PS3TMAPI.UnitType.PPU, ProcessID);
PS3TMAPI.ProcessContinue(0, ProcessID);
}
public static void GetStatus()
{
Status = Convert.ToString(PS3TMAPI.GetConnectStatus(0, out connectStatus, out usage));
}
public static void SetMemory(uint Address, byte[] Bytes)
{
PS3TMAPI.ProcessSetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, Address, Bytes);
}
public static void GetMemory(uint Address, byte[] Bytes)
{
PS3TMAPI.ProcessGetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, Address, ref Bytes);
}
}


alright when I get off work I'll try it and also how do I enable it with a checkbox?
03-24-2014, 08:52 PM #9
zSunriseModz
Climbing up the ladder
Don't use a checkbox, but a button. Checkbox is for when you need to enable/disable a function so, for the RPC you don't need to disable it. Just make a button and put this in:

    WritePPC();
03-24-2014, 11:52 PM #10
Dark Spirits
Climbing up the ladder
I still have the problem.

You must login or register to view this content.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo