1926 Commits

Author SHA1 Message Date
pancake
0e04dbfe93 Fix #4954 - Fix crash in i8051 esil->reil 2016-05-21 16:27:11 +02:00
hummypkg
9043c1faeb Allow local variable detection for mips (#4960) 2016-05-21 12:24:42 +02:00
pancake
38d6822ebe Use negative arithmetic instead of ossitive overflow on arm64 displacement substract ESIL 2016-05-20 18:19:18 +02:00
Hamish Coleman
608c3b587f arcompact: Implement most carry codes (#4949) 2016-05-19 10:33:00 +02:00
Riccardo Schirone
8727840e90 anal/fcn: use getter/setter to access the size of a RAnalFunction
This is one of the first steps to improve analysis. This way we'll have
one single place to change if we want to change the meaning of the
"size" field. (size -> realsize)
2016-05-19 01:50:50 +02:00
hummypkg
a6bc0b39f5 Fix pseudo-code fro mult(u) - add mfhi, mflo, mul; implement ESIL mul op (#4943) 2016-05-18 15:58:04 +02:00
Hamish Coleman
afed79c033 Minor arc + arcompact cleanups and whitespace, ending with anal_arc fully indented (#4937) 2016-05-18 10:02:35 +02:00
aaSSfxxx
4362f17b1f Compute RIP-relative calls 2016-05-17 17:00:32 +02:00
pancake
f2ff8de7b9 Initialize proper fields of the RAnalOp.avr struct 2016-05-17 16:39:05 +02:00
Ahmed Mohamed Abd El-MAwgood
cd3ce9ab4e Fixing overflow in the string array 2016-05-17 14:44:52 +02:00
pancake
2e06158c71 Handle -- in rarun2 2016-05-17 10:36:33 +02:00
Hamish Coleman
c80611e9bf Update anal_arc to more closely match the styleguide. (#4916)
Use the sys/indent.sh script and address most of the changes it suggests

* whitespace fixes
* change all the sex_nn stub functions to macros
2016-05-17 10:26:36 +02:00
@bezjaje
a254108be0 MIPS esil small fixes, this will unbreak esil/mips regressions (#4917)
+ fixed "sub" operands order
+ fixed "add" typo (was implemented using "-" instead of "+")
2016-05-17 10:25:38 +02:00
pancake
34cd4f62b1 Fix pzF tests 2016-05-17 01:05:32 +02:00
pancake
2db1f73583 Fix #4836 - bb0 size issue 2016-05-16 23:07:29 +02:00
Hamish Coleman
5f40ac8ad6 Implement jump delay analysis (#4901)
* Add archinfo details
* Add register profile details
* Show jump delay analysis - allows writing regression tests

* Fix decoded size of four-byte NOP
* Fix bugs found writing regresion tests:
** Jumps are not relative
** cut-and-paste error with some calls

* mark an illegal load destination
* Remove special case for the ignored aa field in load
* Factor mode_zz handing into its own function
2016-05-16 21:48:52 +02:00
Sushant Dinesh
8ffca4d175 Adds ESIL for x86: CMOVcc instructions (#4884) 2016-05-16 04:07:23 +02:00
pancake
c627fb3bec Add colors in afll and fix max stack 2016-05-16 03:46:23 +02:00
pancake
23dcb486ea Fix some minor memory leaks, Properly make check_fcn public 2016-05-15 02:43:10 +02:00
pancake
942e3e0da5 Fix #4862 - Fix all pending covs 2016-05-15 02:04:40 +02:00
Riccardo Schirone
c169073c74 Fix #4080 : remove assumption that functions are contiguous
* anal/p/anal_java: remove function that does nothing

* anal/fcn: workaround for java analysis
2016-05-14 16:37:24 +02:00
pancake
02eb896897 Handle data refs in dalvik analysis 2016-05-14 10:40:03 +02:00
Damien Zammit
79728e837d Fix #4879 - warnings in esil 2016-05-14 10:33:09 +02:00
Riccardo Schirone
d9e3a290c1 libr: fix compilation warnings
libr/util/graph: add some comments to the API
2016-05-13 09:57:55 +02:00
Hamish Coleman
a876fa504e Arcompact coverity changes
* fixed invalid compare

* Attempt to fix coverity's detection of 'Suspicious implicit sign extension'
2016-05-12 04:32:15 +02:00
Jaime Peñalba
5924510994 ESIL gb fixes
* ESIL gb: fix for loading or adding from sp+offset

* ESIL gb: fix for stores to [hl] not using proper source register
2016-05-12 04:31:09 +02:00
pancake
3d89f2cc21 Add RAnal.Stack.RESET and handle it for arm64 2016-05-11 12:59:32 +02:00
Rene Laemmert
47fd9f7169 Added pushf* and popf* for x86 esil 2016-05-11 11:38:06 +02:00
pancake
1afb3b1e62 Handle SVC in anal.arm64 2016-05-11 03:06:42 +02:00
Hamish Coleman
302b9a559c Arcompact whitespace (#4839)
* Minor whitespace cleanups
* Follow styleguide for switch statement indenting
2016-05-10 02:40:49 +02:00
pancake
919424f5ed Several bug fixes for the arm32 esil emulation and static analysis 2016-05-09 23:08:25 +02:00
pancake
7c0dd4ef23 Fix indentation issues in anal.arc 2016-05-09 19:21:34 +02:00
Hamish Coleman
6091894ac8 Improved Arcompact anal module
The rewrite the ARCompact analyser code started because I noticed that the
older code was really not decoding the binary I was working on properly.

Specific things that I noticed were:
* Scrolling backwards scrolled forwards
* Jump targets were shown from apparently random opcodes
* Analysis really didnt find anything
* The anal code was essentially hardcoded for big endian targets (and mine
  was not, so instruction decoding was largely misfiring)

I read the ARCompactISA Programmers Reference guide and implemented decoding
for most instructions.  Specifically, I ensured that all the instructions that
had limm data were decoded with the correct length and that all the jump or
branch targets were correctly calculated.

As I have not previously looked at anal plugins before, I expect I have
messed up a bunch of the assumptions that the anal system makes.

Among the issues that I still have is that the analysis will find
instructions (and thus xrefs, functions, etc) in "unaligned" locations.
This might just be an artifact of the fact that not all my data is marked
as data, but it feels like there might be something I have missed.

Still remaining TODO are most of the 32bit general purpose instructions.

* BUG: missing break in switch
* Implement missing general instructions in ARCompact anal
* Only set op->fail on jump instructions for ARCompact
* ARCompact: analyse calculated pointers and immediate values in load/store/move instructions
* Address styleguide issues
* Remove unnecessary brackets
* Use standard endian swapping functions
* The maximum instruction length is only 8 bytes, adjust the de-swizzler appropriately
* BUG: I'm an idiot, fix the array size
* Move the opcode 4 General Operations to its own function for clarity
* Bring back the quick and dirty debug output by consolidating all decoded fields into a structure
* Factor out common code used in genops jumps and calls
* Remove some magic numbers by using defines for the registers
* Missed a field when converting to the struct
* Record the size of the opcode
2016-05-09 19:05:11 +02:00
Ahmed Mohamed Abd El-MAwgood
d4e4bcf6f4 off by one calculating string start (#4828) 2016-05-09 17:38:11 +02:00
Ahmed Mohamed Abd El-MAwgood
00faea8023 FIX #4782: adding afCa to r_core_anal_all (#4805) 2016-05-09 16:04:54 +02:00
Sushant Dinesh
e31c778ccd Fixes MOVSD (#4811) 2016-05-09 15:27:18 +02:00
Damien Zammit
5e1ad580db build: fix warnings 2016-05-08 12:21:11 +02:00
Damien Zammit
5995ef75e7 x86.cs: Fix POPA{LW} esil 2016-05-08 00:10:06 +02:00
Damien Zammit
964d12b392 ESIL: add floating point instructions (#4794) 2016-05-07 12:32:06 +02:00
Damien Zammit
632dccc217 Remove LIL_ENDIAN macro and configure option
TODO: Remove other endian cruft from:
- hashing algs
- judy
- squashfs
- grub
- tms320

Signed-off-by: Damien Zammit <damien@zamaudio.com>
2016-05-06 10:21:55 +02:00
Ahmed Mohamed Abd El-MAwgood
f6c24f426f Adding support for handling sp registers at parsing 2016-05-05 15:48:00 +02:00
Ahmed Mohamed Abd El-MAwgood
d08de89727 Add support for esp register in afCa afCa 2016-05-04 22:20:58 +02:00
pancake
adb70234ff Fixes for asm.fcnlines and endian issues for esil + disasm 2016-05-04 17:13:44 +02:00
Damien Zammit
af0a865d9f WIP - Totally remove host endianness dependence
- Adds endian aware functions
- Removes references to host endian
- Uses binary detected endianness else tries LE and restricts by RAsmPlugin
- Fixes gdb debugger endianness when debugging BE qemu gdbserver

Signed-off-by: Damien Zammit <damien@zamaudio.com>
2016-05-04 23:42:17 +10:00
Jeffrey Crowell
9bdbe5c472 fix mips regprofile (s8/s9 arent real, t8/t9 are):
closes #4772
2016-05-03 23:49:38 -04:00
Fabian Yamaguchi
122e1d55a8 Fix #4726 - Make sure that the destination register is not reported as "read" in an ESIL eq operation 2016-05-03 19:42:00 +02:00
Ahmed Mohamed Abd El-MAwgood
eb185abff4 adding intital support to --omit-frame-pointer FIX #3735 (#4742)
* adding intital support to --omit-frame-pointer FIX #3735

* makeing afCa arch independent to some extent
2016-05-01 14:48:04 +02:00
Rakholiya Jenish
9991f05e85 fix POP and POPF (#4733) 2016-04-28 19:02:51 +02:00
Rakholiya Jenish
e9efad51e4 fix XCHG output while memory access (#4732) 2016-04-28 18:59:45 +02:00
rene
f8c7c8a95b fixes pushal and adds popal for x86 2016-04-28 17:20:42 +02:00