Skip to content

Instantly share code, notes, and snippets.

@infval
infval / ps2_psiops_movies_packer.py
Created March 21, 2020 21:40
[PS2] Psi-Ops MOVIES.MPK unpacker / packer (PlayStation 2, Psi-Ops: The Mindgate Conspiracy)
#!/usr/bin/env python3
__version__ = "1.0"
__author__ = "infval"
import argparse
from pathlib import Path
from struct import unpack, pack
@infval
infval / translate.py
Last active February 3, 2020 18:05
Translate characters
#!/usr/bin/env python3
import argparse
from pathlib import Path
parser = argparse.ArgumentParser(description='Translate characters')
parser.add_argument('input', help='input file')
parser.add_argument('table', help='table file, "A=Z\\nB=2\\nK=M"')
parser.add_argument('output', help='output file')
parser.add_argument('-e', '--encoding', default="utf-8",
@infval
infval / qd2fds.py
Last active December 4, 2023 01:09 — forked from einstein95/qd2fds.py
Converts between QD and FDS disk images (Family Computer Disk System / Famicom)
#!/usr/bin/env python3
"""
Converts between QD and FDS disk images
"""
import struct
def create_fds_header(side_count):
return b"FDS\x1A" + bytes([side_count & 0xFF]) + bytes(11)
@infval
infval / nes_coop.md
Created January 27, 2020 22:25
[NES] Кооперативные игры
Название Жанр Экран Заметки Скриншоты
Balloon Fight Platformer image image
Battle City Shooter image image
Bubble Bobble Platformer image image image
Cabal Shooter image image
CJ's Elephant Antics Platfo
@infval
infval / Toejam_&_Earl_in_Panic_on_Funkotron.lua
Last active January 3, 2020 20:31
[SMD] Toejam & Earl in Panic on Funkotron - Moving Characters [BizHawk/Lua]
local player1_x = 0x8DDC
local player1_y = 0x8DE4
local player2_x = 0x8E5C
local player2_y = 0x8E64
local player_x = player1_x
local player_y = player1_y
local step = 1
local prev_keys = {}
@infval
infval / sor2_comp.py
Last active December 29, 2019 03:26
[SMD] Streets of Rage 2 tileset (de)compressor (extractor, unpacker)
#!/usr/bin/env python3
import io
import struct
from pathlib import Path
def decompress(inpt, artAddress):
inpt.seek(artAddress)
output = io.BytesIO()
@infval
infval / extract_hana_to_otome.py
Created November 2, 2019 19:57
[PS2] Hana to Otome ni Shukufuku o: Harukaze no Okurimono | extractor
#!/usr/bin/env python3
import re
import pathlib
from struct import unpack
pathlib.Path('./EXTRACTED').mkdir(exist_ok=True)
with open("SLPM_552.63", "rb") as f:
bexe = f.read()
@infval
infval / yuzu_bmz2_fix.py
Last active April 18, 2020 05:48
yuzu | Color fix for 'Blaster Master Zero 2' [Switch]
#!/usr/bin/env python3
"""
Dirty color fix for 'Blaster Master Zero 2' [Switch]
OpenGL ONLY!
Tested version: yuzu 228
"""
import sys
# \src\video_core\renderer_opengl\renderer_opengl.cpp
shader_text = b"void main() {\n color = vec4(texture(color_texture, frag_tex_coord).rgb, 1.0f);\n}"
@infval
infval / get_explorer_search_history.py
Created September 22, 2019 23:38
[Win7] Explorer search history to file
#!/usr/bin/env python3
import winreg
sub_key = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\WordWheelQuery"
history = []
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, sub_key) as key:
order, regtype = winreg.QueryValueEx(key, "MRUListEx")
ind = 0
while order[ind] != 0xFF:
@infval
infval / extractor_texture_mgf_SH2_PS2.py
Last active August 25, 2022 21:58
[PS2] Silent Hill 2 PIC.IMG extractor (unpacker/packer)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import math
import argparse
from collections import OrderedDict
from PIL import Image, ImageDraw