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
06-13-2013, 12:40 AM #74
thanks for this...
06-18-2013, 01:27 PM #75
MrDvb
Haxor!
Awesome Thanks for release.
06-18-2013, 04:02 PM #76
Renton
Hurah!
With the help of a few friends of mine. and the OP of this thread for showing people how to connect and change memory.
We (me and 2 friends) have made a Tool. for a game. Before anyone asks. no its not cod. and no its not BF3. We may release a modified tool that has just the search and Codes feature but not sure.

This Tool Allows Us to search for code out side of the shitty Debugger. it also supports Constant Writing. (some addresses auto update making some hacks with out a program impossible) What this does. is constantly write (duh) the value to the address you tell it to. Graphics are Not a biggy =p
Gif Here

You must login or register to view this content.
06-18-2013, 08:22 PM #77
Jannik007
Do a barrel roll!
Can u tell me how to load a .bin in the Memory? In C#?
06-24-2013, 02:15 AM #78
Thread updated. (PS3Lib v3)
07-08-2013, 02:00 PM #79
Originally posted by Renton View Post
With the help of a few friends of mine. and the OP of this thread for showing people how to connect and change memory.
We (me and 2 friends) have made a Tool. for a game. Before anyone asks. no its not cod. and no its not BF3. We may release a modified tool that has just the search and Codes feature but not sure.

This Tool Allows Us to search for code out side of the shitty Debugger. it also supports Constant Writing. (some addresses auto update making some hacks with out a program impossible) What this does. is constantly write (duh) the value to the address you tell it to. Graphics are Not a biggy =p
Gif Here

You must login or register to view this content.


GIVE ME THAT TOOL!! Choco
07-09-2013, 03:44 AM #80
Renton
Hurah!
Originally posted by therifboy View Post
GIVE ME THAT TOOL!! Choco


once we have everything we need set up ill make a REL Thread. right now the tool seems to have a small mem leak. also it needs more code types Winky Winky
07-09-2013, 04:14 AM #81
lilherm_
I am error
Great work Claps
07-09-2013, 10:53 AM #82
Originally posted by Renton View Post
once we have everything we need set up ill make a REL Thread. right now the tool seems to have a small mem leak. also it needs more code types Winky Winky


I've been looking for a way to scan the memory multiple times but never found any. That way, some offsets will be much easier to found. But most of the offsets will still be hard to find without IDA.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo