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, 01:31 AM #11
Tustin
Balls of Steel
Originally posted by StubnOne View Post
i think this is great the way its released Gasp, expect many more "Dex Modding Tools" for Games :P, nice work iMCSx

I know, i didn't mean it in a bad way :p. Just sucks they had to just come out and release just because of that one tool.
02-23-2013, 01:40 AM #12
BadChoicesZ
I defeated!
Originally posted by Tustin View Post
I know, i didn't mean it in a bad way :p. Just sucks they had to just come out and release just because of that one tool.


yea i understand, im guessing he's refering to sonoross tool ?, because myne wouldnt force anything to be released, myne pretty much sent keystrokes to proDG debugger... doesnt connect to ps3 or attach processes, this is way more advanced and ill be glad to learn it :Sad AwesomeP
02-23-2013, 02:37 AM #13
VX_AG3NT
Pokemon Trainer
Wow, great work. Very impressive. I don't really know how to code, but stuff like this really makes me want to learn! Going to look over this again, and again, and hopefully I can absorb some of it over time. It's good to see solid releases like this.. getting tired of all the 'I haz been banned' threads..
02-23-2013, 10:56 AM #14
iMCSx does it again. Nice work Chamoo. You're thread is starting a new modding revolution. Keep up the good work.
02-23-2013, 04:00 PM #15
Thanks for your feedback.

The Thread has been updated !

VB.Net Script Added Winky Winky

Have fun Smile

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

Pseudo_Soldier,
02-23-2013, 04:40 PM #16
From reading the OP I gather that,
These are classes that will allow easy creation of 'desktop applications' that can read/edit live memory on a debug ps3?
02-23-2013, 05:35 PM #17
Tustin
Balls of Steel
Originally posted by iMCSx View Post
Thanks for your feedback.

The Thread has been updated !

VB.Net Script Added Winky Winky

Have fun Smile

Nice. Congrats on the gold star Smile
02-23-2013, 05:43 PM #18
Faim
NGU's Finest
Amazing release but i dont know the basics of c++ yet but this is going to help wen i do learn
02-23-2013, 05:44 PM #19
Originally posted by Tustin View Post
Nice. Congrats on the gold star Smile

Lol , Thanks

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo