pastebin v0.1.7
refined hehe
Dec 30 2008 9:29 AM
hits: 15
pwned on irc
Dec 18 2008 7:54 PM
hits: 17
da's irc motd
Dec 12 2008 6:05 PM
hits: 17
Table query
Dec 2 2008 4:12 PM
hits: 35
shit
Nov 28 2008 2:01 PM
hits: 40
Smokin
Nov 20 2008 11:23 PM
hits: 47
owned.
Nov 14 2008 4:21 PM
hits: 51
strcmp
Nov 14 2008 8:48 AM
hits: 52
strcmp
Nov 14 2008 8:47 AM
hits: 42
sick email
Oct 19 2008 11:19 PM
hits: 71
Clock Clantag
Oct 19 2008 12:50 AM
hits: 80
pspdev
Oct 11 2008 11:09 PM
hits: 76

Valid HTML 4.01 Strict

Valid CSS!


  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
//Includes
#define _PSP_FW_VERSION 150
#include <pspkernel.h>
#include <pspkerneltypes.h>
#include <pspmoduleinfo.h>
#include <pspiofilemgr.h>
#include <pspmodulemgr.h>
#include <pspthreadman.h>
#include <stdlib.h>
#include <pspchnnlsv.h>
#include <pspctrl.h>
#include <string.h>
#include <pspctrl_kernel.h>
#include <pspthreadman_kernel.h>
#include <pspumd.h>
#include <crt0_prx.h>
#include <psppower.h>
#include <pspnet.h>
#include <pspwlan.h>
#include <psprtc.h>
#include <psphprm.h>

//Defines
PSP_MODULE_INFO("Test PRX", 0x3008, 1, 2); //0x3007
PSP_MAIN_THREAD_ATTR(0); //0 for kernel mode too
PSP_HEAP_SIZE_KB(-128);

//Globals
SceUID thid;
unsigned char gameId[10];
unsigned int FTB2=0;
unsigned char buffer[64];
unsigned char clan[17];
unsigned char chat[15];
int length=15;
int reload=0;
unsigned int *Personapointer=(unsigned int*) (0x005178C8+0x08800000);
unsigned int *swap=(unsigned int*) (0x00804000+0x08800000);

//Functions
int module_start(SceSize args, void *argp) __attribute__((alias("_start")));
int module_stop(SceSize args, void *argp) __attribute__((alias("_stop")));

//read from text file
void read_file(){
	
	int fd;
	
	fd=sceIoOpen("ms0:/seplugins/ftb1clan.txt", PSP_O_RDONLY, 0777);
	
	if(fd<=0) { sceIoClose(fd); return;}
	
	if(fd>0){
		sceIoRead(fd, clan, 17);
		sceIoClose(fd);
	}
	
	reload=0;
	
	return;
	
}

//control features
void control_features(){
	
	//---------------------------------------------------------------
	//grab info from system
	//---------------------------------------------------------------
	//get battery info and store it int your user name
	//---------------------------------------------------------------
	int batteryLifePercent = 0;
	batteryLifePercent = scePowerGetBatteryLifePercent();
	
	//---------------------------------------------------------------
	//get mac address
	//---------------------------------------------------------------
	u8 sVal[8];
	int retVal;
	memset(sVal, 0, 7);
	sceWlanGetEtherAddr(sVal);
	
	//---------------------------------------------------------------
	//grab the clocks current time
	//---------------------------------------------------------------
	pspTime time;
	sceRtcGetCurrentClockLocalTime(&time);
	
	//code to control the prx
	unsigned int *control=(unsigned int*) (0x00804004+0x08800000);
	
	//---------------------------------------------------------------
	//control features
	//---------------------------------------------------------------
	//watch watcdog
	switch(*control){
		
		case 0x00000000:
			sprintf(buffer, "%s", clan);
		break;
		
		//if *watchdog is 0x00
		case 0x00000001:
			sprintf(buffer, "Bat:%d%%", scePowerGetBatteryLifePercent());
		break;
		
		//if *watchdog is 0x01
		case 0x00000002:
			sprintf(buffer, "Temp:%d C", scePowerGetBatteryTemp());
		break;
		
		case 0x00000003:
			sprintf(buffer, "CPU:%d", scePowerGetCpuClockFrequency());
		break;
		
		case 0x00000004:
			sprintf(buffer, "BUS:%d", scePowerGetBusClockFrequency());
		break;
		
		case 0x00000005:
			sprintf(buffer, "%02i:%02i:%02i", time.hour , time.minutes, time.seconds);
		break;
		
		case 0x00000006:
			sprintf(buffer, "%d/%d/%d", time.day, time.month, time.year);
		break;

	}
	
	//reload text file function
	if(reload==1){
		read_file();
	}
	else{
		reload=0;
	}
	
	//set offset for user name and set length interger to 30
	if(*swap == 0x00000001){
		reload=1;
	}
	
}

//output to ram
void out_to_ram(){
	
	//---------------------------------------------------------------
	//Calculate player's object
	//---------------------------------------------------------------
	//setup foo for later kiddys o0o0o ahh FOO
	unsigned int foo=(unsigned int*) (*Personapointer);
	
	//if Personapointer+0x14 says Game
	if(*((unsigned int*)((unsigned int)foo+0x14)) == 0x656D6147){
		//host change offset 
		foo=(unsigned int*) (*Personapointer+0x38E);
	}
	//if Persona pointer+0x14 doesnt say Game then use the below offset
	else{
		//non host offset
		foo=(unsigned int*) (*Personapointer+0x8E);
	}
	
	//set offset for user name and set length interger to 30
	if(*swap == 0xFFFFFFFF){
		length=30;
		foo-=0x20;
	}
	
	//---------------------------------------------------------------
	//write out to ram
	//---------------------------------------------------------------
	//set counter to 0 by default
	int count=0;
	
	//input the buffer to ram
	while(count < length){
		//copy the battery percent into the ram
		*((unsigned char*) ((unsigned int)foo+count))=buffer[count];
		//count up
		count++;
	}
	
}

//main thread obviously look how its named are you STUPID?
int mainThread(){

	signed int fd;
	unsigned int counter=0;
	
	FTB2=1;
  
	//Wait for the kernel to boot up (if we don't, the PRX will crash since some functions may be missing)
	sceKernelDelayThread(15000000);
	while(!sceKernelFindModuleByName("sceKernelLibrary"))
	sceKernelDelayThread(100000);
	sceKernelDelayThread(100000);
  
	//Find the GAME ID (by reading the UMD_DATA file on the UMD)
	do{
		fd=sceIoOpen("disc0:/UMD_DATA.BIN", PSP_O_RDONLY, 0777); 
		sceKernelDelayThread(10000);
	} while(fd<=0);
	
	sceIoRead(fd, gameId, 10);
	sceIoClose(fd);
  
	//Compare the gameID to see if the game is SOCOM FTB2
	if(strncmp(gameId, "UCUS-98615", 10)){
		//Game isn't SOCOM FTB2
		FTB2=0;
	}
	
	//read the text file
	read_file();
	
	//while running is not equal to zero then run this loop
	while(FTB2){
				
		//if your persona pointer is not null do the goodies
		if(*Personapointer !=NULL){			

			control_features();
			out_to_ram();

		}

		//time out to keep thinks smooooth
		sceKernelDelayThread(1000000);
		
	}	

}

int _start(SceSize args, void *argp){

	//Create thread
	thid=sceKernelCreateThread("OurThread", &mainThread, 0x18, 0x1000, 0, NULL);
      
	//Start thread
	if(thid >= 0) sceKernelStartThread(thid, 0, NULL);
  
	return 0;
	
}

int _stop(SceSize args, void *argp){

	FTB2=0;
 	sceKernelTerminateThread(thid);
	return 0;
	
}

paste below
title
description/question
action