Skip to content

Instantly share code, notes, and snippets.

@swablueme
swablueme / process_operators.py
Last active February 15, 2024 10:14
Maa Assistant depot export parse json
import sys
import csv
import json
import requests
from os import path
from typing import Iterator
sys.stdin.reconfigure(encoding='utf-8')
sys.stdout.reconfigure(encoding='utf-8')
@swablueme
swablueme / dragonify_engage_characters.py
Last active April 8, 2023 12:11
Quick python script to generate dragon class entries in the person.xml file in the person.xml.bundle for the Fire Emblem Engage games
import os
from lxml import etree
import sys
import copy
# enables utf-8 printing
sys.stdout.reconfigure(encoding='utf-8')
class CONSTANTS:
# Units to make able to transform into a fell dragon
@swablueme
swablueme / KBCATEventRaidIdentifier.py
Last active April 8, 2023 12:08
Generate the event_raid_identifier for 7 star raids in Pokemon Scarlet and Violet
import binascii
import struct
#this is the VersionNo described in
#https://github.com/projectpokemon/EventsGallery/blob/master/Released/Gen%209/Raid%20Events/002%20Charizard%20the%20Unrivaled/Json/raid_enemy_array.json
VersionNo = 20221125
#< means little edian
#I unsigned int
hexValueForRaidIdentifier = struct.pack('<I', VersionNo)
@swablueme
swablueme / start srcpy.bat
Last active April 2, 2023 07:36
Starts both sndcpy and srcpy together
@echo off
::number times restarting sndcpy
set /A "FIXEDCOUNT=0"
set Token=MAIN_%RANDOM%_%CD%
::start sndcpy
pushd sndcpy-with-adb-windows-v1.1\ & start "%Token%_1" cmd /c sndcpy.bat & popd
::start scrcpy
start "%Token%_2" cmd /c scrcpy-win64-v1.24\scrcpy.exe --stay-awake --turn-screen-off
1. Download latest apktool version.
2. Create a folder anywhere in the PC and put all the apktool.jar in the folder
3. Open command prompt.
4. Navigate to the folder where you placed apktool.jar
5. For decompiling use the command "d". The "d" stands for decompile.
apktool<version>.jar d name-of-the-app.apk
@swablueme
swablueme / android_process_music.py
Last active September 23, 2022 09:14
Removes album art from music and folders it -- ready to put in my android directory
import eyed3
import os, shutil
import mutagen
from mutagen.mp4 import MP4
from mutagen.id3 import APIC, ID3
import re
eyed3.log.setLevel("ERROR")
print("Current working directory: {0}".format(os.getcwd()))
music_folder="to process"
to_output_to="output"
@swablueme
swablueme / epubmaker.py
Last active March 28, 2021 05:35
.txt files to epub
# -*- coding: utf-8 -*-
import os
import io
import pypub
import re
import logging
import time
logger = logging.getLogger()
@swablueme
swablueme / start_stop_citrix.bat
Created March 2, 2020 06:43
Starts/stops Citrix services
tasklist /FI "IMAGENAME eq wfcrun32.exe" 2>NUL | find /I /N "wfcrun32.exe">NUL
if %ERRORLEVEL%==0 (
echo Program is running, killed
FOR %%A in (
"wfcrun32.exe"
"SelfServicePlugin.exe"
"concentr.exe"
"redirector.exe"
"AuthManSvr.exe"
"Receiver.exe"
@swablueme
swablueme / please_rename_bins.py
Created March 1, 2020 03:02
put 3H romfs files in the correct directory structure
import os
import csv
OUTPUT_DIRECTORY="out"
FILELIST_CSV="filelist.csv"
def rename_bins():
files=os.listdir(OUTPUT_DIRECTORY)
with open(FILELIST_CSV) as csvfile:
reader = csv.DictReader(csvfile)
dictFilenames={row["Index"]:(row["Filename"], row["Destination"]) for row in reader}
@swablueme
swablueme / dds_2_png.bat
Created February 29, 2020 10:58
dds_png bat for use with texconv
for %%f in (*.dds) do (
.\texconv.exe "%%f" -ft png
)
@pause