Commit Graph

14 Commits

Author SHA1 Message Date
Tristan Ravitch
716092eef1 ppc: Improve the test suite
Now test to ensure that no blocks end in a classification failure (or a
disassembly failure).  Before, many blocks were not classified, which causes
problems downstream.  This required some changes in macaw core in two places:

1. The simplifier needed some additional rules to remove some redundant
   constructions that threw off the abstract interpretation of values.  This was
   particularly an issue while reading return values off of the stack in
   PowerPC.
2. Extending the abstract interpretation to be able to handle more operations (shiftl)
2018-03-28 16:59:12 -07:00
Tristan Ravitch
46333f1a09 Submodule updates 2018-01-22 10:26:20 -08:00
Tristan Ravitch
d49dbc679c [ppc] Make the PPC ELF helpers easier to use
The TOC parser now doesn't require a Memory object, making it easier to actually
instantiate this in derived tools (where the TOC parser needs to be used before
a memory is available).  To do this, we use MemAddr as the base type for the TOC
instead of MemSegmentOff
2017-11-21 14:10:47 -08:00
Tristan Ravitch
dbbb0bd947 Add TOC entries to the macaw list of entry points in the test harness
This code now pulls all of the function addresses from the TOC as entry points
for the code discovery search.  This lets us trivially find code reachable via
indirect calls, as the function pointer discovery heuristic doesn't seem to be
well-suited to PowerPC.  I'd like to push on that, but it seems like a good
start for now.
2017-11-16 10:16:22 -05:00
Tristan Ravitch
2092a0fd01 Add a (currently failing) test for indirect call handling
The code pointer discovery in macaw can't handle this case because we never
write the code pointers into memory - we only read them.  We really need a way
to tell macaw about code pointers.

The easy workaround is to pull all of the function entry points out of the TOC
and just seed the macaw search with them, but it would be nice to be able to
identify them from first principles.
2017-11-14 19:00:01 -08:00
Tristan Ravitch
d5d1d87fd5 Split some shared helpers out of a test module 2017-11-09 10:43:41 -08:00
Tristan Ravitch
e307c9a82a Add a comment in the test suite 2017-11-08 15:46:40 -08:00
Tristan Ravitch
71a432ed18 Improve the test suite
Don't just ensure that found blocks are expected: also ensure that all expected
blocks are found.
2017-11-07 20:50:33 -08:00
Tristan Ravitch
c3d0ede125 Import alignment 2017-11-07 20:29:41 -08:00
Tristan Ravitch
a648a4c50b Improve the formatting for test failures
Now print addresses as hex values
2017-11-07 20:22:49 -08:00
Tristan Ravitch
5e47bf6ce9 Improve the PPC test suite
It now checks to ensure that expected blocks are actually the expected number of bytes
2017-11-05 20:51:57 -08:00
Ben Selfridge
f3f07ff099 Adding rewriting to macaw-ppc translation 2017-10-27 21:08:47 -07:00
Ben Selfridge
16839e30c1 Test runs, fails at identifyCall 2017-10-27 14:29:04 -07:00
Ben Selfridge
bc2dc76be6 Working on findElfEntryPoint, which does a double-lookup for PowerPC. 2017-10-26 18:38:47 -07:00