Skip to content

Instantly share code, notes, and snippets.

View TheOfficialFloW's full-sized avatar

Andy Nguyen TheOfficialFloW

View GitHub Profile
@TheOfficialFloW
TheOfficialFloW / fd_fix.c
Last active February 27, 2019 19:45
File descriptor fix
#include <psp2kern/kernel/modulemgr.h>
#include <stdio.h>
#include <string.h>
#include <taihen.h>
static tai_hook_ref_t ksceVfsNodeInitializePartitionRef;
static SceUID hookid = -1;
// Kernel read exploit for devkits with FW < 3.68 by TheFloW
#include <psp2/appmgr.h>
#include <psp2/io/dirent.h>
#include <psp2/io/fcntl.h>
#include <psp2/io/stat.h>
#include <psp2/io/devctl.h>
#include <stdio.h>
#include <string.h>
@TheOfficialFloW
TheOfficialFloW / libarchive-3.3.2-vita.patch
Created January 14, 2018 18:48
libarchive 3.3.2 patch for vita
diff -Naur libarchive-3.3.2.orig/libarchive/archive_ppmd7.c libarchive-3.3.2/libarchive/archive_ppmd7.c
--- libarchive-3.3.2.orig/libarchive/archive_ppmd7.c 2016-06-20 00:54:34.000000000 +0200
+++ libarchive-3.3.2/libarchive/archive_ppmd7.c 2018-01-14 19:27:34.502464400 +0100
@@ -4,7 +4,7 @@
#include "archive_platform.h"
-#include <memory.h>
+// #include <memory.h>
@TheOfficialFloW
TheOfficialFloW / titleidvalue.c
Created June 17, 2017 10:41
Get titleid value. Used in ScePspemu for specific title adjustment
uint32_t getTitleIdValue(const char *titleid) {
uint32_t titleid_number = strtol(titleid+4, 0, 16);
uint32_t titleid_prefix = titleid[3] | (titleid[2] << 8) | (titleid[1] << 16) | (titleid[0] << 24);
uint32_t titleid_value = (titleid_number + (titleid_number << 12)) ^ titleid_prefix;
return titleid_value;
}
@TheOfficialFloW
TheOfficialFloW / rif_name.c
Created June 17, 2017 10:39
RIF name calcuation
uint8_t rif_name_keys[0x10] = {
0x19, 0xDD, 0x4F, 0xB9, 0x89, 0x48, 0x2B, 0xD4,
0xCB, 0x9E, 0xC9, 0xC7, 0x9A, 0x2E, 0xFB, 0xD0
};
int aes_encrypt(const void *buf, int size, uint8_t *keys) {
AES_ctx ctx;
AES_set_key(&ctx, rif_name_keys, 0x80);
int i;