cea-sec/miasm — pull request #18 by commial (2014-12-09 17:09:26+00:00)
Title: Feature vars ident

Introduce `Variables_Identifier` class, with a non-regression test.

Variables_Identifier provides a way to identify redundant pattern (ie. variables) in an expression, replaces them and obtains the variables list in a dependencies compliant order.

For instance:
```
(({EAX[0:16],0,16, (EAX+EBX)[16:32],16,32}+(- {EAX[0:16],0,16, (EAX+EBX)[16:32],16,32}))+{(((@16[((EAX+EBX)^EAX)]|EAX[0:16])|@16[((EAX+EBX)^EAX)])|0x100),0,16, 0x100,16,32})
```
Output:
```
v5 = 0x100
v0 = EAX
v3 = v0[0:16]
v2 = (v0+EBX)
v4 = @16[(v2^v0)]
v1 = {v3,0,16, v2[16:32],16,32}
Final: ((v1+(- v1))+{(((v4|v3)|v4)|v5),0,16, v5,16,32})
```