Post: [TuT] how to use ps3tmapi.dll in C++ [win32/CLR]
01-14-2014, 12:53 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); hello ngu, ive noticed alot of people wanting to make ps3 RTE/RTM tools in c++.
so it took a lil to figer out imcsx's C++ connect/attach code( You must login or register to view this content. ) but i did and hese are the steps on how to[IMCSX's method]:

1: add my You must login or register to view this content. to the "header files"

2:make sure you have added imcsx's load lib function
    const WCHAR * dllName = L"ps3tmapi.dll";
HINSTANCE hlib = LoadLibrary(dllName);

also make sure you have
    #include <Windows.h>
in your main source file also add the ps3tmapi.dll into your debug folder

3:add this to the top of your main source file:
    #include "ps3mem.h"


4: add this void to your main source file
    void conect_n_attach()
{
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*);
InitTargetCommsFunction InitTargetComms = (InitTargetCommsFunction) GetProcAddress(hlib, "SNPS3InitTargetComms");
ConnectFunction Connect = (ConnectFunction) GetProcAddress(hlib, "SNPS3Connect");
ProcessListFunction ProcessList = (ProcessListFunction) GetProcAddress(hlib, "SNPS3ProcessList");
ProcessInfoFunction ProcessInfo = (ProcessInfoFunction) GetProcAddress(hlib, "SNPS3ProcessInfo");
ProcessAttachFunction ProcessAttach = (ProcessAttachFunction) GetProcAddress(hlib, "SNPS3ProcessAttach");
ProcessContinueFunction ProcessContinue = (ProcessContinueFunction) GetProcAddress(hlib,"SNPS3ProcessContinue");
InitTargetComms();
Connect(target,NULL);
ProcessList(target,&puCount,puProcessID);
ProcessAttach(target, 0,*puProcessID);
ProcessContinue(target, *puProcessID);
ProcessInfo(target,*puProcessID,&puBufferSize,pProcessInfo);
}


that should connect/attatch
step 5: next add
    void connect_n_attach();
to your main header (stdafx.h)
step 6: calling the function
     connect_n_attach(); 

and for CLR users you can download the .DLL i made You must login or register to view this content. or:
CLR Steps:
step 1: download my CLR ps3 header You must login or register to view this content. and put it in your "header files"
also have the ps3tmapi_net.dll in the source folder and debug folder

step 2: add this code to your main source file:
    #include "PS3mem_net.h"

step 3: call any of the functions that are in the class "PS3" in your main source
new method for win32 (thanks to aerosoul94 Smile )
step 1:
download the header i made You must login or register to view this content. and add it to your "header files"
step 2:
add this code to your main source file
    #include "SNPS3.h"


now you can calll the connect function:
    PS3::Connect(0);
Last edited by milky4444 ; 01-15-2014 at 10:52 PM.

The following 12 users say thank you to milky4444 for this useful post:

BaSs_HaXoR, Dan Dactyl, Gabberhard, ItsLollo1000, joni_djESP, Mxtivated, NickBeHaxing, John, Winter, Xx_GANG_xX
01-16-2014, 07:42 PM #11
aerosoul94
smooth like butter
Originally posted by ItsLollo1000 View Post
aerosoul for me this dosnt work in Qt. Any help?

You must login or register to view this content.

Seem's like they use Makefiles. Idk though, I've never used Qt.
    LIBS += $$quote(-LC:\Program Files (x86)\SN Systems\PS3\sdk\lib\) -lPS3TMAPI.lib
in your .pro file?
Originally posted by milky4444 View Post
the new method? dnt work?

It's a different IDE so you add library dependencies differently. Either way, there must be a way to add .lib's in Qt.

The following user thanked aerosoul94 for this useful post:

milky4444
01-18-2014, 09:31 PM #12
Originally posted by aerosoul94 View Post
You must login or register to view this content.

Seem's like they use Makefiles. Idk though, I've never used Qt.
    LIBS += $$quote(-LC:\Program Files (x86)\SN Systems\PS3\sdk\lib\) -lPS3TMAPI.lib
in your .pro file?

It's a different IDE so you add library dependencies differently. Either way, there must be a way to add .lib's in Qt.


thanks for your help i really appreciate it Smile
01-20-2014, 03:55 AM #13
Originally posted by milky4444 View Post
hello ngu, ive noticed alot of people wanting to make ps3 RTE/RTM tools in c++.
so it took a lil to figer out imcsx's C++ connect/attach code( You must login or register to view this content. ) but i did and hese are the steps on how to[IMCSX's method]:

1: add my You must login or register to view this content. to the "header files"

2:make sure you have added imcsx's load lib function
    const WCHAR * dllName = L"ps3tmapi.dll";
HINSTANCE hlib = LoadLibrary(dllName);

also make sure you have
    #include <Windows.h>
in your main source file also add the ps3tmapi.dll into your debug folder

3:add this to the top of your main source file:
    #include "ps3mem.h"


4: add this void to your main source file
    void conect_n_attach()
{
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*);
InitTargetCommsFunction InitTargetComms = (InitTargetCommsFunction) GetProcAddress(hlib, "SNPS3InitTargetComms");
ConnectFunction Connect = (ConnectFunction) GetProcAddress(hlib, "SNPS3Connect");
ProcessListFunction ProcessList = (ProcessListFunction) GetProcAddress(hlib, "SNPS3ProcessList");
ProcessInfoFunction ProcessInfo = (ProcessInfoFunction) GetProcAddress(hlib, "SNPS3ProcessInfo");
ProcessAttachFunction ProcessAttach = (ProcessAttachFunction) GetProcAddress(hlib, "SNPS3ProcessAttach");
ProcessContinueFunction ProcessContinue = (ProcessContinueFunction) GetProcAddress(hlib,"SNPS3ProcessContinue");
InitTargetComms();
Connect(target,NULL);
ProcessList(target,&puCount,puProcessID);
ProcessAttach(target, 0,*puProcessID);
ProcessContinue(target, *puProcessID);
ProcessInfo(target,*puProcessID,&puBufferSize,pProcessInfo);
}


that should connect/attatch
step 5: next add
    void connect_n_attach();
to your main header (stdafx.h)
step 6: calling the function
     connect_n_attach(); 

and for CLR users you can download the .DLL i made You must login or register to view this content. or:
CLR Steps:
step 1: download my CLR ps3 header You must login or register to view this content. and put it in your "header files"
also have the ps3tmapi_net.dll in the source folder and debug folder

step 2: add this code to your main source file:
    #include "PS3mem_net.h"

step 3: call any of the functions that are in the class "PS3" in your main source
new method for win32 (thanks to aerosoul94 Smile )
step 1:
download the header i made You must login or register to view this content. and add it to your "header files"
step 2:
add this code to your main source file
    #include "SNPS3.h"


now you can calll the connect function:
    PS3::Connect(0);

You're on the right track with Aerosouls method but you haven't added anything with attaching or getting or setting memory...

Use these as you were previously...
    
#include "C:/Program Files (x86)/SN Systems/PS3/sdk/include/ps3tmapi.h"
#pragma comment( lib, "C:/Program Files (x86)/SN Systems/PS3/sdk/lib/PS3TMAPI.lib" )
#pragma comment( lib, "C:/Program Files (x86)/SN Systems/PS3/sdk/lib/PS3TMAPIx64.lib" )


Then use this for Connecting and Attaching
    
//If you look in debugger sometimes the 0x1040200 changes, this is the processID so you'll might have to change it
void ConnectPS3()
{
SNPS3InitTargetComms();
SNPS3Connect(0xfffffffe, NULL);//0xfffffffe is the default
SNPS3ProcessAttach(0xfffffffe, 0, 0x1040200);
SNPS3ProcessContinue(0xfffffffe, 0x1040200);
}


Here is a setmemory test function
    
void SetMemoryTest()
{
SNPS3InitTargetComms();//You have to keep using SNPS3InitTargetComms every thread.. good think about this is you dont have to keep reconnecting
BYTE b[4] = { 1, 0, 0, 0 };
SNPS3ProcessSetMemory(0xfffffffe, 0, 0x1040200, 0, OFFSET, 4, (const BYTE *)b);//The 4 is the number of bytes being written and OFFSET is the UInt32 that is being written to
}


And getmemory
    
void GetMemory()
{
SNPS3InitTargetComms();
BYTE b[4];
SNPS3ProcessGetMemory(0xfffffffe, 0, 0x1040200, 0, OFFSET, 4, b);//Again offset is the offset getting the memory from, 4 is the number of bytes getting, and b is the array off bytes to get
}


I don't know if this will help.. but oh well

The following user thanked Black Panther for this useful post:

milky4444
01-20-2014, 06:09 AM #14
Originally posted by Corey View Post
You're on the right track with Aerosouls method but you haven't added anything with attaching or getting or setting memory...

Use these as you were previously...
    
#include "C:/Program Files (x86)/SN Systems/PS3/sdk/include/ps3tmapi.h"
#pragma comment( lib, "C:/Program Files (x86)/SN Systems/PS3/sdk/lib/PS3TMAPI.lib" )
#pragma comment( lib, "C:/Program Files (x86)/SN Systems/PS3/sdk/lib/PS3TMAPIx64.lib" )


Then use this for Connecting and Attaching
    
//If you look in debugger sometimes the 0x1040200 changes, this is the processID so you'll might have to change it
void ConnectPS3()
{
SNPS3InitTargetComms();
SNPS3Connect(0xfffffffe, NULL);//0xfffffffe is the default
SNPS3ProcessAttach(0xfffffffe, 0, 0x1040200);
SNPS3ProcessContinue(0xfffffffe, 0x1040200);
}


Here is a setmemory test function
    
void SetMemoryTest()
{
SNPS3InitTargetComms();//You have to keep using SNPS3InitTargetComms every thread.. good think about this is you dont have to keep reconnecting
BYTE b[4] = { 1, 0, 0, 0 };
SNPS3ProcessSetMemory(0xfffffffe, 0, 0x1040200, 0, OFFSET, 4, (const BYTE *)b);//The 4 is the number of bytes being written and OFFSET is the UInt32 that is being written to
}


And getmemory
    
void GetMemory()
{
SNPS3InitTargetComms();
BYTE b[4];
SNPS3ProcessGetMemory(0xfffffffe, 0, 0x1040200, 0, OFFSET, 4, b);//Again offset is the offset getting the memory from, 4 is the number of bytes getting, and b is the array off bytes to get
}


I don't know if this will help.. but oh well


ok thanks il update the thread tommorow
01-20-2014, 06:27 AM #15
Originally posted by Corey View Post
You're on the right track with Aerosouls method but you haven't added anything with attaching or getting or setting memory...

Use these as you were previously...
    
#include "C:/Program Files (x86)/SN Systems/PS3/sdk/include/ps3tmapi.h"
#pragma comment( lib, "C:/Program Files (x86)/SN Systems/PS3/sdk/lib/PS3TMAPI.lib" )
#pragma comment( lib, "C:/Program Files (x86)/SN Systems/PS3/sdk/lib/PS3TMAPIx64.lib" )


Then use this for Connecting and Attaching
    
//If you look in debugger sometimes the 0x1040200 changes, this is the processID so you'll might have to change it
void ConnectPS3()
{
SNPS3InitTargetComms();
SNPS3Connect(0xfffffffe, NULL);//0xfffffffe is the default
SNPS3ProcessAttach(0xfffffffe, 0, 0x1040200);
SNPS3ProcessContinue(0xfffffffe, 0x1040200);
}


Here is a setmemory test function
    
void SetMemoryTest()
{
SNPS3InitTargetComms();//You have to keep using SNPS3InitTargetComms every thread.. good think about this is you dont have to keep reconnecting
BYTE b[4] = { 1, 0, 0, 0 };
SNPS3ProcessSetMemory(0xfffffffe, 0, 0x1040200, 0, OFFSET, 4, (const BYTE *)b);//The 4 is the number of bytes being written and OFFSET is the UInt32 that is being written to
}


And getmemory
    
void GetMemory()
{
SNPS3InitTargetComms();
BYTE b[4];
SNPS3ProcessGetMemory(0xfffffffe, 0, 0x1040200, 0, OFFSET, 4, b);//Again offset is the offset getting the memory from, 4 is the number of bytes getting, and b is the array off bytes to get
}


I don't know if this will help.. but oh well


ok thanks il update the thread tommorow
01-21-2014, 01:01 AM #16
Originally posted by Corey View Post
You're on the right track with Aerosouls method but you haven't added anything with attaching or getting or setting memory...

Use these as you were previously...
    
#include "C:/Program Files (x86)/SN Systems/PS3/sdk/include/ps3tmapi.h"
#pragma comment( lib, "C:/Program Files (x86)/SN Systems/PS3/sdk/lib/PS3TMAPI.lib" )
#pragma comment( lib, "C:/Program Files (x86)/SN Systems/PS3/sdk/lib/PS3TMAPIx64.lib" )


Then use this for Connecting and Attaching
    
//If you look in debugger sometimes the 0x1040200 changes, this is the processID so you'll might have to change it
void ConnectPS3()
{
SNPS3InitTargetComms();
SNPS3Connect(0xfffffffe, NULL);//0xfffffffe is the default
SNPS3ProcessAttach(0xfffffffe, 0, 0x1040200);
SNPS3ProcessContinue(0xfffffffe, 0x1040200);
}


Here is a setmemory test function
    
void SetMemoryTest()
{
SNPS3InitTargetComms();//You have to keep using SNPS3InitTargetComms every thread.. good think about this is you dont have to keep reconnecting
BYTE b[4] = { 1, 0, 0, 0 };
SNPS3ProcessSetMemory(0xfffffffe, 0, 0x1040200, 0, OFFSET, 4, (const BYTE *)b);//The 4 is the number of bytes being written and OFFSET is the UInt32 that is being written to
}


And getmemory
    
void GetMemory()
{
SNPS3InitTargetComms();
BYTE b[4];
SNPS3ProcessGetMemory(0xfffffffe, 0, 0x1040200, 0, OFFSET, 4, b);//Again offset is the offset getting the memory from, 4 is the number of bytes getting, and b is the array off bytes to get
}


I don't know if this will help.. but oh well


actually for some reason im getting errors in the apibase.h with your code
01-21-2014, 12:08 PM #17
Originally posted by milky4444 View Post
actually for some reason im getting errors in the apibase.h with your code


Just leave all the header files where they where you might have to change the path to the files but it should work
01-21-2014, 04:23 PM #18
Originally posted by milky4444 View Post
actually for some reason im getting errors in the apibase.h with your code


Just leave all the header files where they where you might have to change the path to the files but it should work
01-21-2014, 05:58 PM #19
Originally posted by Corey View Post
Just leave all the header files where they where you might have to change the path to the files but it should work


this is the path i use: C:/Program Files (x86)/SN Systems/PS3/sdk/include/

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo