diff options
| author | Camille Mougey <camille.mougey@cea.fr> | 2015-01-18 18:44:44 +0100 |
|---|---|---|
| committer | Camille Mougey <camille.mougey@cea.fr> | 2015-01-23 17:24:43 +0100 |
| commit | 9206458e0f4b815e4af68f8978d96d14632a087f (patch) | |
| tree | 49482f48f187f558493b82bee6fd904912b52f3f /example/disasm/function.py | |
| parent | 663b49b712b4309d44e2ae77e37f26861c4906b7 (diff) | |
| download | miasm-9206458e0f4b815e4af68f8978d96d14632a087f.tar.gz miasm-9206458e0f4b815e4af68f8978d96d14632a087f.zip | |
Example: Move disasm's examples to a `disasm` directory
Diffstat (limited to 'example/disasm/function.py')
| -rw-r--r-- | example/disasm/function.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/example/disasm/function.py b/example/disasm/function.py new file mode 100644 index 00000000..0d443c26 --- /dev/null +++ b/example/disasm/function.py @@ -0,0 +1,18 @@ +from miasm2.arch.x86.disasm import dis_x86_32 +from miasm2.core.asmbloc import bloc2graph + +# MOV EAX, 0x1337BEEF +# MOV ECX, 0x4 +# loop: +# ROL EAX, 0x8 +# LOOP loop +# RET +shellcode = '\xb8\xef\xbe7\x13\xb9\x04\x00\x00\x00\xc1\xc0\x08\xe2\xfb\xc3' +mdis = dis_x86_32(shellcode) +blocs = mdis.dis_multibloc(0) + +for bloc in blocs: + print bloc + +graph = bloc2graph(blocs) +open('graph.txt', 'w').write(graph) |