radare/radare2 — pull request #942 by andymc73 (2014-05-18 11:29:54+00:00)
Title: Fixes for MIPS analyser not finding function references correctly, in particular when a file address was set.

Hi, I think managed to fix those other problems I was talking about.

There were 2:

(1) The `addr` was not being set into the mips opcode, resulting in `UNK` xrefs from jumps

(2) The mips analyser would not recognise when a base address was set and would make references relative to 0x00000000 instead of where they should be. This problem arises because MIPS immediate jumps only have 2^28 range. For the moment I have assumed that we can take the upper four bits of `addr` and use those to calculate the jump destination, although it there may be edge cases I haven't encountered where this is undesirable, in the future this may need to be revisited using a `cfg.` variable or something.

I have also added regression tests for both the above.

I also took the liberty of making a note about the regression test suite in the `DEVELOPERS` file and fixing a couple of spelling mistakes, I hope you don't mind...

Wow, after fixing these couple of issues, I was able to use radare2 to understand a dump in about a quarter of the time I was doing it by hand. Thanks!