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
Last edited by iMCSx ; 12-21-2013 at 03:14 AM. Reason: PS3Lib v3

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
04-06-2013, 10:31 AM #56
Originally posted by FM
Did you have tested to look when you click on your button "connect" target manager connect to your ps3 ?
Check if you have declared these types in the header of your form.


It was okay, I managed to figure out what was wrong and it's fixed now, so thanks again. And the is the code to reset the ps3 back to the xmb?
04-13-2013, 06:47 AM #57
.......
04-22-2013, 06:02 PM #58
Hey i'm kinda new to this, can anyone help? i have the PS3Lib as a reference and i try and use PS3Lib.PS3.SetMemory(Address, Bytes); and i always get an error :/ i replace them with the offset and value like 0x000173B60 for address and 600 for bytes (Super speed for mw3). So i get PS3Lib.PS3.SetMemory(0x000173B60, 400); but it just doesn't work. Can anyone help?
04-23-2013, 10:20 PM #59
lubu
I am error
..................................
Last edited by lubu ; 05-17-2013 at 03:37 PM.
04-24-2013, 03:52 AM #60
Nice thread iMCSx <3
04-25-2013, 05:41 AM #61
How do i create a structure for SNPS3PROCESSINFO*? i'm new to C++ :P
04-27-2013, 07:49 AM #62
Kurt
Banned
wtf when i do the code for C# for the attach process and when i type in the code it gives me all kinds of errors. WTF ITS PISSING ME OFF. please help me
05-18-2013, 01:50 AM #63
MODZ4FUN420
NextGenUpdate Elite
I am stuck at this part

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

Can you make a YouTube tutorial?
Or help me figure this out?
05-24-2013, 12:28 PM #64
jannu22
Bounty hunter
What SNSNPS3PROCESSINFO structure should contain?

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo