Skip to content

Instantly share code, notes, and snippets.

@Xzonn
Xzonn / ptd_export.py
Last active August 16, 2023 08:51
ptd exporter for "Bayonetta 3"
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
import io
import os
import struct
import json
def decode_string(byte_array):
byte_array = list(map(lambda x: (x - 0x26 + 0x100) % 0x100, byte_array))
#Much code taken from https://github.com/roxas75/rxTools/blob/012a9c2fe99f2d421e68ae91f738b4028995ad67/tools/scripts/ncchinfo_gen.py
#Uses some bits and pieces from https://github.com/Mtgxyz2/3ds-FUSE
#Comments are for people that care about being able to read their code tommorrow :P
from __future__ import print_function
import os, sys, glob, struct
from Crypto.Cipher import AES
from Crypto.Util import Counter
from hashlib import sha256
from ctypes import *
from binascii import hexlify, unhexlify
// ==UserScript==
// @name BYRBT插入图片
// @author Deparsoul & luziyan & lijishi
// @description 上传图片脚本,魔改自@Deparsoul的一键生成新番信息脚本
// @include http*://byr.pt*/upload.php*
// @include http*://byr.pt*/edit.php*
// @include http*://byr.pt*/topic.php*
// @include http*://byr.pt*/offers.php*edit*
// @include http*://byr.pt*/offers.php*add*
// @icon https://byr.pt/favicon.ico
@Xzonn
Xzonn / NSO_Strings.py
Created April 6, 2022 06:44
FC & SFC Nintendo Switch Online string extractor
import os
import json
os.chdir(os.path.dirname(__file__))
with open("../../../titles/lclassics.titlesdb", "r", -1, "utf-8") as f:
titles = json.load(f)["titles"]
dirs = os.listdir("./")
for dir in dirs:
@Xzonn
Xzonn / Download-Pdf-File-from-Cnki.user.js
Last active March 26, 2022 02:59
中国知网(CNKI)硕博论文跳转至“海外版”下载 pdf 文件
// ==UserScript==
// @name 中国知网(CNKI)硕博论文跳转至“海外版”下载 pdf 文件
// @namespace https://xzonn.top/
// @version 1.0.2
// @description 将中国知网(CNKI)搜索列表中的硕博论文详情页自动跳转至“海外版”网站,以便下载 pdf 文件。
// @author Xzonn
// @include http*://kns.cnki.net/kns8/defaultresult/index
// @icon https://www.cnki.net/favicon.ico
// @grant none
// @supportURL https://xzonn.top/posts/Download-Pdf-File-from-Cnki.html
@Xzonn
Xzonn / btxt.py
Last active February 14, 2022 03:18
btxt exporter for "Metroid Dread"
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
import os
import re
import struct
import sys
def export_btxt(bin):
magic = bin[0x00 : 0x04]
@Xzonn
Xzonn / wmbt.py
Last active December 7, 2023 00:45
wmbt exporter for "WarioWare: Get It Together!"
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
import os
import re
import struct
import sys
_control_names = {
"0001": "face",
@Xzonn
Xzonn / Buddy Mission BOND - Extract Text.py
Created August 22, 2021 13:47
Try to export etb files from "Buddy Misson BOND" into a txt file
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
#
# Try to export etb files from "Buddy Misson BOND" into a txt file
#
# 用于从《搭档任务 秘密搜查组》的 etb 文件提取 txt 文本
import os
import struct
@Xzonn
Xzonn / World's End Club - Extract Text.py
Created May 8, 2021 17:02
This script can be used to extract text content from <World's End Club>.
# This script can be used to extract text content from <World's End Club>.
# You should firstly extract ".bin" files from your game, by tools such as AssetStudioGUI.
import os
import struct
def padFile(f):
return f.seek((f.tell() + 3) // 4 * 4)
def readString(f):
import os
import xml.dom.minidom as xmldom
w = os.walk("./")
f = open("export.txt", "w", 1024 * 16, "utf-8")
for root, dirs, files in w:
for file in files:
if file.endswith(".kup"):
dom = xmldom.parse(os.path.join(root, file))