Skip to content

Commit

Permalink
Merge branch 'master-upstream' into add_arm_inst
Browse files Browse the repository at this point in the history
  • Loading branch information
b14aa178 committed Dec 5, 2020
2 parents 67457b6 + 34438fe commit 9053207
Show file tree
Hide file tree
Showing 144 changed files with 4,637 additions and 761 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Add instruction to the pool:
Print current pool:
```pycon
>>> for lbl, irblock in ircfg.blocks.items():
... print(irblock.to_string(loc_db))
... print(irblock)
loc_0:
R2 = R8 + R0

Expand All @@ -134,10 +134,10 @@ IRDst = loc_4
```
Working with IR, for instance by getting side effects:
```pycon
>>> for lbl, irblock in ircfg.blocks.iteritems():
>>> for lbl, irblock in ircfg.blocks.items():
... for assignblk in irblock:
... rw = assignblk.get_rw()
... for dst, reads in rw.iteritems():
... for dst, reads in rw.items():
... print('read: ', [str(x) for x in reads])
... print('written:', dst)
... print()
Expand Down Expand Up @@ -166,13 +166,13 @@ Giving a shellcode:
00000010 8d5b01 lea ebx, [ebx+0x1]
00000013 89d8 mov eax, ebx
00000015 c3 ret
>>> s = '\x8dI\x04\x8d[\x01\x80\xf9\x01t\x05\x8d[\xff\xeb\x03\x8d[\x01\x89\xd8\xc3'
>>> s = b'\x8dI\x04\x8d[\x01\x80\xf9\x01t\x05\x8d[\xff\xeb\x03\x8d[\x01\x89\xd8\xc3'
```
Import the shellcode thanks to the `Container` abstraction:

```pycon
>>> from miasm.analysis.binary import Container
>>> c = Container.from_string(s)
>>> c = Container.from_string(s, loc_db)
>>> c
<miasm.analysis.binary.ContainerUnknown object at 0x7f34cefe6090>
```
Expand All @@ -182,10 +182,10 @@ Disassembling the shellcode at address `0`:
```pycon
>>> from miasm.analysis.machine import Machine
>>> machine = Machine('x86_32')
>>> mdis = machine.dis_engine(c.bin_stream)
>>> mdis = machine.dis_engine(c.bin_stream, loc_db=loc_db)
>>> asmcfg = mdis.dis_multiblock(0)
>>> for block in asmcfg.blocks:
... print(block.to_string(asmcfg.loc_db))
... print(block)
...
loc_0
LEA ECX, DWORD PTR [ECX + 0x4]
Expand All @@ -208,7 +208,7 @@ RET
Initializing the Jit engine with a stack:

```pycon
>>> jitter = machine.jitter(jit_type='python')
>>> jitter = machine.jitter(loc_db, jit_type='python')
>>> jitter.init_stack()
```

Expand Down Expand Up @@ -517,7 +517,9 @@ Documentation

TODO

An auto-generated documentation is available [here](http://miasmdoc.ajax.re).
An auto-generated documentation is available:
* [Doxygen](http://miasm.re/miasm_doxygen)
* [pdoc](http://miasm.re/miasm_pdoc)

Obtaining Miasm
===============
Expand Down
1,878 changes: 1,878 additions & 0 deletions doc/ir/lift.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 9053207

Please sign in to comment.