Commit Graph

120 Commits

Author SHA1 Message Date
Joe Hendrix
6391a87db1
Merge branch 'master' of github.com:GaloisInc/macaw 2018-06-12 16:20:55 -07:00
Daniel Wagner
f4d4e381b7 have a way to align potentially misaligned IPs 2018-06-11 10:30:32 -04:00
Joe Hendrix
494f6c176d
Updates to Macaw. 2018-06-06 11:48:45 -07:00
Daniel Wagner
d0566fe03b lay some groundwork for jump table detection on PPC 2018-05-30 15:50:16 -04:00
Jason Dagit
d0d30f038d Merge branch 'master' of github.com:GaloisInc/macaw 2018-05-29 18:36:35 -07:00
Jason Dagit
e9756ed6a9 Semantics: fix repnz termination condition 2018-05-29 18:36:26 -07:00
Daniel Wagner
588e92cc01 add a few jump target formats 2018-04-24 17:05:17 -04:00
Joe Hendrix
000c2f900e
Move macaw stack.yaml to root for similiarity with other Galois packages. 2018-04-24 09:05:36 -07:00
Joe Hendrix
6267122136
Add packages to stack.yaml 2018-04-24 08:25:13 -07:00
Joe Hendrix
9259a7e1f3
Update stack to reflect actual ghc version. 2018-04-23 11:57:24 -07:00
Joe Hendrix
4c290c2a33
Update to build with ghc 8.2.1 2018-04-23 11:56:01 -07:00
Joe Hendrix
097edda1ef
Relocation support; various cleanups.
This patch adds initial support for relocations in Macaw code
discovery, and adds other refactoring.

* It introduces a SymbolValue constructor to represent references to
  symbols within Macaw.
* The various cases for x86 mov are made explicit after the flexdis refactor
  broke the previous code.  We should now support segment register movs and
  give better error messages when seeing mov with control or debug registers.
* The generic exception operation is replaced with Hlt and UD2 terminal
  x86-specific statements.
* CodeAddrReason is split into FunctionExploreReason and BlockExploreReason to
  clarify whether a function or block was discovered.
* The Macaw pretty printer is changed to use write_mem in place of pointer syntax.
* Various other refactoring is made to clarify code.
2018-04-23 11:24:21 -07:00
Joe Hendrix
0b8e95b0b0
Merge branch 'master' of github.com:GaloisInc/macaw 2018-04-17 16:02:28 -07:00
Tristan Ravitch
43688edef9 Fix a haddock parse error
Postfix haddock comments on GADT constructors (or constructor arguments) are not
yet supported.
2018-04-10 09:51:10 -07:00
Joe Hendrix
81e9c168af
Update submodules 2018-04-05 09:10:39 -07:00
Joe Hendrix
2feebceddc
Refactor relocation support; support .rel and some object symbols. 2018-04-05 09:06:12 -07:00
Tristan Ravitch
4bd307e41d x86: Have the x86 backend emit the ArchState metadata statment
This statement will be used for architecture-independent analysis of macaw
(or possibly crucible) values in machine registers.
2018-03-30 10:35:47 -07:00
Joe Hendrix
a258cf7b2b
Update submodule 2018-03-29 17:43:33 -07:00
Joe Hendrix
9f49b7327a
Bump elf-edit 2018-03-29 16:40:26 -07:00
Joe Hendrix
265f61e206
Merge branch 'master' of github.com:GaloisInc/macaw 2018-03-29 16:30:29 -07:00
Joe Hendrix
16d975d81f
Update submodules 2018-03-29 15:34:57 -07:00
Joe Hendrix
007405db1d
Improve robustness of elf loader, and start trying to parse relocations in objects. 2018-03-29 15:21:31 -07:00
Tristan Ravitch
6152912518 x86: Improve the testing harness
The tests now check to make sure that no blocks end in a classification failure.
This exposed a problem where some simple cases (where the return address was
read from the stack) where we were getting classification failures.

It turns out that the problem was due to the code being PIE and loaded at a very
low address.  This made a number of small constants look like code pointers,
which threw off the abstract interpretation.

The fix is to load the test binaries at a large offset (0x400000 or so) to
reduce the likelihood of overlap.
2018-03-28 16:54:35 -07:00
Iavor Diatchki
777fad441d Make it build with the Haskell2010 option 2018-03-27 11:01:18 -07:00
Iavor Diatchki
37c951722d Merge branch 'master' of github.com:GaloisInc/macaw 2018-03-27 10:51:53 -07:00
Kevin Quick
789841f9fe
[x86] Constent use of language specification in cabal file.
Also updates the minimum cabal version.  This eliminates warnings
regarding this cabal file.
2018-03-27 10:41:18 -07:00
Kevin Quick
377c3d1a2b
Use architecture-specific identifyReturn in Discovery process.
Instead of inline analysis of whether the instruction pointer has been
updated to contain the ReturnAddr symbolic value, defer the
determination of the call return to the (previously defined but
unused) architecture-specific handling.  This allows architectures
like ARM that perform modifications on the values loaded to the
instruction pointer (e.g. clearing lower bits) to provide their own
recognition of a return operation.

Also modifies the signature of identifyReturn to return a Sequence of
statements to match the identifyCall type signature.

Replaces the previously unused identifyX86Return with the inline
detection of IP == ReturnAddr.
2018-03-27 10:35:55 -07:00
Iavor Diatchki
f54f0a13ba Add some support for unpack; no symbolic implementation yet. 2018-03-26 18:51:19 -07:00
Iavor Diatchki
cb9cef128e Implement vpinsrq and structore for the rest of the vector insert instruction 2018-03-26 13:17:03 -07:00
Joe Hendrix
ceefa7ae75
Update memory to use explicit BSS region and disable includeBSS option. 2018-03-23 16:26:07 -07:00
Iavor Diatchki
9ffaf478bf Semantics for vmovq 2018-03-23 16:15:43 -07:00
Aaron Tomb
e33ecf3e84 Fix build with GHC 8.4.1 2018-03-23 14:09:28 -07:00
Iavor Diatchki
d3d5f39ebb Change YMM patterns to just use Word8 directly.
Simpler, not clear that the additional abstraction was useful.
2018-03-21 16:14:59 -07:00
Iavor Diatchki
6875f84971 Add implementation for vpsllq 2018-03-15 09:49:03 -07:00
Iavor Diatchki
e967573eb0 Set false to False, not True :) 2018-03-14 15:22:19 -07:00
Iavor Diatchki
9c7070f8e6 Haddock comments fixes, thanks to Brian 2018-03-09 09:51:55 -08:00
Iavor Diatchki
82e1dc0ebc Add shift right for vectors. 2018-03-08 11:20:41 -08:00
Joe Hendrix
14ab6352f5
Export elfAddrWidth 2018-02-28 09:26:10 -08:00
Joe Hendrix
a167997fc2
Merge branch 'master' of github.com:GaloisInc/macaw 2018-02-27 17:09:57 -08:00
Iavor Diatchki
2e21856afe Merge remote-tracking branch 'origin/master' into mem-model
# Conflicts:
#	base/src/Data/Macaw/Memory/ElfLoader.hs
2018-02-27 16:36:08 -08:00
Joe Hendrix
cf3949b170
Fix Elf X86 tests. 2018-02-27 07:37:06 -08:00
Joe Hendrix
83fa71b210
Update elf submodule 2018-02-26 14:53:08 -08:00
Iavor Diatchki
22fbaf9d4f Change the types of the patterns, so that matching allows us to learn the type 2018-02-15 17:03:30 -08:00
Joe Hendrix
e3a1b35307
Fix macaw-x86 tests. 2018-01-29 23:19:50 -08:00
Joe Hendrix
5f219026ec
Update submodules 2018-01-29 20:14:42 -08:00
Joe Hendrix
7e144a51f4
Memory interface renamings. 2018-01-29 11:05:19 -08:00
Joe Hendrix
e1e558239e
Minor cleanups. 2018-01-29 01:06:59 -08:00
Iavor Diatchki
5959bfc6f0 Merge branch 'master' of github.com:GaloisInc/macaw 2018-01-26 14:43:50 -08:00
Daniel Wagner
c6dcd09738 regression tests for splitting blocks mid-instruction 2018-01-26 14:09:01 -08:00
Daniel Wagner
dfa21bc40a modify tail-call test
Previously, we asked macaw to discover three functions in the tail-call
test. One of those only ever appeared as a tail call from another
function; currently macaw isn't smart enough to discover that as its own
function (and that's probably okay for now).
2018-01-26 14:09:01 -08:00