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

Test disassembly of .text sections of sample binaries #12

Merged
merged 2 commits into from
May 18, 2020

Conversation

langston-barrett
Copy link
Contributor

@langston-barrett langston-barrett commented Feb 27, 2020

Some tests for disassembly of some small binaries. Having a test suite like this is nice because

  1. It will benefit from any work done upstream on sample-binaries, which can benefit multiple projects across Galois
  2. It is really easy to compile a hairy binary, toss it into tests/data, increment the expected number of tests, and test that Flexdis86 can disassemble it.

@travitch
Copy link
Contributor

Similar tests for the other disassemblers are based on this code: https://github.com/travitch/dismantle/blob/master/dismantle-tablegen/src/Dismantle/Testing.hs. It uses objdump as an oracle and makes sure that we can roundtrip every instruction that objdump knows about.

@langston-barrett langston-barrett force-pushed the lb/test-bins branch 2 times, most recently from f31647c to f0afc20 Compare February 27, 2020 22:56
@langston-barrett
Copy link
Contributor Author

@kquick suggested that we use elf-edit instead of creating the .bin files with objcopy, which seems much better.

@langston-barrett langston-barrett changed the title Test disassembly of .text sections of sample binaries WIP: Test disassembly of .text sections of sample binaries Feb 27, 2020
@langston-barrett langston-barrett changed the title WIP: Test disassembly of .text sections of sample binaries Test disassembly of .text sections of sample binaries Feb 27, 2020
@langston-barrett
Copy link
Contributor Author

@kquick I think we'll need an update to the Hydra configuration for this branch to work. If you point me in the right direction, I'm happy to give it a shot.

@langston-barrett
Copy link
Contributor Author

NTS: Kevin says that for this to move forward, we should allow an environment variable to specify the locations of the additional test binaries.

@langston-barrett
Copy link
Contributor Author

I've updated this with the environment variable configuration, and there's a WIP PR to the Fryingpan config files that will let us test it: https://gitlab-int.galois.com/binary-analysis/nix/-/merge_requests/5

@langston-barrett
Copy link
Contributor Author

We've merged the configuration changes, so by Monday we should have green checks from Fryingpan. Thanks to @kquick for helping me get Fryingpan configured!

@langston-barrett
Copy link
Contributor Author

Build is passing on S2N, Kyber, and saw-script, failing on SFE and Macaw, seemingly due to unrelated goings-on in Renovate-x86:


src/Renovate/Arch/X86_64/ISA.hs:572:27: error:
    • Type constructor ‘R.InstructionArchReprKind’ cannot be used here
        (Perhaps you intended to use TypeInType)
    • In the kind ‘R.InstructionArchReprKind X86.X86_64’
      In the type signature:
        absToRip :: forall (tp :: R.InstructionArchReprKind X86.X86_64).
                    MM.Memory 64
                    -> R.ConcreteAddress X86.X86_64
                       -> Instruction tp TargetAddress
                          -> R.ConcreteAddress X86.X86_64 -> D.AddrRef -> Maybe D.AddrRef
    |
572 | absToRip :: forall (tp :: R.InstructionArchReprKind X86.X86_64)

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.

3 participants