[ElfLoader] better formatting for load and save instructions

This commit is contained in:
Anton Lydike 2021-05-24 10:08:01 +02:00
parent ed6912a060
commit 6bd5cd1598

View File

@ -109,11 +109,18 @@ class ElfInstruction:
return self.args[num]
def __repr__(self):
if self.name in ('sw', 'sh', 'sb', 'lb', 'lh', 'lb', 'lbu', 'lhu'):
args = "{}, {}({})".format(
self.args[1], self.args[2], self.args[0]
)
else:
args = ", ".join(map(str, self.args))
return "{:<8} {}".format(
self.name,
", ".join(map(str, self.args))
args
)
class ElfLoadedMemorySection(LoadedMemorySection):
def read_instruction(self, offset):
if not self.flags.executable: