hotfix disasm for python 3.6 (#928)

This commit is contained in:
Anghelo Carvajal 2022-07-12 00:01:58 -04:00 committed by GitHub
parent 66c4d743b3
commit 628482f3c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -1,7 +1,5 @@
#!/usr/bin/env python3
from __future__ import annotations
import argparse, ast, math, os, re, struct
import bisect
import multiprocessing
@ -592,7 +590,7 @@ def find_symbols_in_text(section, rodata_section, data_regions):
if region[1] % 0x10 == 0:
put_symbol(symbols_dict, "files", region[1])
insns: list[rabbitizer.Instruction] = []
insns = []
for i, raw_insn in enumerate(raw_insns, 0):
insn = rabbitizer.Instruction(raw_insn, vram=vram + i * 4)
@ -663,7 +661,7 @@ def find_symbols_in_text(section, rodata_section, data_regions):
assert False, "Invalid relocation type encountered"
result_files = []
results: list[str | dict] = [asm_header(".text")]
results = [asm_header(".text")]
raw_insns = as_word_list(data)
cur_file = ""
@ -1104,7 +1102,7 @@ def asm_header(section_name: str):
"""
def getImmOverride(insn: rabbitizer.Instruction) -> str | None:
def getImmOverride(insn: rabbitizer.Instruction):
if insn.isBranch():
return f".L{insn.getBranchOffset() + insn.vram:08X}"
elif insn.isJump():