Skip to content

Instantly share code, notes, and snippets.

View john-tornblom's full-sized avatar

John Törnblom john-tornblom

  • Linköping, Sweden
View GitHub Profile
#!/usr/bin/env bash
PS5_HOST=ps5
ELFLDR=https://github.com/john-tornblom/ps5-payload-elfldr/releases/download/release%2Fv0.11/Payload.zip
KLOGSRV=https://github.com/john-tornblom/ps5-payload-klogsrv/releases/download/release%2Fv0.3/Payload.zip
FTPSRV=https://github.com/john-tornblom/ps5-payload-ftpsrv/releases/download/release%2Fv0.6/Payload.zip
SHSRV=https://github.com/john-tornblom/ps5-payload-shsrv/releases/download/release%2Fv0.4/Payload.zip
wget -q -O - $ELFLDR | gunzip -c -d | nc -q3 $PS5_HOST 9020
#!/usr/bin/env python3
# encoding: utf-8
# Copyright (C) 2022 John Törnblom
import argparse
import ctypes.util
import logging
import os
import xml.etree.ElementTree as ET
@john-tornblom
john-tornblom / patch_gettext.py
Created April 25, 2021 13:22
Replace literal strings in source code with gettext macro calls
#!/usr/bin/env python3
# encoding: utf-8
# Copyright (C) 2021 John Törnblom
"""
Replace literal strings in source code with gettext macro calls.
Requires python3 with clang bindings. In ubuntu:
sudo apt-get install python3-clang
"""
@john-tornblom
john-tornblom / mo2po.c
Created April 22, 2021 16:34
simple MO to PO file conversion tool
/* Copyright (C) 2021 John Törnblom
Parser for gettext MO files, as described on:
https://www.gnu.org/software/gettext/manual/html_node/MO-Files.html
*/
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@john-tornblom
john-tornblom / dynlib.h
Created February 6, 2021 14:09
WIP struct for PS4 dynlib_obj struct
struct dynlib_dynsec {
struct {
struct dynlib_dynsec *le_next;
struct dynlib_dynsec *le_prev;
} list_entry;
unsigned long handle; //struct sysentvec* ?
unsigned int refcount;
long size;
#!/usr/bin/env python3
import librosa
import numpy as np
from pathlib import Path
import pandas as pd
class WaveFile(object):
filename = None
@john-tornblom
john-tornblom / ENG.po
Created April 23, 2020 13:05
Diablo PS1 gettext files
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Content-Type: text/plain; charset=UTF-8\n"
"X-Poedit-SourceCharset: UTF-8\n"
msgid "THE AWAKENING"
msgstr "THE AWAKENING"
msgid "THE BINDING OF THE THREE"
msgstr "THE BINDING OF THE THREE"
msgid "THE DARKENING OF TRISTRAM"
class Order(object):
reverse = False
def __init__(self, attrs, reverse=False):
self.attrs = attrs
self.reverse = reverse
def __call__(self, l):
return sorted(l,