Post: [RELEASE] Development Application PS3TMAPI_NET.dll [C#/C++/VB.Net]
02-23-2013, 12:47 AM #1
(adsbygoogle = window.adsbygoogle || []).push({});


You must login or register to view this content.

Thread Updated ! Script VB.Net is now available.
NEW UPDATE : PS3Lib v3 RELEASED !

DOWNLOAD PS3Lib v4 Here:
You must login or register to view this content.


As you've seen the title, this thread will explain to you how to link your own application C#/C++/VB.Net to your PS3.
With this , you can send to all clients in game your mods very easily, and start to develop your own application Smile

I have worked for 2 weeks on a project for NGU Elite with Enzo-f a good security for the project , but I saw that some tools got leaked for public so this project is dead. It's now the time to release this.

First i want give a thanks to :

- BuC-ShoTz for his help for InitTargetComms() & The Out ProcessID Method Smile.
- FM|T Enstone for have contributed to the thread with his C++ Part Smile.

Don't forget to give these guys in credit and also me for my work on it , for have created these functions and the full tutorial.


How to use this method ?:

- it's with the Target Manager API. Everything is in a dll , the ps3tmapi_net.dll is in the folder C:\Program Files (x86)\SN Systems\PS3\bin , you need to find it , i'll not post this dll here.

First you need to add as reference the dll ps3tmapi_net.dll in your compiler , for me Visual Studio.


// C# Part :

Connection :
    
PS3TMAPI.InitTargetComms();
PS3TMAPI.Connect(0, null);


With these codes , the dll is now initialized with your application , it is ready to set others functions.


Get and Attach Process :
    
PS3TMAPI.GetProcessList(0, out processIDs);
ulong uProcess = processIDs[0];
ProcessID = Convert.ToUInt32(uProcess);
PS3TMAPI.ProcessAttach(0, PS3TMAPI.UnitType.PPU, ProcessID);
PS3TMAPI.ProcessContinue(0, ProcessID);


With these codes , your app will find and attach automatically the ProcessID.


Set Memory :
    
PS3TMAPI.ProcessSetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, Address, bytes);


This function will write your bytes in the memory. Replace "Address" and "bytes" with your own values. Example :

    
byte[] iMCSx = new byte[] { 0x69, 0x4D, 0x43, 0x53, 0x78, 0x00 };
PS3TMAPI.ProcessSetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, 0x01BBBC2C, iMCSx);



Get Memory :
    
byte[] iMCSx = new byte[0x20];
PS3TMAPI.ProcessGetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, Address, ref iMCSx);


This function will get all bytes starting at Address , and everything will be in the iMCSx's byte. 0x20 it's the length.


// VB.Net Part :

it's the same as the C# language , you need to add the ps3tmapi_net.dll in your application. You can look and use my functions converted all work perfectly :

Connection :
    
PS3TMAPI.InitTargetComms()
PS3TMAPI.Connect(0, vbNullString)



Get & Attach the process :
    
Try
PS3TMAPI.GetProcessList(0, processIDs)
Dim uProcess As ULong = processIDs(0)
ProcessID = Convert.ToUInt32(uProcess)
PS3TMAPI.ProcessAttach(0, PS3TMAPI.UnitType.PPU, ProcessID)
PS3TMAPI.ProcessContinue(0, ProcessID)
Dim Info As String = "The Process 0x" & ProcessID.ToString("X8") & " Has Been Attached !"
MessageBox.Show(Info, "Process Ready!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
Catch Ex As Exception
MessageBox.Show(Ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.[Error])
End Try



In the header of your form , declare these line uint & ulong for use the script Attach Process :


    
Private processIDs As UInteger()
Private ProcessID As UInteger



Set Memory :
    
Dim Test As Byte() = New Byte() {&H5} // it's 0x05 in byte C#
PS3TMAPI.ProcessSetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, Address (Example &H00FCA280, iMCSx)



All offset need to be converted , example 0x3980 is now &H3980 :
    
Private Function MW3ClientState(clientNum As UInteger) As UInteger
Return (&H110A280 + (clientNum * &H3980))
End Function



Example for use my PS3Lib's Script in Visual Basic :
    
PS3.SetMemory(Address, Byte)


I'm not a developer Visual Basic but i know the base and everything work. I gave just these base for Connect / Attach / SetMem , it's now at you to develop your own tool / function.


// C++ part :

Step 1:

If you're a c/c++ developper, first you will need to load ps3tmapi.dll in your code with :

    
const WCHAR * dllName = L"ps3tmapi.dll";
HINSTANCE hlib = LoadLibrary(dllName);


ps3tmapi.dll must in the same directory as your exe or in your PATH.

Step 2:

Then you should use some typedef to simplify the functions' use:

    
typedef int (__cdecl *InitTargetCommsFunction)(void);
typedef int (__cdecl *ConnectFunction)(int,LPWSTR);
typedef int (__cdecl *ProcessListFunction)(int, UINT32*, UINT32*);
typedef int (__cdecl *ProcessAttachFunction)(int, UINT32 ,UINT32);
typedef int (__cdecl *ProcessContinueFunction) (int, UINT32);
typedef int (__cdecl *ProcessInfoFunction)(int, UINT32 ,UINT32*,SNPS3PROCESSINFO*);
typedef int (__cdecl *ProcessSetMemoryFunction)(int, UINT32 ,UINT32 ,UINT64 , UINT64, int, BYTE*);
typedef int (__cdecl *ProcessGetMemoryFunction)(int, UINT32 ,UINT32 ,UINT64 , UINT64, int, BYTE*);


You need all these functions to start any memory editing. Don't forget to create structure for SNPS3PROCESSINFO*.

Step 3:

Now it's important to locate SN's functions in the dll, we will use the famous "GetProcAddress" :
    
InitTargetCommsFunction InitTargetComms = (InitTargetCommsFunction) GetProcAddress(hlib, "SNPS3InitTargetComms");
ConnectFunction Connect = (ConnectFunction) GetProcAddress(hlib, "SNPS3Connect");
DisconnectFunction Disconnect = (DisconnectFunction) GetProcAddress(hlib, "SNPS3Disconnect");
ProcessListFunction ProcessList = (ProcessListFunction) GetProcAddress(hlib, "SNPS3ProcessList");
ProcessAttachFunction ProcessAttach = (ProcessAttachFunction) GetProcAddress(hlib, "SNPS3ProcessAttach");
ProcessContinueFunction ProcessContinue = (ProcessContinueFunction) GetProcAddress(hlib,"SNPS3ProcessContinue");
ProcessInfoFunction ProcessInfo = (ProcessInfoFunction) GetProcAddress(hlib, "SNPS3ProcessInfo");
ProcessGetMemoryFunction GetMemory = (ProcessGetMemoryFunction) GetProcAddress(hlib, "SNPS3ProcessGetMemory");
ProcessSetMemoryFunction SetMemory = (ProcessSetMemoryFunction) GetProcAddress(hlib, "SNPS3ProcessSetMemory");


Step 4:

You are now ready to use SN's functions in your program.

Start a connection with your ps3:
    
//Connection////////////////////////////
int target=0xfffffffe; //target default
InitTargetComms();
Connect(target,NULL);


Attach process to your program:
    
//Attach/////////////////////////////////
ProcessList(target,&puCount,puProcessID);
ProcProcessAttach(target, 0,*puProcessID);
ProcProcessContinue(target, *puProcessID);
ProcProcessInfo(target,*puProcessID,&puBufferSize,pProcessInfo);


Get memory and set memory on your ps3:
    
//Get/SetMemory/////////////////////////
GetMemory(target,0,*puProcessID,(pProcessInfo->ThreadIDs)[0],uAddress,nCount,pBuffer);
SetMemory(target,0,*puProcessID,(pProcessInfo->ThreadIDs)[0],uAddress,nCount,pBuffer);



Tips:
you have to call InitTargetComms() in all your threads, even if your ps3 is connected.
you can create an other GetMemory/SetMemory function to reduce the number of args.
all these functions return an int, which tells you if it succeeds or not, a success will be a positive value, a fail a negative one.


Lastest things for Developer C# & Visual Basic :

- I have coded a simple class for write easily these functions in your application.
- Download here (Copy/Paste Manually) : You must login or register to view this content.
- Add as Reference this and add it in your form like : using PS3Lib;
- Like this you can use functions quickly , exemple PS3.SetMemory(Adress, Bytes);

Source :

    
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


// Copyright © iMCSProduction 2013.
// Thanks to BuC-ShoTz to have contributed to this.
// Visit www.NextGenUpdate.com if you're English.
// Visit www.FrenchModdingTeam.com if you're French.
// Follow me www.Twitter.com/iMCSx - www.Youtube.com/iMCSx


namespace PS3Lib
{
public class PS3
{
public static uint ProcessID;
public static uint[] processIDs;
public static string snresult;
private static string usage;
public static string Info;
public static PS3TMAPI.ConnectStatus connectStatus;
public static string Status;
public static string MemStatus;


public static void ConnectDebug()
{
PS3TMAPI.InitTargetComms();
PS3TMAPI.Connect(0, null);
}


public static void GetStatus()
{
Status = Convert.ToString(PS3TMAPI.GetConnectStatus(0, out connectStatus, out usage));
}


public static void ProcessAttach()
{
PS3TMAPI.GetProcessList(0, out processIDs);
ulong uProcess = processIDs[0];
ProcessID = Convert.ToUInt32(uProcess);
PS3TMAPI.ProcessAttach(0, PS3TMAPI.UnitType.PPU, ProcessID);
PS3TMAPI.ProcessContinue(0, ProcessID);
Info = "The Process 0x" + ProcessID.ToString("X8") + " Has Been Attached !";
}
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);
}
}
}





Have fun guys ! Smile
(adsbygoogle = window.adsbygoogle || []).push({});

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

{H} | Exception, Nana, BadChoicesZ, basshead4ever, BuC-ShoTz, Bucko, cali123, CentralModz819, Cesei, deneo24, Chen Madhala, Chxii, CodJumper:, Sabotage, FAKA_ELITE, Flamby, FM|T Enstone, FM|T xDevOpS, FM|T xR3PMz, FM|T ZoRo, forcer911, Frank Ryan, Gay For Satan, Gendjisan, HaXingInc, I'm Rudi, i6oz, ibombo, iNDMx, ResistTheJamsha, jannu22, joni_djESP, KCxFTW, KoS_Riitalo, M-alShammary, Mad Scientist, Mango_Knife, Maty360414, MW2TopTenWORLD, Newelly, Norway-_-1999, Vince, primetime43, Pseudo_Soldier, RouletteBoi, ICS Vortex, SC58, Sirprizer, Skunk Modz, SnaY, SnD_Boosters, SyGnUs, T_m_b07, Terrorize 420, therifboy, TreyarchTragedy, Turk_Warrior, viralhysteria, VX_AG3NT, WeJailbreakYou, worrorfight, Fatality, xHostModer, xMonkeyBoyX, xPreeks, Xx-GIPPI-xX, zGooNzLobbies, Ziad1997, zMarcusHD

The following user groaned iMCSx for this awful post:

xTc
02-23-2013, 09:07 PM #20
Alexon
Banned
you used complicated tut .. basicaly in the first explain what is the benfit for these codes or what it will be used to do? this is for people who don't know ++c

just make it easy to be clear for all
02-23-2013, 09:15 PM #21
SnD_Boosters
Who’s Jim Erased?
Keep up the good work.
02-23-2013, 10:43 PM #22
seb5594
Proud Former Admin
love you imcsx for this shit.
waited for it <3
02-24-2013, 09:55 AM #23
aerosoul94
smooth like butter
lol. You don't need to do all that to use the dll in c++. Use the header files in sdk\include and lib file in sdk\libs. That's what they're for...
02-24-2013, 11:42 AM #24
Originally posted by aerosoul94 View Post
lol. You don't need to do all that to use the dll in c++. Use the header files in sdk\include and lib file in sdk\libs. That's what they're for...


Like i said , it's not my part.

I don't have create a form c++ for this yet.

The following user thanked iMCSx for this useful post:

Gendjisan
02-24-2013, 12:15 PM #25
Gendjisan
A.k.a. Bushigan
Nice job, keep it up bro Cool Man (aka Tustin)

The following user thanked Gendjisan for this useful post:

iMCSx
02-24-2013, 12:38 PM #26
FM|T Enstone
Bounty hunter
Originally posted by aerosoul94 View Post
lol. You don't need to do all that to use the dll in c++. Use the header files in sdk\include and lib file in sdk\libs. That's what they're for...


Using these headers from the sony sdk would be warez. I wouldn't be able to distribute the app because it would contain sony's code. With this method, my code doesn't contain any Sony code, you just need to have the .dll in your path to use my program. Therefore, you can't distribute the app (not like Sonoro did).
02-24-2013, 12:43 PM #27
Originally posted by iMCSx View Post


You must login or register to view this content.

Thread Updated ! Script VB.Net is now available.


As you've seen the title, this thread will explain to you how to link your own application C#/C++/VB.Net to your PS3.
With this , you can send to all clients in game your mods very easily, and start to develop your own application Smile

I have worked for 2 weeks on a project for NGU Elite with Enzo-f a good security for the project , but I saw that some tools got leaked for public so this project is dead. It's now the time to release this.

First i want give a thanks to :

- BuC-ShoTz for his help for InitTargetComms() & The Out ProcessID Method Smile.
- FM|T Enstone for have contributed to the thread with his C++ Part Smile.

Don't forget to give these guys in credit and also me for my work on it , for have created these functions and the full tutorial.


How to use this method ?:

- it's with the Target Manager API. Everything is in a dll , the ps3tmapi_net.dll is in the folder C:\Program Files (x86)\SN Systems\PS3\bin , you need to find it , i'll not post this dll here.

First you need to add as reference the dll ps3tmapi_net.dll in your compiler , for me Visual Studio.


// C# Part :

Connection :
    
PS3TMAPI.InitTargetComms();
PS3TMAPI.Connect(0, null);


With these codes , the dll is now initialized with your application , it is ready to set others functions.


Get and Attach Process :
    
PS3TMAPI.GetProcessList(0, out processIDs);
ulong uProcess = processIDs[0];
ProcessID = Convert.ToUInt32(uProcess);
PS3TMAPI.ProcessAttach(0, PS3TMAPI.UnitType.PPU, ProcessID);
PS3TMAPI.ProcessContinue(0, ProcessID);


With these codes , your app will find and attach automatically the ProcessID.


Set Memory :
    
PS3TMAPI.ProcessSetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, Address, bytes);


This function will write your bytes in the memory. Replace "Address" and "bytes" with your own values. Example :

    
byte[] iMCSx = new byte[] { 0x69, 0x4D, 0x43, 0x53, 0x78, 0x00 };
PS3TMAPI.ProcessSetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, 0x01BBBC2C, iMCSx);



Get Memory :
    
byte[] iMCSx = new byte[0x20];
PS3TMAPI.ProcessGetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, Address, ref iMCSx);


This function will get all bytes starting at Address , and everything will be in the iMCSx's byte. 0x20 it's the length.


// VB.Net Part :

it's the same as the C# language , you need to add the ps3tmapi_net.dll in your application. You can look and use my functions converted all work perfectly :

Connection :
    
PS3TMAPI.InitTargetComms()
PS3TMAPI.Connect(0, vbNullString)



Get & Attach the process :
    
Try
PS3TMAPI.GetProcessList(0, processIDs)
Dim uProcess As ULong = processIDs(0)
ProcessID = Convert.ToUInt32(uProcess)
PS3TMAPI.ProcessAttach(0, PS3TMAPI.UnitType.PPU, ProcessID)
PS3TMAPI.ProcessContinue(0, ProcessID)
Dim Info As String = "The Process 0x" & ProcessID.ToString("X8") & " Has Been Attached !"
MessageBox.Show(Info, "Process Ready!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
Catch Ex As Exception
MessageBox.Show(Ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.[Error])
End Try



In the header of your form , declare these line uint & ulong for use the script Attach Process :


    
Private processIDs As UInteger()
Private ProcessID As UInteger



Set Memory :
    
Dim Test As Byte() = New Byte() {&H5} // it's 0x05 in byte C#
PS3TMAPI.ProcessSetMemory(0, PS3TMAPI.UnitType.PPU, ProcessID, 0, Address (Example &H00FCA280, iMCSx)



All offset need to be converted , example 0x3980 is now &H3980 :
    
Private Function MW3ClientState(clientNum As UInteger) As UInteger
Return (&H110A280 + (clientNum * &H3980))
End Function



Example for use my PS3Lib's Script in Visual Basic :
    
PS3.SetMemory(Address, Byte)


I'm not a developer Visual Basic but i know the base and everything work. I gave just these base for Connect / Attach / SetMem , it's now at you to develop your own tool / function.


// C++ part :

Step 1:

If you're a c/c++ developper, first you will need to load ps3tmapi.dll in your code with :

    
const WCHAR * dllName = L"ps3tmapi.dll";
HINSTANCE hlib = LoadLibrary(dllName);


ps3tmapi.dll must in the same directory as your exe or in your PATH.

Step 2:

Then you should use some typedef to simplify the functions' use:

    
typedef int (__cdecl *InitTargetCommsFunction)(void);
typedef int (__cdecl *ConnectFunction)(int,LPWSTR);
typedef int (__cdecl *ProcessListFunction)(int, UINT32*, UINT32*);
typedef int (__cdecl *ProcessAttachFunction)(int, UINT32 ,UINT32);
typedef int (__cdecl *ProcessContinueFunction) (int, UINT32);
typedef int (__cdecl *ProcessInfoFunction)(int, UINT32 ,UINT32*,SNPS3PROCESSINFO*);
typedef int (__cdecl *ProcessSetMemoryFunction)(int, UINT32 ,UINT32 ,UINT64 , UINT64, int, BYTE*);
typedef int (__cdecl *ProcessGetMemoryFunction)(int, UINT32 ,UINT32 ,UINT64 , UINT64, int, BYTE*);


You need all these functions to start any memory editing. Don't forget to create structure for SNPS3PROCESSINFO*.

Step 3:

Now it's important to locate SN's functions in the dll, we will use the famous "GetProcAddress" :
    
InitTargetCommsFunction InitTargetComms = (InitTargetCommsFunction) GetProcAddress(hlib, "SNPS3InitTargetComms");
ConnectFunction Connect = (ConnectFunction) GetProcAddress(hlib, "SNPS3Connect");
DisconnectFunction Disconnect = (DisconnectFunction) GetProcAddress(hlib, "SNPS3Disconnect");
ProcessListFunction ProcessList = (ProcessListFunction) GetProcAddress(hlib, "SNPS3ProcessList");
ProcessAttachFunction ProcessAttach = (ProcessAttachFunction) GetProcAddress(hlib, "SNPS3ProcessAttach");
ProcessContinueFunction ProcessContinue = (ProcessContinueFunction) GetProcAddress(hlib,"SNPS3ProcessContinue");
ProcessInfoFunction ProcessInfo = (ProcessInfoFunction) GetProcAddress(hlib, "SNPS3ProcessInfo");
ProcessGetMemoryFunction GetMemory = (ProcessGetMemoryFunction) GetProcAddress(hlib, "SNPS3ProcessGetMemory");
ProcessSetMemoryFunction SetMemory = (ProcessSetMemoryFunction) GetProcAddress(hlib, "SNPS3ProcessSetMemory");


Step 4:

You are now ready to use SN's functions in your program.

Start a connection with your ps3:
    
//Connection////////////////////////////
int target=0xfffffffe; //target default
InitTargetComms();
Connect(target,NULL);


Attach process to your program:
    
//Attach/////////////////////////////////
ProcessList(target,&puCount,puProcessID);
ProcProcessAttach(target, 0,*puProcessID);
ProcProcessContinue(target, *puProcessID);
ProcProcessInfo(target,*puProcessID,&puBufferSize,pProcessInfo);


Get memory and set memory on your ps3:
    
//Get/SetMemory/////////////////////////
GetMemory(target,0,*puProcessID,(pProcessInfo->ThreadIDs)[0],uAddress,nCount,pBuffer);
SetMemory(target,0,*puProcessID,(pProcessInfo->ThreadIDs)[0],uAddress,nCount,pBuffer);



Tips:
you have to call InitTargetComms() in all your threads, even if your ps3 is connected.
you can create an other GetMemory/SetMemory function to reduce the number of args.
all these functions return an int, which tells you if it succeeds or not, a success will be a positive value, a fail a negative one.


Lastest things for Developer C# & Visual Basic :

- I have coded a simple class for write easily these functions in your application.
- Download my Class Here => You must login or register to view this content.
- Add as Reference this and add it in your form like : using PS3Lib;
- Like this you can use functions quickly , exemple PS3.SetMemory(Adress, Bytes);

Source :

    
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


// Copyright © iMCSProduction 2013.
// Thanks to BuC-ShoTz to have contributed to this.
// Visit www.NextGenUpdate.com if you're English.
// Visit www.FrenchModdingTeam.com if you're French.
// Follow me www.Twitter.com/iMCSx - www.Youtube.com/iMCSx


namespace PS3Lib
{
public class PS3
{
public static uint ProcessID;
public static uint[] processIDs;
public static string snresult;
private static string usage;
public static string Info;
public static PS3TMAPI.ConnectStatus connectStatus;
public static string Status;
public static string MemStatus;


public static void ConnectDebug()
{
PS3TMAPI.InitTargetComms();
PS3TMAPI.Connect(0, null);
}


public static void GetStatus()
{
Status = Convert.ToString(PS3TMAPI.GetConnectStatus(0, out connectStatus, out usage));
}


public static void ProcessAttach()
{
PS3TMAPI.GetProcessList(0, out processIDs);
ulong uProcess = processIDs[0];
ProcessID = Convert.ToUInt32(uProcess);
PS3TMAPI.ProcessAttach(0, PS3TMAPI.UnitType.PPU, ProcessID);
PS3TMAPI.ProcessContinue(0, ProcessID);
Info = "The Process 0x" + ProcessID.ToString("X8") + " Has Been Attached !";
}
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);
}
}
}





Have fun guys ! Smile


This made my Day thx iMCSx
02-24-2013, 01:11 PM #28
So do you need to have a cfw to use this?

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo