diff options
author | Revo <projectrevotpp@hotmail.com> | 2021-05-23 01:28:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-23 01:28:16 -0400 |
commit | a7794a82a376150ef63562465a71fc161d67e7fa (patch) | |
tree | c7f40d9e03335c1b29980a8b79bf2ddb51764a5f /tools/asm_processor | |
parent | 121208bd6db271ae766a614da82fa00498bb7856 (diff) | |
parent | 4ea5a0c4aa1605f625d860f55894ac656bdcbd49 (diff) |
Merge pull request #349 from remicalixte/unk_02016B94
Decompile unk_02016B94.s
Diffstat (limited to 'tools/asm_processor')
-rwxr-xr-x | tools/asm_processor/asm_processor.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/asm_processor/asm_processor.py b/tools/asm_processor/asm_processor.py index ec01c68e..5c909388 100755 --- a/tools/asm_processor/asm_processor.py +++ b/tools/asm_processor/asm_processor.py @@ -9,7 +9,7 @@ import os from collections import namedtuple, defaultdict from io import StringIO -MAX_FN_SIZE = 100 +MAX_FN_SIZE = 3000 SLOW_CHECKS = False EI_NIDENT = 16 @@ -375,14 +375,14 @@ def is_temp_name(name): # https://stackoverflow.com/a/241506 def re_comment_replacer(match): s = match.group(0) - if s[0] in "/#": + if s[0] in "/#;": return " " else: return s re_comment_or_string = re.compile( - r'#.*|/\*.*?\*/|"(?:\\.|[^\\"])*"' + r';.*|#.*|/\*.*?\*/|"(?:\\.|[^\\"])*"' ) @@ -584,8 +584,12 @@ class GlobalAsmBlock: elif line.startswith('.byte'): self.add_sized(len(line.split(',')), real_line) # Branches are 4 bytes long - elif line.startswith('bl'): + elif line.startswith('bl') and not line.startswith('bls'): self.add_sized(4, real_line) + elif line.startswith('.word'): + self.add_sized(4, real_line) + elif line.startswith('.extern'): + pass else: # Unfortunately, macros are hard to support for .rodata -- # we don't know how how space they will expand to before @@ -820,7 +824,7 @@ def repl_float_hex(m): def parse_source(f, opt, framepointer, input_enc, output_enc, print_source=None): opt = "O4" min_instr_count = 3 # idk - skip_instr_count = 2 # idk + skip_instr_count = 3 # mandatory instructions: push, pop and mov r0, 0 use_jtbl_for_rodata = False if opt in ['O2', 'g3'] and not framepointer: |