[ElfLoader] better formatting for load and save instructions

kernel-mode
Anton Lydike 4 years ago
parent ed6912a060
commit 6bd5cd1598

@ -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:

Loading…
Cancel
Save