mirror of
https://github.com/pmret/papermario.git
synced 2024-11-08 20:12:30 +01:00
ae66312d8c
* Add Python linter to github actions * wip * Add back splat_ext * Format files * C++ -> C * format 2 files * split workflow into separate file, line length 120, fix excludes * -l 120 in ci * update black locally and apply formatting changes * pyproject.toject --------- Co-authored-by: Ethan Roseman <ethteck@gmail.com>
39 lines
878 B
Python
Executable File
39 lines
878 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import glob
|
|
import os
|
|
import re
|
|
import sys
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
script_dir = os.path.dirname(os.path.realpath(__file__))
|
|
root_dir = os.path.abspath(os.path.join(script_dir, "../.."))
|
|
|
|
import glob, os
|
|
|
|
os.chdir(root_dir)
|
|
|
|
for f in Path(root_dir).rglob("*.bin"):
|
|
if "papermario" in f.name:
|
|
continue
|
|
if f.name in ["bin_11A440.bin", "code_71430.bin", "bootcode_font.bin"]:
|
|
continue
|
|
|
|
ras = []
|
|
result = subprocess.run(
|
|
["mips-linux-gnu-objdump", "-Dz", "-bbinary", "-mmips", "-EB", f],
|
|
stdout=subprocess.PIPE,
|
|
)
|
|
output = result.stdout.decode().split("\n")
|
|
|
|
for line in output:
|
|
if re.match(r".*jr.*ra.*", line):
|
|
ras.append(line)
|
|
|
|
if len(ras) > 0:
|
|
print(f"{f.name} : {len(ras)}")
|
|
for line in ras:
|
|
print(line)
|
|
print("")
|