Post: [RELEASE] PS3Lib v3.1
06-19-2013, 09:42 PM #1
(adsbygoogle = window.adsbygoogle || []).push({});
PS3 Library .NET



This will allow you to communicate with your PS3 Developers easily.
Connection with targets , read/write memory and more...

V4 Released : You must login or register to view this content.

This project is on CodePlex , you can download the project compiled (.DLL) or see the source You must login or register to view this content.


New Features :

*Automatic ps3tmapi_net.dll (You don't need to add as reference this dll , PS3Lib do it!)
*Connect a Target By Name
*Get a Target Name
*Reset To XMB
*PS3IO Extension (XboxDevelopmentExtender Converted)
*Extension Memory (CraigChrist XDevkit Extension Converted)


UPDATE v3.1 CHANGESET:


Some guys get a message "ps3tmapi_net.dll not found" when you try to connect to target, you must just add this in your Program.cs / Form_Load / Or just before ConnectDebug :

    PS3Lib.GetPs3Api.PS3TMAPI_NET();



What change in the v3.1 ?:

*Added a simple project with C# source with note for help all beginners (picture in below)
*Fixed GetStatus Method
*Fixed Extensions Writer
*Fixed Some Errors...


You must login or register to view this content.


SOURCE IN THE PACKAGE, DOWNLOAD IN BELOW.


How to use :

First , as i've said for the update v3.1 , don't forget to add this somewhere in your app :

    PS3Lib.GetPs3Api.PS3TMAPI_NET();


Add the dll as reference , and add it to your project :

    [B]using[/B] PS3Lib;

You must create an instance , example just after the partial class , then like this :

    [B]PS3API[/B] DEX = [B]new PS3API();[/B]
[B]PS3IO[/B] PS3IO = [B]new PS3IO();[/B]


You can change these words "DEX" and "PS3IO" (Not in bold) by what you want.
You don't need to create an instance for IO , if you don't want use it , don't create an instance it's not important.

You can now call a method , example in the event Form_Load :

    DEX.ConnectDebug("iMCSxDev");


Like you can see , we can now connect a target by his name , so you can add much target in Target Manager is not a problem.

But , you can always use the old way (Connect By Default) , because i use 2 methods with the same name , but not the same parameters example :

    DEX.ConnectDebug(); // This Connect the Target by default (0)

OR

DEX.ConnectDebug(5); This Connect the target 5.


I done this only if someone get problems , but it should work perfectly. I have added some others useful commands , first the command PS3TMAPI_NET(); This is included in the function connected , when you will connect your target with the PS3Lib (in your app) the dll will load automatically the ps3tmapi_net , then you DON'T need to add the ps3tmapi_net.dll into your project now... But if you want use a special command from the ps3tmapi_net.dll , you must just add it as reference but without include it in the same folder of your app if you release your app. How work this method ? :

    
internal static Assembly LoadApi;
public static Assembly PS3TMAPI_NET()
{
AppDomain.CurrentDomain.AssemblyResolve += (s, e) =>
{
var filename = new AssemblyName(e.Name).Name;
var x = string.Format(@"C:\Program Files\SN Systems\PS3\bin\ps3tmapi_net.dll", filename);
var x64 = string.Format(@"C:\Program Files (x64)\SN Systems\PS3\bin\ps3tmapi_net.dll", filename);
var x86 = string.Format(@"C:\Program Files (x86)\SN Systems\PS3\bin\ps3tmapi_net.dll", filename);
if (System.IO.File.Exists(x))
LoadApi = Assembly.LoadFile(x);
else
{
if (System.IO.File.Exists(x64))
LoadApi = Assembly.LoadFile(x64);


else
{
if (System.IO.File.Exists(x86))
LoadApi = Assembly.LoadFile(x86);
else
{
MessageBox.Show("Target Manager API cannot be founded to:

" + x86, "Error with PS3 API!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
return LoadApi;
};
return LoadApi;
}


As you can see , this method Load the dll but return too the assembly , then you can make the same things in your project with this return... I have just enter all popular path for this API my PS3 Attach Games run with this and it work for everyone...


PS3 Extensions & SCE Properties :

I have add some methods , but they are only available by their properties , easy to use but i'll write 2 example :

    
// Extension Propertie
float Jump = DEX.Extension.ReadFloat(0x0019780); // MW3 Offset , "Jump" has now the value 78. (If default)
string HostName = DEX.Extension.ReadString(0x01BBBC2C); // This will read your PSN for MW3...

// Extension SCE
uint CurrentProcess = DEX.SCE.ProcessID(); // Get the latest process attached...


I have just converted the XDevKit++ from CraigChrist into PS3. I have removed his Extension methods it was not needed for the dll , i have also added and edited some function , example the string is read in memory to the next null byte.


PS3IO (EndianIO) :

We can now use EndianIO for ps3... This allow to be free with the language. It's a bit like the extension , but different this read and write quickly your bytes and much methods are available , some example how to use :

    
using PS3Lib.IO;

// You must create an instance too , already said before...

// Put this into a function , this will set the noclip for MW3.
EndianIO IO = new EndianIO(PS3IO.StreamPS3(DEX), PS3Lib.IO.EndianType.BigEndian);
IO.Open();
IO.In.BaseStream.Position = 0x0110A280 + 0x35fc;
IO.Out.Write(0x00000001);

// Other Example , write noclip + redboxes
EndianIO IO = new EndianIO(PS3IO.StreamPS3(DEX), PS3Lib.IO.EndianType.BigEndian);
IO.Open();
IO.In.BaseStream.Position = 0x0110a280 + 0x35fc;
IO.Out.Write(0x00000001);
IO.In.BaseStream.Position = 0x0110a280 + 0x13;
IO.Out.Write((byte)0x10);



You can choose the Endian Type , and read/write memory , use just IO.Out. or IO.In. .

There are not only these methods , i have just write some examples , you will see every methods available if you explore it from your project.

I'm done with this thread , i know its a bit long for only a dll , but i would explain this perfectly , like this everyone understand how to work this.

I hope this will help you to develop some applications...

Thanks to Buc-ShoTz for the first PS3Lib released , CraigChrist for his XDevKit base , and the creator of the XboxDevExtander.


You must login or register to view this content.



Have fun Winky Winky
Last edited by iMCSx ; 11-25-2013 at 04:48 AM.

The following 34 users say thank you to iMCSx for this useful post:

βounceModz, BrinkerzHD, Chxii, Daddy, FM|T Enstone, FM|T xDevOpS, Gabberhard, Gendjisan, gianluca33, Hacker41822, Harry, i_iTop_i, InfinityISB4CK, Insult, JemEO, Jenxz, KrElZo, Mango_Knife, matt0897, Nicktasticz, MW2TopTenWORLD, O-H, Pseudo_Soldier, RTE Modz, SALEM-x, SC58, Slice, Fatality, xRevolutions, Xx-GIPPI-xX
06-29-2013, 08:25 AM #20
em20
Keeper
Originally posted by FM
PS3 Library .NET



This will allow you to communicate with your PS3 Developers easily.
Connection with targets , read/write memory and more...

This project is on CodePlex , you can download the project compiled (.DLL) or see the source You must login or register to view this content.


New Features :

*Automatic ps3tmapi_net.dll (You don't need to add as reference this dll , PS3Lib do it!)
*Connect a Target By Name
*Get a Target Name
*Reset To XMB
*PS3IO Extension (XboxDevelopmentExtender Converted)
*Extension Memory (CraigChrist XDevkit Extension Converted)


UPDATE v3.1 CHANGESET:


Some guys get a message "ps3tmapi_net.dll not found" when you try to connect to target, you must just add this in your Program.cs / Form_Load / Or just before ConnectDebug :

    PS3Lib.GetPs3Api.PS3TMAPI_NET();



What change in the v3.1 ?:

*Added a simple project with C# source with note for help all beginners (picture in below)
*Fixed GetStatus Method
*Fixed Extensions Writer
*Fixed Some Errors...


You must login or register to view this content.


SOURCE IN THE PACKAGE, DOWNLOAD IN BELOW.


How to use :

First , as i've said for the update v3.1 , don't forget to add this somewhere in your app :

    PS3Lib.GetPs3Api.PS3TMAPI_NET();


Add the dll as reference , and add it to your project :

    [B]using[/B] PS3Lib;

You must create an instance , example just after the partial class , then like this :

    [B]PS3API[/B] DEX = [B]new PS3API();[/B]
[B]PS3IO[/B] PS3IO = [B]new PS3IO();[/B]


You can change these words "DEX" and "PS3IO" (Not in bold) by what you want.
You don't need to create an instance for IO , if you don't want use it , don't create an instance it's not important.

You can now call a method , example in the event Form_Load :

    DEX.ConnectDebug("iMCSxDev");


Like you can see , we can now connect a target by his name , so you can add much target in Target Manager is not a problem.

But , you can always use the old way (Connect By Default) , because i use 2 methods with the same name , but not the same parameters example :

    DEX.ConnectDebug(); // This Connect the Target by default (0)

OR

DEX.ConnectDebug(5); This Connect the target 5.


I done this only if someone get problems , but it should work perfectly. I have added some others useful commands , first the command PS3TMAPI_NET(); This is included in the function connected , when you will connect your target with the PS3Lib (in your app) the dll will load automatically the ps3tmapi_net , then you DON'T need to add the ps3tmapi_net.dll into your project now... But if you want use a special command from the ps3tmapi_net.dll , you must just add it as reference but without include it in the same folder of your app if you release your app. How work this method ? :

    
internal static Assembly LoadApi;
public static Assembly PS3TMAPI_NET()
{
AppDomain.CurrentDomain.AssemblyResolve += (s, e) =>
{
var filename = new AssemblyName(e.Name).Name;
var x = string.Format(@"C:\Program Files\SN Systems\PS3\bin\ps3tmapi_net.dll", filename);
var x64 = string.Format(@"C:\Program Files (x64)\SN Systems\PS3\bin\ps3tmapi_net.dll", filename);
var x86 = string.Format(@"C:\Program Files (x86)\SN Systems\PS3\bin\ps3tmapi_net.dll", filename);
if (System.IO.File.Exists(x))
LoadApi = Assembly.LoadFile(x);
else
{
if (System.IO.File.Exists(x64))
LoadApi = Assembly.LoadFile(x64);


else
{
if (System.IO.File.Exists(x86))
LoadApi = Assembly.LoadFile(x86);
else
{
MessageBox.Show("Target Manager API cannot be founded to:

" + x86, "Error with PS3 API!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
return LoadApi;
};
return LoadApi;
}


As you can see , this method Load the dll but return too the assembly , then you can make the same things in your project with this return... I have just enter all popular path for this API my PS3 Attach Games run with this and it work for everyone...


PS3 Extensions & SCE Properties :

I have add some methods , but they are only available by their properties , easy to use but i'll write 2 example :

    
// Extension Propertie
float Jump = DEX.Extension.ReadFloat(0x0019780); // MW3 Offset , "Jump" has now the value 78. (If default)
string HostName = DEX.Extension.ReadString(0x01BBBC2C); // This will read your PSN for MW3...

// Extension SCE
uint CurrentProcess = DEX.SCE.ProcessID(); // Get the latest process attached...


I have just converted the XDevKit++ from CraigChrist into PS3. I have removed his Extension methods it was not needed for the dll , i have also added and edited some function , example the string is read in memory to the next null byte.


PS3IO (EndianIO) :

We can now use EndianIO for ps3... This allow to be free with the language. It's a bit like the extension , but different this read and write quickly your bytes and much methods are available , some example how to use :

    
using PS3Lib.IO;

// You must create an instance too , already said before...

// Put this into a function , this will set the noclip for MW3.
EndianIO IO = new EndianIO(PS3IO.StreamPS3(DEX), PS3Lib.IO.EndianType.BigEndian);
IO.Open();
IO.In.BaseStream.Position = 0x0110A280 + 0x35fc;
IO.Out.Write(0x00000001);

// Other Example , write noclip + redboxes
EndianIO IO = new EndianIO(PS3IO.StreamPS3(DEX), PS3Lib.IO.EndianType.BigEndian);
IO.Open();
IO.In.BaseStream.Position = 0x0110a280 + 0x35fc;
IO.Out.Write(0x00000001);
IO.In.BaseStream.Position = 0x0110a280 + 0x13;
IO.Out.Write((byte)0x10);



You can choose the Endian Type , and read/write memory , use just IO.Out. or IO.In. .

There are not only these methods , i have just write some examples , you will see every methods available if you explore it from your project.

I'm done with this thread , i know its a bit long for only a dll , but i would explain this perfectly , like this everyone understand how to work this.

I hope this will help you to develop some applications...

Thanks to Buc-ShoTz for the first PS3Lib released , CraigChrist for his XDevKit base , and the creator of the XboxDevExtander.


You must login or register to view this content.



Have fun Winky Winky


How do you fetch the client numbers? client 0, client 1, etc.
06-29-2013, 08:36 AM #21
Originally posted by x View Post
thanks bro but how can i turn on / off the ps3 ?
and also reset to XMB
i treied this one here but it didnt work !
Turn ON: PS3TMAPI.PowerON();
Turn OFF: PS3TMAPI.PowerOFF();
Reset to XMB: PS3TMAPI.Reset(PS3TMAPI.ResetParameters.ResetEx);


As sonoro said, although power on is declared, you cant use it seeing target manager is not connected.
But power off should just be
    
int target;
bool bForce;
private void button1_Click(object sender, EventArgs e)
{
PS3TMAPI.PowerOff(target, bForce);
}

And reset to xmb should be
    
PS3TMAPI.ResetParameter resetParameter;
private void button2_Click(object sender, EventArgs e)
{
PS3TMAPI.Reset(target, resetParameter);
}

Or using iMCSx's PS3Lib it's
    
PS3TMAPI.ResetParameter resetParameter;
private void button2_Click(object sender, EventArgs e)
{
DEX.ResetToXMB(resetParameter);
}
Last edited by JemEO ; 06-29-2013 at 08:45 AM.

The following user thanked JemEO for this useful post:

SALEM-x
06-29-2013, 11:03 AM #22
I'll update something coming soon on this library Smile
07-12-2013, 08:32 PM #23
so what about
DEX.extension.readbytes

How Can i use it ?
07-15-2013, 01:16 AM #24
Originally posted by 9191 View Post
so what about
DEX.extension.readbytes

How Can i use it ?


Just do :

    
[COLOR=#333333]byte[] buffer = DEX.Extension.ReadBytes(YourOffsetHERE, length);


Enjoy Winky Winky[/COLOR]
07-19-2013, 08:08 PM #25
i_iTop_i
NextGenUpdate Elite
What about checkBox Please
08-11-2013, 07:52 AM #26
I'm so lost..

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo