Unassemble memory in the region [address, address + size). If the size is not specified, a default value of 32 bytes is used. Synopsis: u 0x 0x
(self, args)
| 4074 | return self.do_disassemble(args) |
| 4075 | |
| 4076 | def do_disassemble(self, args): |
| 4077 | """ |
| 4078 | Unassemble memory in the region [address, address + size). |
| 4079 | |
| 4080 | If the size is not specified, a default value of 32 bytes is used. |
| 4081 | Synopsis: u 0x<address> 0x<size> |
| 4082 | """ |
| 4083 | if len(args) != 0: |
| 4084 | args = args.split(' ') |
| 4085 | self.u_start = self.ParseAddressExpr(args[0]) |
| 4086 | self.u_size = self.ParseAddressExpr(args[1]) if len(args) > 1 else 0x20 |
| 4087 | skip = False |
| 4088 | else: |
| 4089 | # Skip the first instruction if we reuse the last address. |
| 4090 | skip = True |
| 4091 | |
| 4092 | if not self.reader.IsValidAddress(self.u_start): |
| 4093 | print("Address %s is not contained within the minidump!" % ( |
| 4094 | self.reader.FormatIntPtr(self.u_start))) |
| 4095 | return |
| 4096 | lines = self.reader.GetDisasmLines(self.u_start, self.u_size) |
| 4097 | if len(lines) == 0: |
| 4098 | print("Address %s could not be disassembled!" % ( |
| 4099 | self.reader.FormatIntPtr(self.u_start))) |
| 4100 | print(" Could not disassemble using %s." % OBJDUMP_BIN) |
| 4101 | print(" Pass path to architecture specific objdump via --objdump?") |
| 4102 | return |
| 4103 | for line in lines: |
| 4104 | if skip: |
| 4105 | skip = False |
| 4106 | continue |
| 4107 | print(FormatDisasmLine(self.u_start, self.heap, line)) |
| 4108 | # Set the next start address = last line |
| 4109 | self.u_start += lines[-1][0] |
| 4110 | print() |
| 4111 | |
| 4112 | def do_EOF(self, none): |
| 4113 | raise KeyboardInterrupt |
no test coverage detected