Пример #1
0
    def print_inst(self, i, tab=0, prefix=""):
        def get_inst_str():
            nonlocal i
            return "%s %s" % (i.mnemonic, i.op_str)

        if prefix == "# ":
            if self.ctx.comments:
                print_comment_no_end(prefix, tab)
                print_no_end(color_addr(i.address))
                print_comment(get_inst_str())
            return

        if i.address in self.ctx.all_fused_inst:
            return

        if i.address != self.ctx.addr and \
                i.address in self.ctx.dis.binary.reverse_symbols:
            print_tabbed_no_end("", tab)
            self.print_symbol(i.address)
            print()

        modified = self.__print_inst(i, tab, prefix)

        if i.address in INTERN_COMMENTS:
            print_no_end(color_intern_comment(" ; "))
            print_no_end(color_intern_comment(INTERN_COMMENTS[i.address]))

        if modified and self.ctx.comments:
            print_comment_no_end(" # " + get_inst_str())

        print()
Пример #2
0
    def print_inst(self, i, tab=0, prefix=""):
        def get_inst_str():
            nonlocal i
            return "%s %s" % (i.mnemonic, i.op_str)

        if prefix == "# ":
            if self.ctx.comments:
                print_comment_no_end(prefix, tab)
                print_no_end(color_addr(i.address))
                self.print_bytes(i, True)
                print_comment(get_inst_str())
            return

        if i.address in self.ctx.all_fused_inst:
            return

        if self.is_symbol(i.address):
            print_tabbed_no_end("", tab)
            self.print_symbol(i.address)
            print()

        modified = self.__print_inst(i, tab, prefix)

        if i.address in INTERN_COMMENTS:
            print_no_end(color_intern_comment(" ; "))
            print_no_end(color_intern_comment(INTERN_COMMENTS[i.address]))

        if modified and self.ctx.comments:
            print_comment_no_end(" # " + get_inst_str())

        print()
Пример #3
0
    def print_inst(self, i, tab=0, prefix=""):
        def get_inst_str():
            nonlocal i
            return "%s %s" % (i.mnemonic, i.op_str)

        if i.address in self.ctx.dis.previous_comments:
            for comm in self.ctx.dis.previous_comments[i.address]:
                print_tabbed(color_intern_comment("; %s" % comm), tab)

        if prefix == "# ":
            if self.ctx.comments:
                if i.address in self.ctx.labels:
                    print_label(i.address, tab)
                    print()
                    print_comment_no_end(prefix + hex(i.address) + ": ", tab)
                else:
                    print_comment_no_end(prefix, tab)
                    print_addr(i.address)
                self.print_bytes(i, True)
                print_comment(get_inst_str())
            return

        if i.address in self.ctx.all_fused_inst:
            return

        if self.is_symbol(i.address):
            print_tabbed_no_end("", tab)
            self.print_symbol(i.address)
            print()

        modified = self.__print_inst(i, tab, prefix)

        if i.address in self.ctx.dis.inline_comments:
            print_no_end(color_intern_comment(" ; "))
            print_no_end(
                color_intern_comment(self.ctx.dis.inline_comments[i.address]))

        if modified and self.ctx.comments:
            print_comment_no_end(" # " + get_inst_str())

        print()
Пример #4
0
    def print_inst(self, i, tab=0, prefix=""):
        def get_inst_str():
            nonlocal i
            return "%s %s" % (i.mnemonic, i.op_str)

        if i.address in self.ctx.dis.previous_comments:
            for comm in self.ctx.dis.previous_comments[i.address]:
                print_tabbed(color_intern_comment("; %s" % comm), tab)

        if prefix == "# ":
            if self.ctx.comments:
                if i.address in self.ctx.labels:
                    print_label(i.address, tab)
                    print()
                    print_comment_no_end(prefix + hex(i.address) + ": ", tab)
                else:
                    print_comment_no_end(prefix, tab)
                    print_addr(i.address)
                self.print_bytes(i, True)
                print_comment(get_inst_str())
            return

        if i.address in self.ctx.all_fused_inst:
            return

        if self.is_symbol(i.address):
            print_tabbed_no_end("", tab)
            self.print_symbol(i.address)
            print()

        modified = self.__print_inst(i, tab, prefix)

        if i.address in self.ctx.dis.inline_comments:
            print_no_end(color_intern_comment(" ; "))
            print_no_end(color_intern_comment(self.ctx.dis.inline_comments[i.address]))

        if modified and self.ctx.comments:
            print_comment_no_end(" # " + get_inst_str())

        print()