Todos sabemos que
@CTurt es un conocido hacker prestigioso que ha trabajado en la consola PlayStation 4 por un tiempo. Hace poco abandonó la escena de PS4, pero hace un par de horas, ahora ha actualizado su PS4SDK para otros desarrolladores si esto resulta útil para cualquiera. Puede encontrar todos los recursos y código abajo.
GITHUB https://github.com/CTurt/PS4-SDK/commits/masterLibc.cLibc.hLibc.h Code #pragma once
#include "types.h"
#include "file.h"
typedef struct DIR DIR;
typedef int FILE;
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
extern void *(*malloc)(size_t size);
extern void (*free)(void *ptr);
extern void *(*calloc)(size_t num, size_t size);
extern void *(*realloc)(void* ptr, size_t size);
extern void *(*memset)(void *destination, int value, size_t num);
extern void *(*memcpy)(void *destination, const void *source, size_t num);
extern int (*memcmp)(const void *s1, const void *s2, size_t n);
extern char *(*strcpy)(char *destination, const char *source);
extern char *(*strncpy)(char *destination, const char *source, size_t num);
extern char *(*strcat)(char *dest, const char *src);
extern char *(*strncat)(char *dest, const char *src, size_t n);
extern size_t (*strlen)(const char *s);
extern int (*strcmp)(const char *s1, const char *s2);
extern int (*strncmp)(const char *s1, const char *s2, size_t n);
extern int (*sprintf)(char *str, const char *format, ...);
extern int (*snprintf)(char *str, size_t size, const char *format, ...);
extern int (*sscanf)(const char *str, const char *format, ...);
extern char *(*strchr)(const char *s, int c);
extern char *(*strrchr)(const char *s, int c);
extern char *(*strstr)(char *str1, char *str2);
extern void (*srand)(unsigned int seed);
extern int (*rand)(void);
extern char *(*asctime)(const struct tm *tm);
extern char *(*asctime_r)(const struct tm *tm, char *buf);
extern char *(*ctime)(const time_t *timep);
extern char *(*ctime_r)(const time_t *timep, char *buf);
extern struct tm *(*gmtime)(const time_t *timep);
extern struct tm *(*gmtime_r)(const time_t *timep, struct tm *result);
extern struct tm *(*localtime)(const time_t *timep);
extern struct tm *(*localtime_r)(const time_t *timep, struct tm *result);
extern time_t (*mktime)(struct tm *tm);
extern DIR *(*opendir)(const char *filename);
extern struct dirent *(*readdir)(DIR *dirp);
extern int (*readdir_r)(DIR *dirp, struct dirent *entry, struct dirent **result);
extern long (*telldir)(const DIR *dirp);
extern void (*seekdir)(DIR *dirp, long loc);
extern void (*rewinddir)(DIR *dirp);
extern int (*closedir)(DIR *dirp);
extern int (*dirfd)(DIR *dirp);
extern char *(*getprogname)();
extern FILE *(*fopen)(const char *filename, const char *mode);
extern size_t (*fread)(void *ptr, size_t size, size_t count, FILE *stream);
extern size_t (*fwrite)(const void * ptr, size_t size, size_t count, FILE *stream );
extern int (*fseek)(FILE *stream, long int offset, int origin);
extern long int(*ftell)(FILE *stream);
extern int (*fclose)(FILE *stream);
+extern int (*fprintf)(FILE *stream, const char *format, ...);
void initLibc(void);
Libc.c Code #include "kernel.h"
#include "module.h"
#include "libc.h"
void *(*malloc)(size_t size);
void (*free)(void *ptr);
void *(*calloc)(size_t num, size_t size);
void *(*realloc)(void* ptr, size_t size);
void *(*memset)(void *destination, int value, size_t num);
void *(*memcpy)(void *destination, const void *source, size_t num);
int (*memcmp)(const void *s1, const void *s2, size_t n);
char *(*strcpy)(char *destination, const char *source);
char *(*strncpy)(char *destination, const char *source, size_t num);
char *(*strcat)(char *dest, const char *src);
char *(*strncat)(char *dest, const char *src, size_t n);
size_t (*strlen)(const char *s);
int (*strcmp)(const char *s1, const char *s2);
int (*strncmp)(const char *s1, const char *s2, size_t n);
int (*sprintf)(char *str, const char *format, ...);
int (*snprintf)(char *str, size_t size, const char *format, ...);
int (*sscanf)(const char *str, const char *format, ...);
char *(*strchr)(const char *s, int c);
char *(*strrchr)(const char *s, int c);
char *(*strstr)(char *str1, char *str2);
void (*srand)(unsigned int seed);
int (*rand)(void);
char *(*asctime)(const struct tm *tm);
char *(*asctime_r)(const struct tm *tm, char *buf);
char *(*ctime)(const time_t *timep);
char *(*ctime_r)(const time_t *timep, char *buf);
struct tm *(*gmtime)(const time_t *timep);
struct tm *(*gmtime_r)(const time_t *timep, struct tm *result);
struct tm *(*localtime)(const time_t *timep);
struct tm *(*localtime_r)(const time_t *timep, struct tm *result);
time_t (*mktime)(struct tm *tm);
DIR *(*opendir)(const char *filename);
struct dirent *(*readdir)(DIR *dirp);
int (*readdir_r)(DIR *dirp, struct dirent *entry, struct dirent **result);
long (*telldir)(const DIR *dirp);
void (*seekdir)(DIR *dirp, long loc);
void (*rewinddir)(DIR *dirp);
int (*closedir)(DIR *dirp);
int (*dirfd)(DIR *dirp);
char *(*getprogname)();
FILE *(*fopen)(const char *filename, const char *mode);
size_t (*fread)(void *ptr, size_t size, size_t count, FILE *stream);
size_t (*fwrite)(const void * ptr, size_t size, size_t count, FILE *stream );
int (*fseek)(FILE *stream, long int offset, int origin);
long int(*ftell)(FILE *stream);
int (*fclose)(FILE *stream);
+int (*fprintf)(FILE *stream, const char *format, ...);
void initLibc(void) {
int libc = sceKernelLoadStartModule("libSceLibcInternal.sprx", 0, NULL, 0, 0, 0);
RESOLVE(libc, malloc);
RESOLVE(libc, free);
RESOLVE(libc, calloc);
RESOLVE(libc, realloc);
RESOLVE(libc, memset);
RESOLVE(libc, memcpy);
RESOLVE(libc, memcmp);
RESOLVE(libc, strcpy);
RESOLVE(libc, strncpy);
RESOLVE(libc, strcat);
RESOLVE(libc, strncat);
RESOLVE(libc, strlen);
RESOLVE(libc, strcmp);
RESOLVE(libc, strncmp);
RESOLVE(libc, sprintf);
RESOLVE(libc, snprintf);
RESOLVE(libc, sscanf);
RESOLVE(libc, strchr);
RESOLVE(libc, strrchr);
RESOLVE(libc, strstr);
RESOLVE(libc, srand);
RESOLVE(libc, rand);
RESOLVE(libc, asctime);
RESOLVE(libc, asctime_r);
RESOLVE(libc, ctime);
RESOLVE(libc, ctime_r);
RESOLVE(libc, gmtime);
RESOLVE(libc, gmtime_r);
RESOLVE(libc, localtime);
RESOLVE(libc, localtime_r);
RESOLVE(libc, mktime);
RESOLVE(libc, opendir);
RESOLVE(libc, readdir);
RESOLVE(libc, readdir_r);
RESOLVE(libc, telldir);
RESOLVE(libc, seekdir);
RESOLVE(libc, rewinddir);
RESOLVE(libc, closedir);
RESOLVE(libc, dirfd);
RESOLVE(libc, getprogname);
RESOLVE(libc, fopen);
RESOLVE(libc, fread);
RESOLVE(libc, fwrite);
RESOLVE(libc, fseek);
RESOLVE(libc, ftell);
RESOLVE(libc, fclose);
+ RESOLVE(libc, fprintf);
}
Credits :
NextGenUpdate