abines / androguard

Automatically exported from code.google.com/p/androguard
Apache License 2.0
0 stars 0 forks source link

Support in-place operations #95

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The decompiler could be improved for inplace operations, in particular:

"v0 = (v0 + 1)" -> "++v0"
"v0 = (v0 | (v1 * v3))" -> "v0 |= (v1 * v3)"

The attached patches accomplish this, along with some general cleanups.

Original issue reported on code.google.com by hitchmanr on 30 Dec 2012 at 1:52

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by anthony....@gmail.com on 30 Dec 2012 at 1:53

GoogleCodeExporter commented 8 years ago
I think the support of inplace operations is the task of the writer (or pretty 
printer if you like), not that of the IR form of the decompiler, so your patch 
has been merged with that in mind.

If you think the IR should have an 'inplace' instruction I'd be happy to hear 
why (and support it eventually).

Original comment by Lir...@gmail.com on 9 Jan 2013 at 7:30

GoogleCodeExporter commented 8 years ago
Neat. 

For the instruction, I was looking at detecting for loops, where a simple 
heuristic involves a loop with only one backedge preceded by an inplace 
operation. 

Original comment by hitchmanr on 9 Jan 2013 at 8:10