#include <PS3\IO.h> //include header with PS3 read/write funcs
#include <PS3\SystemUtils.h> //this for any memory objects
#define path "path/to/usb000/inject"
#define table_addr 0x0
#define table_count 0x0
typedef unsigned char byte;
typedef struct {
char* name;
int id; //file or directory
char* file_path;
int size;
} file_t;
DebugLine( char* str ) {
printf( "%s\n", str ); //the ps3 varient of this to debug.
}
int main(int argc, char** args) {
if( !DirectoryExists( path ) ) { //ps3 varient to check if directory exists.
DebugLine( "No Injector Folder" );
return -1;
}
file_t* files = RecursivelyGetFiles( path ); //you can setup your own func for this, just get all files in a folder.
for( int i = 0; i < table_count; i++ ) {
rawfile_t* raw = (rawfile_t *)( *(int *)&ps3_memory[table_addr = (i * sizeof(int))] );
file_t selected_file = str_inStrArray( raw->name, files );
if( selected_file ) { //this would compare name with all new local files, if matches in array, return true
int addr_to_write = *(int *)malloc( selected_file->file_size * sizeof(byte) ); //clear space for it (C++'s new equivalent)
*(byte addr_to_write) = selected_file->file_data; //write the files contents into memory.
Update_Rawfile_Header( raw, selected_file->file_size ); //write this func as well, essentially it just updates the filesize in memory of an object (in this case rawfile)
}
}
return 0;
Copyright © 2024, NextGenUpdate.
All Rights Reserved.