Post: [C++/1.02] SPRX Keyboard
11-10-2014, 07:41 PM #1
xReaperv3
Bounty hunter
(adsbygoogle = window.adsbygoogle || []).push({}); Hi NGU, since i got SPRX working again i decided to convert the C# Keyboard to C++ to use with SPRX.

You will need this PS3 Functions:
    
float intArray[100];
float* ReadInt(int address, int length)
{
for (int i = 0; i < length; i++)
{
intArray[i] = *(int*)(address + (i * 0x04));
}
return intArray;
}

struct readstr
{
char returnRead[100];
}ReturnRead[1000];
int strcount;

char* ReadString(int address)
{
strcount++;
memset(&ReturnRead[strcount].returnRead[0], 0, sizeof(ReturnRead[strcount].returnRead));
int strlength = 100;
char* StrBytes = ReadBytes(address, strlength);
for (int i = 0; i < strlength; i++)
{
if (StrBytes[i] != 0x00)
ReturnRead[strcount].returnRead[i] = StrBytes[i];
else
break;
}
return ReturnRead[strcount].returnRead;
}

void sleep(usecond_t time)
{
sys_timer_usleep(time * 1000);
}


The opd_s struct + TOC Address
    
Use the TOC Address like this:
#define TOC (0x994E9Cool Man (aka Tustin)
or call it in the Function itself, do what you want :P

struct opd_s
{
uint32_t sub;
uint32_t toc;
};


And at the End, the Keyboard Function itself:
    
opd_s keyBoardPrompt = { 0x493D68, TOC };
void(*CallKeyBoard)(int z, char* Title, char* Preset, int Lenght, int z1, int z2, int Addr) = (void(*)(int, char*, char*, int, int, int, int))&keyBoardPrompt;

char* runKeyBoard(char* Title = "Your Title", char* PresetText = "Preset Text here", int maxLenght = 20)
{
CallKeyBoard(0, Title, PresetText, maxLenght, 0, 0, 0x988F9Cool Man (aka Tustin);
sleep(10);
while (ReadInt(0x0099E42C, 1) == 0) {}
return ReadString(0x03080E22);
}


Then you can call it like this:

    
runKeyBoard("SPRX KeyBoard", "Enter anything you want..."); //1. Title, 2. Text


At last, it's nothing new & nothing special, but maybe anyone needed it.

Credits:

-Can i have Credits for converting + posting?
-Bad Luck Brian | C# Version
-OLDSCHOOLMODZ | PS3 Functions

I dont care if you groan, just go on ^^
Last edited by xReaperv3 ; 11-10-2014 at 07:49 PM.

The following 6 users say thank you to xReaperv3 for this useful post:

Ariel R., Arrow_Modz, kizza929, OLDSCHOOLMODZHD, TheModedHacker, WEx_Modz123

The following user groaned xReaperv3 for this awful post:

11-10-2014, 08:12 PM #2
Nice Post !

The following user thanked WEx_Modz123 for this useful post:

xReaperv3
11-10-2014, 08:15 PM #3
Originally posted by xReaperv3 View Post
Hi NGU, since i got SPRX working again i decided to convert the C# Keyboard to C++ to use with SPRX.

You will need this PS3 Functions:
    
float intArray[100];
float* ReadInt(int address, int length)
{
for (int i = 0; i < length; i++)
{
intArray[i] = *(int*)(address + (i * 0x04));
}
return intArray;
}

struct readstr
{
char returnRead[100];
}ReturnRead[1000];
int strcount;

char* ReadString(int address)
{
strcount++;
memset(&ReturnRead[strcount].returnRead[0], 0, sizeof(ReturnRead[strcount].returnRead));
int strlength = 100;
char* StrBytes = ReadBytes(address, strlength);
for (int i = 0; i < strlength; i++)
{
if (StrBytes[i] != 0x00)
ReturnRead[strcount].returnRead[i] = StrBytes[i];
else
break;
}
return ReturnRead[strcount].returnRead;
}

void sleep(usecond_t time)
{
sys_timer_usleep(time * 1000);
}


The opd_s struct + TOC Address
    
Use the TOC Address like this:
#define TOC (0x994E9Cool Man (aka Tustin)
or call it in the Function itself, do what you want :P

struct opd_s
{
uint32_t sub;
uint32_t toc;
};


And at the End, the Keyboard Function itself:
    
opd_s keyBoardPrompt = { 0x493D68, TOC };
void(*CallKeyBoard)(int z, char* Title, char* Preset, int Lenght, int z1, int z2, int Addr) = (void(*)(int, char*, char*, int, int, int, int))&keyBoardPrompt;

char* runKeyBoard(char* Title = "Your Title", char* PresetText = "Preset Text here", int maxLenght = 20)
{
CallKeyBoard(0, Title, PresetText, maxLenght, 0, 0, 0x988F9Cool Man (aka Tustin);
sleep(10);
while (ReadInt(0x0099E42C, 1) == 0) {}
return ReadString(0x03080E22);
}


Then you can call it like this:

    
runKeyBoard("SPRX KeyBoard", "Enter anything you want..."); //1. Title, 2. Text


At last, it's nothing new & nothing special, but maybe anyone needed it.

Credits:

-Can i have Credits for converting + posting?
-Bad Luck Brian | C# Version
-OLDSCHOOLMODZ | PS3 Functions

I dont care if you groan, just go on ^^


Honestly didn't need to make a new thread for this, should have just posted in brians thread. Also If I'm correct this won't return anything besides numbers.
11-10-2014, 08:22 PM #4
xReaperv3
Bounty hunter
Originally posted by Doctor
Honestly didn't need to make a new thread for this, should have just posted in brians thread. Also If I'm correct this won't return anything besides numbers.


I asked BLB if i can release it, i dont want to spam other threads with my shit... atleast i should have posted it into OLDSCHOOLMODZ's C++ Script Thread... i really don't care if you try to hate or if you groan, just go on that way.... it works fine so, why shouldn't i release something that i've "made" to 'help' others?
That's why people don't release that much, just because of ppl's who groan/hate on his threads - but i dont care so, as i said.. otherwise thanks for your reply
11-10-2014, 09:34 PM #5
Arrow_Modz
Can’t trickshot me!
Shut Up, Noob, #ReaperBoss

The following user thanked Arrow_Modz for this useful post:

xReaperv3

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo