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

Fix packed x86 #836

Merged
merged 8 commits into from
May 23, 2018
Merged

Fix packed x86 #836

merged 8 commits into from
May 23, 2018

Conversation

gitoleg
Copy link
Contributor

@gitoleg gitoleg commented May 22, 2018

This PR brings a lot of changes in x86 packed instructions. The main goal is to make a bil code closer to the BIL normal form, i.e. to reduce an amount of an additional code injected during the normalization process as well a time spent for lifting.
As a result, bap works better with files that previously took approximately infinite time.

Affected instructions are:

  • different cases of pcmp, pmin, pmax;
  • instructions like psrl, psll, pavg, xorp;
  • instructions that compare strings: pcmpistri

Just few numbers to compare:
it was:

$: echo "\x66\x0f\xda\xc8" | bap-mc --show-bil | wc -l
327678
$: echo "\x66\x41\x0f\x3a\x63\x08\x4a" | bap-mc --show-bil | wc -l
Fatal error: out of memory.

it is:

$:echo "\x66\x0f\xda\xc8" | bap-mc --show-bil | wc -l
132
$: echo "\x66\x41\x0f\x3a\x63\x08\x4a" | bap-mc --show-bil | wc -l
139

Also, This PR adds few instructions to x86-lifter:
pmaxsb, pmaxsw, pmaxuw, pmaxud, pmaxsd and tests for them.

Copy link
Member

@ivg ivg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 great job, thanks!


*)

open Core_kernel.Std
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to use open Core_kernel in the new code, the Std module is deprecated

@ivg ivg merged commit d8806c9 into BinaryAnalysisPlatform:master May 23, 2018
@gitoleg gitoleg deleted the fix-packed-x86 branch October 10, 2018 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants