This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# sdwire.py - SDWire control script | |
# | |
# Copyright (c) 2024 skgleba | |
# | |
# This software may be modified and distributed under the terms | |
# of the MIT license. See the LICENSE file for details. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !/bin/bash | |
# Google Drive API wrapper | |
# Create a project in Google Cloud Console, enable Drive API for chosen scopes, create OAuth 2.0 credentials, save them as secret.json in the same directory as this script | |
# and run this script with the 'init' argument to get the refresh token | |
SCRIPT_DIR=$(dirname $0) | |
RTOKEN_FILE="$SCRIPT_DIR/rtoken.json" # Refresh token file | |
TTOKEN_FILE="$SCRIPT_DIR/ttoken.json" # Temporary token file | |
SECRET_FILE="$SCRIPT_DIR/secret.json" # Secrets | |
RFILES_LIST="$SCRIPT_DIR/rfiles.csv" # remote files list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <inttypes.h> | |
#include <stdint.h> | |
#define BLOCK_SIZE 0x200 | |
#define ALIGN_SECTOR(s) ((s + (BLOCK_SIZE - 1)) & -BLOCK_SIZE) // align (arg) to BLOCK_SIZE | |
uint32_t getSz(const char* src) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <inttypes.h> | |
#include <stdint.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <sys/stat.h> | |
#include <stdbool.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <psp2kern/kernel/modulemgr.h> | |
#include <vitasdkkern.h> | |
void hexdump(uint8_t* data, int size) { | |
for (int i = 0; i < size; i -= -1) { | |
if (!(i % 0x10)) | |
ksceDebugPrintf("\n %04X: ", i); | |
ksceDebugPrintf("%02X ", data[i]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <psp2kern/kernel/modulemgr.h> | |
#include <vitasdkkern.h> | |
typedef struct SceSblSmCommContext130 { | |
uint32_t unk_0; | |
uint32_t self_type; // 2 - user = 1 / kernel = 0 | |
char data0[0x90]; //hardcoded data | |
char data1[0x90]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%.S: %.c | |
$(CC) -S -o $@ $< $(CFLAGS) | |
%.o: %.S | |
mv $< $<.w | |
awk '{if ($$1 == "movu" && !($$3 ~ /^[0-9]/)) {$$1 = "or3"; $$4 = $$3; $$3 = $$2; printf("\tmovh %s 0x0004\n\t", $$2)}} 1' $<.w > $< | |
rm $<.w | |
$(CC) -c -o $@ $< $(CFLAGS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2021-2022 skgleba | |
* | |
* This software may be modified and distributed under the terms | |
* of the MIT license. | |
*/ | |
#define READAS_REG 0xE0020040 // readas32 device | |
#define RAS_DEV_S 0 // default secure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// warning: the dbg exception (0x00040018) must be set to "reti" | |
// simply call set_dbg_mode(true) or (false) to enter or exit debug mode | |
// this code needs to be a separate function, do not inline it | |
__attribute__((noinline)) | |
void set_dbg_mode(bool debug_mode) { | |
if (!debug_mode) { | |
asm( | |
"ldc $0, $lp\n" | |
"stc $0, $depc\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* THIS FILE IS A PART OF PSP2FWTOOL | |
* | |
* Copyright (C) 2019-2021 skgleba | |
* | |
* This software may be modified and distributed under the terms | |
* of the MIT license. See the LICENSE file for details. | |
*/ | |
#include <stdio.h> | |
#include <string.h> |
NewerOlder