mirror of
https://github.com/pret/pokemon-reverse-engineering-tools.git
synced 2026-03-21 17:24:42 -05:00
add extras/parse_consecutive_strings.py
original-commit-id: aeaaade74cb5ff4d4884a4846ffe9a2103d50960
This commit is contained in:
parent
bf45a2bdf2
commit
fc09356a8a
25
parse_consecutive_strings.py
Normal file
25
parse_consecutive_strings.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import sys
|
||||
|
||||
import crystal
|
||||
|
||||
rom = crystal.load_rom()
|
||||
|
||||
addr = int(sys.argv[1], 16)
|
||||
count = int(sys.argv[2]) if len(sys.argv) > 2 else 256
|
||||
label_prefix = sys.argv[3] if len(sys.argv) > 3 else "UnknownString"
|
||||
|
||||
ex = None
|
||||
|
||||
for i in range(count):
|
||||
try:
|
||||
string = crystal.PokedexText(addr)
|
||||
asm = string.to_asm()
|
||||
except Exception as ex:
|
||||
break
|
||||
print label_prefix+str(i)+": ; "+hex(addr)
|
||||
print "\t"+asm
|
||||
print
|
||||
addr = string.last_address
|
||||
|
||||
print "; "+hex(addr)
|
||||
if ex: raise ex
|
||||
Loading…
Reference in New Issue
Block a user