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-21-2014, 06:19 PM #20
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/
01-22-2014, 12:31 AM #21
Originally posted by milky4444 View Post
this is the path i use: C:/Program Files (x86)/SN Systems/PS3/sdk/include/

You shouldn't get any errors if you have all the original files where they are supposed to be.
01-25-2014, 11:21 AM #22
ItsLollo1000
Little One
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



Corey do u know how to Attach in Qt?
Message me on Skype sebastian.gerner2
02-18-2014, 06:29 PM #23
0xX0R
Save Point
i have an error atlconv.h No Such file or directory (APIUtf8.h)
Last edited by 0xX0R ; 02-23-2014 at 07:09 PM.
02-23-2014, 09:42 PM #24
0xX0R
Save Point
someone have a solution for this error atlconv.h no such file or directory
04-27-2014, 12:39 AM #25
How to connect for CCAPI ? In C++
04-28-2014, 12:09 AM #26
Originally posted by HacKGaming007 View Post
How to connect for CCAPI ? In C++


i know how to but i dont want to release it on enstones sake :/
04-29-2014, 07:17 PM #27
GMTPS3
Do a barrel roll!
ItsLollo1000 go to the .pro file in your Solution
then add this Code:
    INCLUDEPATH += <C:\Program Files (x86)\SN Systems\PS3\bin>
HEADERS += PS3TMAPI.h

INCLUDEPATH += <C:\Program Files (x86)\SN Systems\PS3\sdk\lib>
LIBS += -LPS3TMAPI.lib

You must login or register to view this content.

Have Fun :P

The following user thanked GMTPS3 for this useful post:

ItsLollo1000
04-30-2014, 04:34 PM #28
ItsLollo1000
Little One
Originally posted by GMTPS3 View Post
ItsLollo1000 go to the .pro file in your Solution
then add this Code:
    INCLUDEPATH += <C:\Program Files (x86)\SN Systems\PS3\bin>
HEADERS += PS3TMAPI.h

INCLUDEPATH += <C:\Program Files (x86)\SN Systems\PS3\sdk\lib>
LIBS += -LPS3TMAPI.lib

You must login or register to view this content.

Have Fun :P


Hab ich ja aber nimm mingw dann gehts nimma

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo