Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ida symbol exec #52

Merged
merged 7 commits into from Feb 10, 2015

Conversation

Projects
None yet
4 participants
@commial
Copy link
Member

commial commented Feb 9, 2015

This PR add a plug-in example for IDA, based on Miasm symbolic execution engine. It also features the VarExpander possibility.

For instance, on samples/sc_connect_back.bin, one selects the targeted area.
select

Then, by calling symbolic_exec() or pressing F3, the new view Symbolic Execution ... is created.
symbolexec

If a line is too complicated, one can expand it by pressing E or Right click > Expand.
varexpanded

The common code between IDA examples has been moved to samples/ida/utils.py.

@p-l-

This comment has been minimized.

Copy link
Member

p-l- commented Feb 9, 2015

Really nice work!

@aguinet

This comment has been minimized.

Copy link
Contributor

aguinet commented Feb 9, 2015

yep nice one :) !

@commial

This comment has been minimized.

Copy link
Member Author

commial commented Feb 9, 2015

Thanks you !
Actually, it's just a basic binding with already available features.

I've add the possibility to get back an equivalent Miasm2 expression in its Python form.

For instance, by pressing P or Right click > Get in Python on nf:
translateform

That is to say:

>>> expr = ExprAff(ExprId('nf', size=1), ExprSlice(ExprOp('+', ExprId('EDX_init', size=32), ExprMem(ExprOp('+', ExprMem(ExprId('ESP_init', size=32), size=32), ExprInt_fromsize(32, 0x24)), size=32)), 31, 32))
>>> print expr
nf = (EDX_init+@32[(@32[ESP_init]+0x24)])[31:32]
@commial

This comment has been minimized.

Copy link
Member Author

commial commented Feb 9, 2015

There is no reason to limit the translation to Miasmtranslator.

Add a ComboBox to choose the translator (T or Right click > Translator).
multi

@commial

This comment has been minimized.

Copy link
Member Author

commial commented Feb 10, 2015

An infinite loop was reached in a corner case of Variable Identifier (reported by @serpilliere).

One of the commit also add the prefix feature, which result in:

of_v0 = @32[@32[ESP_init] + 0x24]
of_v1 = EDX_init
of = ((of_v1 ^ of_v0 ^ 0xFFFFFFFF) & (of_v0 ^ (of_v1 + of_v0)))[31:32]
cf_v0 = EDX_init
cf_v1 = @32[@32[ESP_init] + 0x24]
cf_v2 = cf_v0 + cf_v1
cf = (cf_v0 ^ cf_v1 ^ ((cf_v0 ^ cf_v1 ^ 0xFFFFFFFF) & (cf_v1 ^ cf_v2)) ^ cf_v2)[31:32]

That way, the IDA highlighting of variables can be used in a clever way.

@serpilliere

This comment has been minimized.

Copy link
Contributor

serpilliere commented Feb 10, 2015

The module needs to be imported twice due to a strange bug between IDA and Miasm.

serpilliere added a commit that referenced this pull request Feb 10, 2015

@serpilliere serpilliere merged commit 3884615 into cea-sec:master Feb 10, 2015

@commial commial deleted the commial:ida-symbol_exec branch Feb 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.