diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2018-07-28 13:27:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-07-28 13:27:01 +0200 |
| commit | 7acc9f00489f0f9444b8fa2e5068317c0de90f38 (patch) | |
| tree | fb69aea0d7dcd0438701b0b71be3833997ecabef /miasm2/core/asmblock.py | |
| parent | bb1cc452ca771ea6800ccfebd4c45237ba9a7554 (diff) | |
| parent | ab0cf7308e9fb0c5ddeb2e49da75193cd7d50304 (diff) | |
| download | miasm-7acc9f00489f0f9444b8fa2e5068317c0de90f38.tar.gz miasm-7acc9f00489f0f9444b8fa2e5068317c0de90f38.zip | |
Merge pull request #803 from commial/feature/linux-env
Feature/linux env
Diffstat (limited to 'miasm2/core/asmblock.py')
| -rw-r--r-- | miasm2/core/asmblock.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/miasm2/core/asmblock.py b/miasm2/core/asmblock.py index 2f16543f..c00b4c5c 100644 --- a/miasm2/core/asmblock.py +++ b/miasm2/core/asmblock.py @@ -1596,3 +1596,17 @@ class disasmEngine(object): warnings.warn('DEPRECATION WARNING: use "dis_multiblock" instead of "dis_multibloc"') return self.dis_multiblock(offset, blocs) + def dis_instr(self, offset): + """Disassemble one instruction at offset @offset and return the + corresponding instruction instance + @offset: targeted offset to disassemble + """ + old_lineswd = self.lines_wd + self.lines_wd = 1 + try: + block = self.dis_block(offset) + finally: + self.lines_wd = old_lineswd + + instr = block.lines[0] + return instr |