Commit Graph

10547 Commits

Author SHA1 Message Date
pancake
a3ce21645e Fix infinite loop in afm 2016-08-24 16:47:41 +02:00
pancake
e3c8b637f6 Update help for 'af' and handle invalid af subcommands 2016-08-24 16:45:55 +02:00
Rakholiya Jenish
a461d53397 Implement stack based splitting of args
* stack based splitting of args
* fix r_str_rchr
2016-08-24 16:33:45 +02:00
Sebastien Marie
4c1b1b7481 make r_sys_truncate() obey to sandbox mode (#5594)
the diff corrects a logic error in `__WINDOWS__ && !__CYGWIN__` case, as
r_sandbox_open() will return `-1` on error.

and it makes a sandbox check before calling truncate(2) syscall.
2016-08-24 16:30:43 +02:00
Sebastien Marie
2e0434d211 spelling namepsace->namespace (#5596) 2016-08-24 16:30:23 +02:00
Álvaro Felipe Melchor
34c6e3e1a1 Fix #5543 - oob write in Sr command (#5598) 2016-08-24 00:23:14 +02:00
Wladimir J. van der Laan
da564f28ee Remove unused field addr from SymName 2016-08-24 00:01:40 +02:00
Wladimir J. van der Laan
fb196362e1 Handle NULL strings in r_bin_demangle (#5587) 2016-08-23 13:11:30 +02:00
Ahmed Mohamed Abd El-MAwgood
4a3c341ade Fixing more bugs in type matching (#5586)
* Fixing more bugs in type matching
* Adding functionality to restore ESIL env var state before aftm was issued
2016-08-23 13:10:15 +02:00
pancake
4f1c50f7f5 Code cleanup and reindent in visual/core 2016-08-23 03:02:23 +02:00
pancake
0b86c2ac55 Fix memleaks and r2pipe annoyance with izz 2016-08-23 01:39:16 +02:00
pancake
2f73865c5c Fix #5572 - show disasm in Vx and also fix build 2016-08-22 18:44:52 +02:00
pancake
fd0810fbf1 Fix memleaks in av, lot of anal code cleanup and do not always allocate bb->diff 2016-08-22 18:32:18 +02:00
Wladimir J. van der Laan
b68c345948 Add stackptr to aOj output (#5582)
It's 10:00 PM, do you know where your stack pointers are?
2016-08-22 18:07:15 +02:00
Joshua J. Drake
b526aded9c Don't restore breakpoints on STEP recoil (#5583)
As the comment says, we need to pretend to satisfy the caller. For some reason
I also restored the breakpoints here. I cannot for the life of me figure out
why since it should be ok with in all cases.

For swstep=false, the step will stop right away (regardless of any breakpoints)
and thus need to remove breakpoints anyway.

For swstep=true, a breakpoint is created on the next instruction and would stop
too and thus need to remove breakpoints anyway.

So yeah, don't do this. Thanks for the report skuater!
2016-08-22 17:13:13 +02:00
pancake
9a9e9326a5 Fix two null derefs in anal.var code 2016-08-22 14:52:27 +02:00
zlowram
97103102f4 Fixed warnings (#5579) 2016-08-22 13:26:35 +02:00
Alexandru Caciulescu
4bf045b5da Coverity patch + refactor (#5574) 2016-08-22 12:39:21 +02:00
Jaguar83
eb50b7edd1 Patch 1 (#5544)
* Bad Trap on MIPS ADDI ESIL
added $$ to TRAP as per ES_TRAP_DS

* Fixed ADDI logic

Based on QEMU, overflow occurs when the operands have the same sign, but the sign of the result is different.
2016-08-22 12:36:30 +02:00
pancake
59620e1364 Fixes in pf indent output. More to come 2016-08-22 12:33:42 +02:00
Rakholiya Jenish
18cd2f5ec5 anon pf struct and add n/N
add anon nested struct help and fix tests

fix tests

minor changes

add support for unsigned and signed char, short, int and long long

add help

cleanup

minor fix
2016-08-22 11:25:52 +02:00
Ahmed Mohamed Abd El-MAwgood
29bf4e2fe2 fixing bugs with tp (#5567)
- Fixing (type matching with esil into non initialized stack)

- FIXING CIDS in anal_tp.c and var.c

  - CID 1361741
  - CID 1361734
  - CID 1361731
2016-08-22 11:22:22 +02:00
Alexandru Caciulescu
d83779445d Update depgraph.pl script usage (#5577) 2016-08-22 11:22:13 +02:00
zlowram
8a08de39ec Improvements on zignatures generation and new mataching command
- Generation of zignatures were to specific to be useful. They were
generated by getting the first 128 bytes of the functions defined,
as is. Now, it generates more generic signatures by getting the
whole function bytes and masking out all the operands.

- New z. command, that performs zignature match by function. It
works for a given offset with @ addr, so with @@ fcn* it can be
run against all detected functions of the bin.
2016-08-22 10:48:56 +02:00
pancake
1a561b62ce Drop that speedup analysis 2016-08-21 12:10:44 +02:00
pancake
0016fb6d33 Add JAYRO_03 aac improvement (disabled for now) 2016-08-21 11:50:33 +02:00
pancake
2390075946 Try the JAYRO_04 patch to speedup analysis 2016-08-21 11:39:37 +02:00
pancake
5023918793 Add hotpatching function preludes from MSVC 2016-08-21 11:31:54 +02:00
Alexandru Caciulescu
43c99e4e6a Split ROP SDB per class (#5561) 2016-08-21 10:21:44 +02:00
pancake
56844d68f3 Rollback the tinyrange optimization 2016-08-21 03:07:19 +02:00
pancake
1bdb2c9f93 Add and use tinyrange.c: get 10% speedup in analysis 2016-08-21 01:41:03 +02:00
pancake
bab8d67c5e Add @@f foreach iterator to walk all the functions 2016-08-21 00:25:03 +02:00
Rakholiya Jenish
f3085dd3e4 remove %hh usage 2016-08-19 19:58:38 -04:00
Ahmed Mohamed Abd El-MAwgood
4c60a11f7e Types docs (#5557)
* Adding types documentation

* refactoring and optimizing types databases

All based on docs

* fixing r_core_types_init

Basically we needed to try all possible 7 combinatios of file name,
I am not sure if there is a way to do that automatically.
one extra thing, since this is init subroutine we should make sure
that the db is already empty, when reloading this function
(by changing env vars), it will be reloaded thus it needs a reset first.
2016-08-19 14:31:41 -04:00
pancake
22b78d5c73 afn without arg show current function name 2016-08-19 14:15:10 +02:00
pancake
b5d1bbf333 Fix afn without argument issue 2016-08-19 14:13:57 +02:00
pancake
e0e15baa6c 2x speedup in objc mach0 parsing with memoication 2016-08-19 13:53:11 +02:00
pancake
d779aa3352 Fix debrujn format strings 2016-08-19 12:58:07 +02:00
pancake
c6d76d52b2 Fix #5562 - Only STACK_INC and RESET changes stackptr 2016-08-19 12:49:17 +02:00
Pau Oliva
3f2b2a1726 Fix endianness issues in CPS-2 decryption 2016-08-19 12:04:53 +02:00
Sebastien Marie
e0ee8cdefa update native sandboxing method for OpenBSD (#5545)
move from systrace(4) (removed in 6.0 release) to pledge(2) (available
since 5.9).
2016-08-18 15:59:36 +02:00
Mitchell Johnson
7661c3930a Add a missing MSP430 constant register instruction encoding (#5548)
* Fix a missing #1 constant-generator encoding for msp430
* Fix up some tab/space mixing
2016-08-18 15:58:38 +02:00
Pau Oliva
52ce3359a8 fix set_key return value in crypto_cps2 (#5552) 2016-08-18 14:48:31 +02:00
Ahmed Mohamed Abd El-MAwgood
8e23885816 adding option load types manually (#5550) 2016-08-18 10:52:20 +02:00
leberus
74e6fda450 Coredump support for ARM and fix-ups (#5549)
* Fixes: 5540 (now i386 will not complain in case they're missing GETREGSET)
 * Fixup: Owner set to Linux for NT_PRXFPREG
 * Fixup: Now extra section hdr is being written with the right offset
 * Fixup: Bug with multithread cfg fixed
 * Add: Now r2 is able to generate coredumps on ARM platforms
2016-08-18 10:43:08 +02:00
pancake
a877693dc7 Fix issue with silly compilers 2016-08-18 02:25:43 +02:00
pancake
b5febd2690 Add pP in Vv with afi, pds, pdc, pdr, pdf 2016-08-18 01:27:24 +02:00
pancake
38b1aedb03 Fix infinite loop in aftm 2016-08-18 01:27:11 +02:00
pancake
9021789382 Fix #5546 - Implement Vv[JK] to scroll pages of functions 2016-08-18 00:29:11 +02:00
Philip Grohe
34dea157f0 Edit stack.size description for clarity (Fix #5542)
Remove mention of anotated stack from description of stack.size configurable.  stack.size applies regardles of value of stack.anotat

Fix for issue 5541
2016-08-17 09:09:19 -04:00
Maijin
b9ae1d9dc6 Add aO Description 2016-08-17 00:51:49 -04:00
pancake
4eafce512f Remove noisy printf for mach0 2016-08-16 19:54:29 +02:00
Alexandru Caciulescu
c647c23182 Adding ArithmeticConst pattern (#5531) 2016-08-16 19:41:58 +02:00
pancake
fb7ecedf73 Add edges and ebbs info in function 2016-08-16 19:35:25 +02:00
pancake
123d1f1964 Fix android-x86 build 2016-08-16 19:27:55 +02:00
Jeffrey Crowell
57b357fb0a eprintf on pattern that is longer than we can do
closes  #5513
2016-08-16 15:43:08 +00:00
@bezjaje
1cab8b93b6 arj with flags quick fix (#5538) 2016-08-16 17:42:42 +02:00
Inndy
58a58574e1 Fix null defrefs and memory leak in var_cmd 2016-08-16 17:35:33 +02:00
pancake
0b4c00440a Remove some unused vars from the ms demangler 2016-08-16 14:46:32 +02:00
Damien Zammit
8efaec0832 Big Endian fixes, mainly for ELF (WIP) (#5535) 2016-08-16 14:22:26 +02:00
pancake
9620e0e992 Rest has_description in the right places 2016-08-16 13:54:59 +02:00
pancake
f5f923aea5 Fix all latest COVs 2016-08-16 13:39:59 +02:00
pancake
33e9766140 Fix #5248 - Do not show asm.describe if IO desc is found already 2016-08-16 13:39:56 +02:00
pancake
ed4e5afbbb Load types and cc info on asm.arch change 2016-08-16 11:59:34 +02:00
pancake
3be9aa12be Workaround for the anal op.size capstone problem 2016-08-16 11:59:27 +02:00
pancake
bf7a6fa973 Refix #5526 - Use f.** to save all function flags 2016-08-16 11:59:07 +02:00
pancake
d76dfbfd5d Fix #5533 - Honor ^C in aftm 2016-08-16 11:59:03 +02:00
pancake
796a03d8b4 Fix #5533 - Fix aftm segfault 2016-08-16 11:59:01 +02:00
pancake
273964a27c Fix two null derefs pointed out by Coverity 2016-08-16 03:26:26 +02:00
pancake
acae6fc188 Fix COV 1361613 2016-08-16 03:22:14 +02:00
SkUaTeR
83266a0a4e Add socket timeout on windows connect 2016-08-16 03:19:15 +02:00
pancake
70c9face23 Properly fix the esil regression 2016-08-16 03:17:36 +02:00
pancake
fe938ae91d Fix infinite loop issue in esil expressions with ,, 2016-08-16 02:52:37 +02:00
pancake
63ef956a75 Fix #5522 - rap:// write operation wrongly processed 2016-08-16 02:42:27 +02:00
pancake
dfebbd6252 Fix #4928 - Show string context in /z 2016-08-16 01:49:32 +02:00
pancake
026ccc7202 Add help for VV_ and VVF 2016-08-16 01:37:38 +02:00
pancake
2498a61ebe Fix #5524 - Add 'F' and '_' in graph 2016-08-16 01:32:44 +02:00
pancake
533d325cdc Speedup RCons.hud 2016-08-16 01:32:31 +02:00
pancake
fbdbd09b26 Support cfg.big_endian in pxd 2016-08-16 01:18:44 +02:00
pancake
b5e57379cd Implement pxd8 and fix warnings 2016-08-16 01:14:02 +02:00
pancake
61b7f4af37 Fix #4195 - Remove r_cons dependency from r_flags 2016-08-16 00:59:31 +02:00
dx
4b263b3475 Fix a handful of boring leaks (#5518)
Valgrinding to get exp. Testing with "r2 -Aqcq /bin/ls"

Before:

       definitely lost: 22,735 bytes in 250 blocks
       indirectly lost: 23,542 bytes in 605 blocks
         possibly lost: 2,464 bytes in 7 blocks
       still reachable: 3,876,216 bytes in 80,761 blocks

After:

       definitely lost: 25,216 bytes in 58 blocks
       indirectly lost: 24,830 bytes in 739 blocks
         possibly lost: 0 bytes in 0 blocks
       still reachable: 20,105 bytes in 34 blocks

The "goto beach" (named like that for consistency) change resulted in
freeing most of the "still reachable" stuff on quit, which also moved
stuff out of "possibly lost", so.. it looks like it's leaking more now.
Yay.
2016-08-16 00:45:33 +02:00
radare
93cb2941d3 Merge pull request #5527 from crorvick/cr/fix-backward-seek
Fix backward seek
2016-08-16 00:40:59 +02:00
Alexandru Caciulescu
bc5eff1a16 Fix false positives for LoadConst + optimize Nop pattern (#5515) 2016-08-16 00:40:17 +02:00
Chris Rorvick
9b47635f0c remove `next' param from r_core_block_read()
This was originally used to cause a seek to the next block prior to
reading such that successive calls to r_core_block_read() would progress
through memory one block at a time.  This was broken, though, by commit
452669d941 ("more cleanup in r_core_block_read") when when it used
`next' to directly calculate the offset rather than via a seek.

Only one call site remains that attempts to read the next block instead
of the current, and this probably was not even observable due to the
"hacky fix" added in commit 3bfa61946e ("Cleaner pvj, fix tinype load,
and honor 'ao N's").

The current of semantics of `next' appear to be broken and there is very
little dependence on it.  If the original behavior should be restored
anywhere, it would be much better to add a new function, or just do the
seek explicitly, rather than parameterizing r_core_block_read() on it.
2016-08-15 14:26:58 -05:00
Chris Rorvick
97cea63435 fix backwards seek
Commit 57b199789d ("Reread block after undo seek. Fixes dbg.status
issue") reads the *next* block into the buffer rather than the current.
This breaks backwards seeking as can be seen in the following example:

  $ r2 -N malloc://0x4000
  [0x00000000]> b 64
  [0x00000000]> wb 38
  [0x00000000]> s 64
  [0x00000040]> wb deadbeef
  [0x00000040]> s-32
  [0x00000020]> px
  - offset -   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF
  0x00000020  dead beef dead beef dead beef dead beef  ................
  0x00000030  dead beef dead beef dead beef dead beef  ................
  0x00000040  0000 0000 0000 0000 0000 0000 0000 0000  ................
  0x00000050  0000 0000 0000 0000 0000 0000 0000 0000  ................
  [0x00000020]> s+16
  [0x00000030]> px
  - offset -   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF
  0x00000030  3838 3838 3838 3838 3838 3838 3838 3838  8888888888888888
  0x00000040  dead beef dead beef dead beef dead beef  ................
  0x00000050  dead beef dead beef dead beef dead beef  ................
  0x00000060  dead beef dead beef dead beef dead beef  ................

The first block to a string of ASCII '8' bytes and the second to
0xdeadbeef.  We then seek backwards 32 bytes from our current 64 byte
offset but a dump at the resulting offset shows data from half way into
the second block (i.e., offset 0x60.)  Dumping again after seeking 16
bytes forward shows the expected last bit of the first block.  Clearly
the intent was to reread the current block, not the next block, after an
undo or backward seek.

NOTE: The above example will only work after applying the previous
commit as rereading the buffer when displaying the prompt hides this
bug.

Additionally, since the commit intended to reread the buffer only after
an undo seek, do not do this at all on a backward seek.
2016-08-15 14:00:39 -05:00
Pankaj Kataria
ad3034067e Added av command for listing virtual tables 2016-08-15 20:57:56 +02:00
Rakholiya Jenish
62b1e431c0 Fix pf for . and : 2016-08-15 20:55:52 +02:00
pancake
f671097ea7 Fix #5526 - Save function local flags in projects 2016-08-15 20:47:46 +02:00
Chris Rorvick
486fd32949 remove hacky fix
Commit 3bfa61946e ("Cleaner pvj, fix tinype load, and honor 'ao N's
help") added a hack to reread the current block when printing the
prompt.  This has the drawback of causing scripts loaded via the `-i'
command line option to potentially behave differently than reading the
commands via stdin.  Remove the hack and fix the bugs.
2016-08-15 13:06:07 -05:00
Ahmed Mohamed Abd El-MAwgood
213c6f29d1 Fixing some aftm bugs and null dereferences (#5521) 2016-08-15 17:34:12 +02:00
Ahmed Mohamed Abd El-MAwgood
d0fb42aa46 Fixing Invalid address at var display (#5523) 2016-08-15 17:33:27 +02:00
Ahmed Mohamed Abd El-MAwgood
12dbe30cbb Fixing coverity CIDs (#5516)
fix CID 1361617
Resource leaks (RESOURCE_LEAK)
/libr/core/tp.c: 148 in stack_clean()
 Var iable "str" going out of scope leaks the storage it points to.

fix CID 1361612
Null pointer dereferences (NULL_RETURNS)
/libr/core/tp.c: 178 in r_anal_type_match()
Dereferencing a null pointer "op".

fix CID 1361611
/libr/anal/var.c: 112 in r_anal_var_retype()
/libr/anal/var.c: 125 in r_anal_var_retype()
Dereferencing a null pointer "fcn".

fix CID 1361610
Incorrect expression (IDENTICAL_BRANCHES)
/libr/core/cmd_anal.c: 1616 in __anal_reg_list()
Dereferencing null pointer "fcn".
2016-08-15 09:54:25 +02:00
pancake
55a76c29e6 Fix iV tests 2016-08-15 09:53:15 +02:00
Ahmed Mohamed Abd El-MAwgood
397790250c Update types databases 2016-08-15 08:50:46 +02:00
Daniel L. Polanco
97f3a46100 Add final dll mfc90u to close issue 5486 (#5514)
This is an empty file because I (DanTheColoradan) was unable to
obtain any ordinal information. I tried two versions:

-  9.0.30729.1
-  9.0.30729.6161

Both were downloaded from dll-files.com. I also tried a version
from MS Windows 10, but I don't know what version it was.

This change should close #5486.
2016-08-14 22:42:45 -04:00
pancake
e33a6acbe7 Fix version info section sizes 2016-08-15 03:09:27 +02:00
pancake
c35666ef8a Minor rap:// fixes. More to come 2016-08-15 02:37:45 +02:00
pancake
771acc81f6 Fix huge load times for fuzzed versioninfo bins 2016-08-15 02:37:24 +02:00
pancake
0f39a486f5 Fix #5341 - rap:// with no file works now 2016-08-15 01:54:53 +02:00
pancake
d001066eb4 Support longer wopD.. still not complete 2016-08-15 01:40:34 +02:00
pancake
75fd458df8 Fix #5007 - Clarify the difference of hash/encoder/crypto 2016-08-15 01:10:42 +02:00
pancake
39fa8c37b1 Fix build of nocache:// 2016-08-15 01:04:27 +02:00
pancake
2a5e49ee40 Fix b64 decode oob vuln ported from sdb 2016-08-15 01:03:22 +02:00
pancake
e1b94b8343 Update sdb to fix an overflow in the base64 decoder 2016-08-15 01:02:05 +02:00
pancake
d18a63e9ed Fix #5379 - Implement nocache:// for the posix io plugin 2016-08-15 00:14:36 +02:00
pancake
deb05ed383 Honor cfg.bigendian in wopO for debrujn patterns 2016-08-14 23:49:13 +02:00
Alexandru Caciulescu
2b35ce2ed4 Fix undeclared variable error (#5512)
Undeclared variable "i" at line 2215.
2016-08-14 23:24:32 +02:00
pancake
6c9af2e690 Fix #4841 - Restricted r2 shell thing 2016-08-14 19:55:54 +02:00
pancake
3495e98545 Fix Warning: Too big version thing in some ELFs 2016-08-14 19:48:29 +02:00
pancake
fe0530aa9c Fix OOB read in vax disassembler 2016-08-14 19:35:24 +02:00
pancake
be220ec038 Fix VRR on windows issues 2016-08-14 19:29:59 +02:00
pancake
3654e5f33b Fix regression in reg.type=flg 2016-08-14 19:12:52 +02:00
pancake
6e478431dd Fix 4 warnings (unused stuff) in cmd_search_rop 2016-08-14 02:30:31 +02:00
Alexandru Caciulescu
138c69f98f Fix flag regs being seen as 'gpr' instead of 'flg' 2016-08-14 02:24:02 +02:00
pancake
f60597b2ee Fix ar 1 to honor RReg.Type.flg 2016-08-14 02:23:47 +02:00
pancake
f8fa41bac8 Add gsprop32 and spr32d70 in bin/d/Makefile 2016-08-14 02:09:38 +02:00
Daniel L. Polanco
5d551c68fb Add spr32d70 and gsprop32 sdb for issue 5486 (#5491)
As per Maijin's request, I have added two out of the three dlls
I need to run radare2 on an exe I'm trying to disassemble. I was
unable to get any useful function exports for the third file,
mfc90u.
2016-08-14 02:08:53 +02:00
Alexandru Caciulescu
e652a18469 Implement Arithmetic Pattern matching for ROP classification
* /R can now classify nop gadgets
* MovRegs and LoadConst pattern classification for /R
* Moved classification logic in separate file
* Adding Arithmetic Pattern classification for /R (work in progress)
2016-08-14 02:08:40 +02:00
Ahmed Mohamed Abd El-MAwgood
52da64becc Fix for function name decorators (oridinal, sym.blablabla) (#5488)
implemented function guess matched name which finds longest function name in sdb_types that is substring of the current function name
2016-08-14 02:07:43 +02:00
Ahmed Mohamed Abd El-MAwgood
4f413e7720 initial support for type matching (#5480)
Enabling stepping over
Basic (sym.imp.*) call catching routines
Fixing esil tracing bug and verbosity
Adding some apis for handling function prototypes and abstacting sbd queries
Fixing the double execusion bug in esil tracing
passing types into vars for `stack`
fixing trailing spaces
doing the regester branch
doing the stack_rev
2016-08-13 12:09:14 +02:00
pancake
46cec371db Fix asm.filter parse issue for m68k 2016-08-11 02:32:23 +02:00
Paul
52656941fe r_core_print_disasm_json fix (#5479)
* r_core_print_disasm_json fix
2016-08-10 21:10:00 +02:00
Álvaro Felipe Melchor
dc5673ec3a Fix regression with the arm/thumb changes (#5464)
Now we build a list of ranges (RAnalRange) based on anal hints to handle the
bits in a better way in the case of arm/thumb

Now instead of asm.bits that rules the whole binary we can define ranges with
anal hints
2016-08-10 18:49:44 +02:00
Daniel Roberson
d6ee8fe300 PowerPC calling conventions (#5477)
* added powerpc-32 calling conventions
* added powerpc-64 calling conventions
* fixed grammar
* added powerpc 32 and 64
2016-08-10 16:07:39 +02:00
Alexandru Caciulescu
72e58c2e01 /R gadget classification patches for #5397 (#5448)
* /R can now classify nop gadgets
* MovRegs and LoadConst pattern classification for /R
* Moved classification logic in separate file
2016-08-09 17:24:25 +02:00
Ahmed Mohamed Abd El-MAwgood
aca34ee0b3 fixing watcom calling convention 2016-08-09 13:58:44 +03:00
pancake
a2d9300d77 Fix #5339 - Projects now work with r2pipe 2016-08-09 12:53:34 +02:00
pancake
059ad1a51c Differentiate methods from functions in objc parser 2016-08-09 01:40:12 +02:00
pancake
ac73a4b2dc Add calling convention definitions for AMD64, ARM, MIPS, SPARC 2016-08-09 01:16:10 +02:00
Ahmed Mohamed Abd El-MAwgood
ad1565d9e4 few enhancements for afv FIX #5459 (#5461)
replacing afv[bsr]n  with afvn
replacing negative sign `n` with `_`
being consistent across the documentations (args + locals = vars)
refactoring code
2016-08-09 00:17:42 +02:00
@bezjaje
4e71ff36fe Honor endiannes and size too in reference values in disasm (#5469) 2016-08-08 23:40:56 +02:00
javierprtd
56636c8d09 Update dmh 2016-08-08 18:42:18 +02:00
pancake
6d1d02024e Remove problematic asprintf defines from libiberty.h 2016-08-08 13:40:50 +02:00
pancake
b39fb26264 Add $Fb and $Fs to handle basicblock address and size 2016-08-08 13:32:23 +02:00
pancake
e8464e6d75 Honor endian in reference values in disasm 2016-08-08 11:35:03 +02:00
pancake
e866c76147 Fix #5432 - Implement pdrj 2016-08-08 11:07:05 +02:00
pancake
3fe30f5c35 Fix #5450 - Implement 'n' key in VV graph to rename function 2016-08-08 10:56:47 +02:00
pancake
0777232b1b Rename core/bin.c as cbin.c to avoid confussion with bin/bin.c 2016-08-08 10:45:49 +02:00
pancake
bf63107f9a Fix uninitialized entry field for MZ bins (jman issue) 2016-08-08 10:45:32 +02:00
pancake
3e5f636869 Fix Vcdn to rename local vars - reported by @ret2libc 2016-08-08 01:00:47 +02:00
Álvaro Felipe Melchor
b8363bc5cc another fix due to regression 2016-08-07 19:58:34 +02:00
Álvaro Felipe Melchor
9f1deb5be6 try again to fix the regression 2016-08-07 19:27:50 +02:00
Álvaro Felipe Melchor
32335f7635 fix regression 2016-08-07 19:16:02 +02:00
Álvaro Felipe Melchor
b765f0e786 Fix #4639 - Problem with arm32 2016-08-07 18:00:40 +02:00
Álvaro Felipe Melchor
0bc983027f improve arm/thumb in elf file format and disasm 2016-08-07 17:38:34 +02:00
Roman Valls Guimerà
33c6d01531 [AVR] First approach to afCl/cdecl for AVR (#5453)
* First approach to afCl/cdecl. Thanks @oddcoder.
* Remove compilers that do not exist for AVR
* Remove unnecessary platform-specific code since 'cc-arch-bits' should be already a stable convention.
* Typo on the afC way
2016-08-07 17:14:14 +02:00
Ahmed Mohamed Abd El-MAwgood
5adf93a570 fixing aek- (#5454)
according to `ae?`,  aek- is used to delete all esil->stats key/value pairs, but it wasn't actually implemented.
2016-08-07 17:08:52 +02:00
pancake
b53a7bb84b Fix regression in AFR related to io_is_valid 2016-08-07 14:08:13 +02:00
Álvaro Felipe Melchor
7a3fddf46c fix crash in hud 2016-08-07 13:02:51 +02:00
Álvaro Felipe Melchor
d0032b08ea fix crash in dex 2016-08-07 12:54:29 +02:00
pancake
a4ff60743f Follow fcn calls one step further WIP 2016-08-07 09:17:05 +01:00
pancake
a211c48bd5 Update some indentation in asm.dalvik 2016-08-06 11:58:54 +02:00
pancake
744fad6418 Port to Termux (Android-Debian environment) 2016-08-06 05:12:58 +01:00
pancake
bc0f5fe119 Parse fields and statics in DEX 2016-08-06 03:10:56 +02:00
pancake
2113751573 Fix some false positives in aad using the API instead of r2cmd 2016-08-05 14:41:59 +02:00
Ahmed Mohamed Abd El-MAwgood
4668bc5ea3 Adding nonull (#5441) 2016-08-05 13:35:44 +02:00
pancake
2f339144f4 Fix some latest covs 2016-08-05 13:25:20 +02:00
pancake
cc01682132 Some playground with DEX 2016-08-05 13:11:30 +02:00
pancake
9902a5fc67 Detect local variables in Dalvik code analysis 2016-08-05 02:40:52 +02:00
pancake
53e9e91b4c Increase rafind2 -ZS wide and do not run aad in aaa 2016-08-05 00:30:56 +02:00
pancake
e553fc2bec Fix method names glitch in DEX 2016-08-05 00:27:01 +02:00
@bezjaje
9a9df6c3b7 ESIL: small x86-16 improvements (#5443)
+ LODSB and LODSW are compatible with 16-bits by using the proper size for 'si' register
+ added ss, ds, es segments to 16-bits register profile
2016-08-04 23:54:39 +02:00
pancake
5b189ee595 Fix #5447 - Implement aO command 2016-08-04 23:52:30 +02:00
Maijin
9a404b6d9c Add rowlog for aad in aaa 2016-08-04 14:26:30 -07:00
pancake
3ca1d5653c Add 'aad' to analyze data refs which are actually code 2016-08-04 22:53:18 +02:00
pancake
f840836af8 Add aad command to analyze data refs as code (LEA) 2016-08-04 22:52:33 +02:00
pancake
f47a328e32 Fix #5449 - Fix floating point computation 2016-08-04 19:45:36 +02:00
Lev Aronsky
913df9b74c Added a missing comma in ESIL parsing of a memory destination with arithmetics involved, fixes #5431 (#5440) 2016-08-04 11:24:04 +02:00
pancake
1fa04d98c3 Fix for crypto.cps2 2016-08-03 14:07:03 +02:00
pancake
9fda59e26d Only use ~/.config/radare2/prefix/bin 2016-08-03 14:03:09 +02:00
pancake
d179c06af3 Support wide strings in rafind2 -ZS 2016-08-03 01:17:27 +02:00
Álvaro Felipe Melchor
a99d53357d Fix #5352 - Endianness problems for wopO command 2016-08-02 23:22:34 +02:00
pancake
8d5e5d4add Fix io.r2k build on mingw 2016-08-02 13:47:45 +02:00
pancake
3c8e49e67e Fix w32 build of io.self 2016-08-02 13:22:25 +02:00
skuater
4c7290cb4e Implement io.r2k for Windows
* initial r0 io memory r/w
* add driver initialization add
* renamed and implementing installation
* add io command !=mod to list system modules
* flags using . =\!mod
2016-08-02 00:58:39 +02:00
pancake
d075e86e24 Enhance float support in pf 2016-08-02 00:37:07 +02:00
reddevillg
e9821b8181 #5406 2016-08-01 23:40:50 +02:00
pancake
4a190d770c Some anal cleanup and aim for the fwdjmp bb issue 2016-08-01 18:41:07 +02:00
pancake
94602683ed Fix debug/Makefile syntax 2016-08-01 18:07:26 +02:00
pancake
fc4354eff0 Add cps2 plugin in crypt.c (should be dynamic!) 2016-08-01 17:34:17 +02:00
pancake
c4083a207e Add crypto.cps2 plugin 2016-08-01 17:31:36 +02:00
pancake
d917902b4e Fix #5427 - ao[n] shows same bytes on all instructions 2016-08-01 16:18:24 +02:00
pancake
f883a00741 Fix some more arm-rel-pc issues (by CalArcher) 2016-08-01 14:49:42 +02:00
pancake
7b0622f85d Fix latest covs 2016-08-01 14:46:17 +02:00
pancake
5174f8f624 Fix #5436 - uninitialized var in izz 2016-08-01 14:19:51 +02:00
pancake
8e45f6248c Fix #5425 - Code cleanup and refactor 2016-08-01 13:58:14 +02:00
Alexandru Razvan Caciulescu
61518c2646 xrefs dir path fix 2016-08-01 12:55:47 +02:00
pancake
1e38b4521e Fix null deref in RBin.Symbol.bind 2016-08-01 12:36:20 +02:00
Moritz Eckert
143d2c3791 Fix #4965. Add support for luhn searching and hashing. 2016-08-01 12:34:54 +02:00
Maijin
f211c68095 Remove afg 2016-07-31 11:55:09 +02:00
pancake
2bf4dc7ffc Fix #5426 - r_bin_list uses RCons now 2016-07-30 19:17:17 +02:00
Eugene
b0970d563e fixes #5418 (#5421) 2016-07-30 18:56:24 +02:00
pancake
8c8887846d Fix absolute path resolution in rop.db 2016-07-30 14:47:00 +02:00
Dario B
d23f3fc97d #5179 and TODO about avoid forks (#5401)
* removed some forks

* a bit of refactoring

* done test and fix bug

* fix code style
2016-07-30 14:29:49 +02:00
Alexandru Caciulescu
adeb5b524b Implemented save/restore rop.db for projects (#5414) 2016-07-30 14:28:45 +02:00
pancake
77f19155b4 Fix io.self dlsym for r_lib_dl_open 2016-07-30 14:15:29 +02:00
Ahmed Mohamed Abd El-MAwgood
7c8414f585 FIX #5392 display values of args and locals in debugger (#5417) 2016-07-29 19:35:34 +02:00
Eugene
ef8daed816 Fixes #5389 - Add aflqj 2016-07-29 19:34:43 +02:00
Moritz Eckert
e1efde0b1c Fix #5338 - Add ability to start RAP server in background. (#5416) 2016-07-29 19:32:27 +02:00
Anton Kochkov
0324837100 Fix Jenkins Mingw-w64 build 2016-07-29 16:13:41 +03:00
Anton Kochkov
65e4ab058c Update sdb to 0.10.4 2016-07-29 15:51:36 +03:00
Anton Kochkov
5cc983a657 Fix Mingw32 building [2] 2016-07-29 14:45:54 +03:00
Anton Kochkov
0ca2034422 Fix Mingw32 building 2016-07-29 14:37:17 +03:00
pancake
e1d955d7ed Use r_lib_dl instead of the raw libc functions 2016-07-28 19:59:40 +02:00
pancake
838e4d6fa2 Add dlsym, call, alarm and other goodies to self:// 2016-07-28 17:12:05 +02:00
Alexandru Caciulescu
34147cd121 /Rk command for rop queries (#5403) 2016-07-28 15:05:38 +02:00
pancake
57996ce39f Add waitfor:// in io.debug description 2016-07-28 12:59:51 +02:00
pancake
f2ac0a1d52 Enhance ignore call warning message and minor refactor in mach0 entitlements parser 2016-07-28 11:33:53 +02:00
Maijin
7938640445 Move all /t/ from r2 to r2r 2016-07-27 19:19:30 +02:00
Maijin
90530319d7 remove more util/t 2016-07-27 18:57:43 +02:00
Maijin
34dfdd6fdf remove more util/t 2016-07-27 18:05:25 +02:00
Maijin
3894935a06 remove more util/t 2016-07-27 17:18:45 +02:00
Maijin
80171b0dc5 Cleaning r_util.h 2016-07-27 16:55:20 +02:00
Alexandru Caciulescu
fd76792386 All /R commands cache gadgets and use rop.db (#5398) 2016-07-27 16:19:33 +02:00
Maijin
da041b1b74 Delete useless r.h
Delete useless r.h
2016-07-27 16:19:30 +02:00
Ahmed Mohamed Abd El-MAwgood
2dbb3d8fc6 Calling convention profiles in SDB (#5358) 2016-07-27 13:50:14 +02:00
Sven Steinbauer
ca96796268 Prevent possible max shift value (#5391)
Protect against shifts that might be bigger than 31
2016-07-27 13:21:36 +02:00
pancake
4831b504bc Use proper relative includes in r_util.h 2016-07-27 12:55:05 +02:00
pancake
f5a73b73d7 Remove dupped hex2int function 2016-07-27 12:51:55 +02:00
pancake
f2c0ad9edb Fix null de-refs in GNU C++ demangler 2016-07-27 12:22:49 +02:00
Álvaro Felipe Melchor
f1236563f3 Refactor RBin.Xtr to speedup dyldcache extraction
* Refactoring RBinXtr API.
* Cache sub-fat bins in sdb to save memory.
* Fix the error while loading sub-bins of different archs.
* more work into xtr to fix the remaining tests
2016-07-27 11:01:57 +02:00
Álvaro Felipe Melchor
9e412a9048 fix again the crash in nz 2016-07-26 23:08:29 +02:00
Álvaro Felipe Melchor
5d493c1950 refix crash in nz assembler 2016-07-26 22:37:20 +02:00
Álvaro Felipe Melchor
8a0b1183c7 fix crashes in radiff 2016-07-26 22:34:00 +02:00
Álvaro Felipe Melchor
3c8066ce57 fix crash in nz assembler 2016-07-26 22:08:25 +02:00
pancake
e62aac49f3 Update C++ demangler from the latest GNU binutils 2016-07-26 18:57:57 +02:00
pancake
2dda628da1 Null terminate array of instructions in x86.nz to fix a crash 2016-07-26 18:46:48 +02:00
pancake
d46fa6ddd5 Implement waitfor:// in io.debug. Fixes #5380 2016-07-26 17:23:50 +02:00
pancake
102261ba37 Implement pidof:// URI handler in io.debug 2016-07-26 17:16:56 +02:00
pancake
9b053064fd Fix dmp command for OSX and make it work with 1 parm instead of 3 2016-07-26 16:54:18 +02:00
pancake
2638b07571 Fix r2 -d mame on OSX asm.bits=16 problem 2016-07-26 15:30:26 +02:00
pancake
2a2226978e Fix dmi on OSX and minor cydia tweak 2016-07-26 15:17:07 +02:00
pancake
30bdc476a1 Some cleanup in xnu.debug 2016-07-26 04:15:23 +02:00
pancake
9500455c87 Remove noisy error message 2016-07-26 00:33:28 +02:00
pancake
b342358513 Fix x86.nz warnings from clang 2016-07-25 21:26:35 +02:00
Sven Steinbauer
e436e66428 Kill dead code (#5378)
Fix dead code warnings from coverity scan
2016-07-25 21:24:29 +02:00
pancake
36af078830 Fix regression 2016-07-25 21:24:19 +02:00
pancake
085a156a86 Fix #5334 - add support to analyze interrupt handler functions 2016-07-25 20:15:50 +02:00
Sven Steinbauer
c5635eec3c Fix error on invalid reg (#5374)
some instructions wouldn't error on invalid source or dest values.
Set valid reg to false by default and only set true if actually valid
2016-07-25 18:52:58 +02:00
pancake
e829c007fd Fix #5371 - format string in blocksize error 2016-07-25 18:50:14 +02:00
Sven Steinbauer
887f5bfa8c Support extended 64bit registers [Fix #5364] 2016-07-25 18:02:46 +02:00
Paul
6b9bc8560e iS[j|*|q] [hash] fix 2016-07-25 14:48:49 +02:00
Kodoque1
e582ab8dbb Correction for #5349 (#5369)
* q[y/n][y/n] options added

* Adding crowell remarks

* checking beginning whitespace and fixing else if

* updated

* cleaning update
2016-07-25 10:37:51 +02:00
sdlf
96858ac1e9 Some improvements for arm pseudo code (#5370)
* Fix logical typo scanning for separator

The test would only accept ] as a separator. This was ok for
expressions like:

  r2 = [pc + 8]

But would strip the terminating ) in:

  if (r1 == 0

* arm/pseudo: fix typo /halt/half

* arm/pseudo: fix spacing before byte/half

it is now consistent with the other instructions and
have a space after the '=' also consistent with vmov/vdif.

* arm/pseudo: fix ldr/str

The following str instruction:

  str r0, [r4, 0xc]

Would produce the broken pseudocode:

  [r4 + 0xc] = r0 + 0xc]

With this change we get the expected:

  [r4 + 0xc] = r0

We need to handle 2/3 parameter instructions
differently for ldr/str. By doing this the
special case checking for [ is no longer needed.

* arm/pseudo: add a couple of XXXXs variants

these were arbitrarily selected based on the sample
i have been looking at.
2016-07-25 05:16:51 +02:00
pancake
6dfba715b1 Fix #5361 - realtime hexview edit mode 2016-07-25 05:14:48 +02:00
pancake
6c549b424a Remove x86.tab from r2 master (moved to extras) 2016-07-25 03:47:47 +02:00
pancake
845bfebc9e Fix null deref in x86.nz 2016-07-25 03:42:28 +02:00
pancake
91fe80f4ca Fix avr's rjmp disasm, analysis and esil 2016-07-25 03:19:16 +02:00
pancake
0cffcb981e Fix vsize=0 issue in PE parser (fixes asm68k.exe issue) 2016-07-25 00:03:20 +02:00
Dreamdance61
9226290930 AVR: Correct duplicate IOPort UCSRA in ioports.c (#5366) 2016-07-24 11:16:27 +02:00
Maijin
22de895ef5 Rename CSR disasm/anal into XAP4 Fix #5355 2016-07-23 00:41:42 +02:00
Sven Steinbauer
996e767e0d Refactor nz assembler
Refactor nz assembler
2016-07-22 18:33:54 +02:00
Álvaro Felipe Melchor
d52dfbdfe6 added help message into pv 2016-07-22 00:48:52 +02:00
Owlz
1d97857b67 Adding "8" modifier in doc
Adding in reference to the "8" modifier for pv.
2016-07-22 00:20:09 +02:00
Álvaro Felipe Melchor
8059f4be23 fix build 2016-07-21 23:15:52 +02:00
Kamil Rytarowski
6ad9abb0b1 Fix NetBSD build in r_debug_native_pids() 2016-07-21 23:00:18 +02:00
Álvaro Felipe Melchor
01fe87d467 fix coverity and some coding style 2016-07-21 22:56:58 +02:00
Álvaro Felipe Melchor
b2cd7fb23c improve thumb/arm detection 2016-07-20 23:07:07 +02:00
Álvaro Felipe Melchor
50b20b8153 fix coding style 2016-07-20 18:43:28 +02:00
Maijin
b7d7593342 Add wcj 2016-07-19 23:55:36 +02:00
Ahmed Mohamed Abd El-MAwgood
67af958e63 FIX #5324 vars/args display 0 in afi and afll and add in aflj 2016-07-19 21:50:55 +02:00
diouziou
39907cd94a Typo Update cmd_write.c
Typo Added a missing )
2016-07-19 16:22:00 +02:00
Maijin
5c4b292f77 Fix #5325 Decide OR and remove unnecessary help 2016-07-18 00:59:16 +02:00
Maijin
9026c6b8b3 Fix #5340 ij command with debugging open 2016-07-18 00:39:03 +02:00
Maijin
1c744dea96 Fix #5342 dbg_file in PE breaks json output 2016-07-18 00:34:09 +02:00
Patrik Bachan
c62cd5a61e Improved AVR register comments/annotations
* Fix missing AVR register descriptions
taken from ATmega16 datasheet

* Improve AVR register descriptions
- extended comments for PORT* registers explaininig their purpose
2016-07-17 23:26:26 +02:00
Álvaro Felipe Melchor
965c0400d2 refix dwarf crash 2016-07-17 19:20:48 +02:00
Álvaro Felipe Melchor
0d42b6c017 fix crash in dwarf fuzzed test 2016-07-17 18:42:22 +02:00
Álvaro Felipe Melchor
8ad4d74316 fix off by one when diffing 2016-07-17 12:10:23 +02:00
NikolaiHampton
392dd94bf7 Optimisation of Levenshtein calc in radiff2 -s
- Optimised the distance calculation for radiff -s
- Fixed a bug in radiff.c that where verbose was always true.
- Added check that calloc() was successful.
- Shuffled code around to minimise use of free()
- Added some comments.

Speeds up the radiff2 statistical diff. Drastically reduced the ‘edit
distance search space’ by ignoring ranges that can’t affect the edit
distance. Improves search for similar files (common use case?), can
reduce the search space significantly:

One file tested went from two unknown versions of httpd, on MacBook has
a 28 hours processing time, down to ~13 minutes. Results will vary based
on file differences the more similar the files, the faster it'll run.
2016-07-17 12:10:20 +02:00
Sushant Dinesh
aee2a7de95 aflj displays at information (#5330) 2016-07-15 03:21:09 +05:30
Álvaro Felipe Melchor
890526f776 fix minor things in mach0.c 2016-07-14 23:11:04 +02:00
Álvaro Felipe Melchor
ab3f37589c Rework previous patch 2016-07-14 22:37:33 +02:00
mttbrown
dd116c65cd fixed breakpoint size based on arch 2016-07-14 22:18:45 +02:00
Álvaro Felipe Melchor
cb0280d62a Fix crash in ec command 2016-07-13 22:31:15 +02:00
Jeffrey Crowell
951f110524 fix build 2016-07-13 00:41:38 -04:00
Jeffrey Crowell
b89bde9df9 reindent cmd_debug.c and fix tons of memleaks 2016-07-13 00:35:13 -04:00
Álvaro Felipe Melchor
7fb29d7e97 added two missing funct declaration into r_num.h 2016-07-12 23:14:30 +02:00
Álvaro Felipe Melchor
7a2f32c281 compile dmh only with linux 2016-07-12 23:04:32 +02:00
javierprtd
07f0502c98 new commands dmh 2016-07-12 23:04:32 +02:00
Maijin
0c1dba02f1 Remove duplicate crc32c, crc32 from fileinfo 2016-07-12 23:03:11 +02:00
Maijin
e3a05bdb76 Kill libr/asm/t 2016-07-12 22:51:47 +02:00
Maijin
103586110f Remove test_stack.c from r2 2016-07-12 22:37:25 +02:00
Maijin
c274afe748 Fix #3286 - Use stdbool.h 2016-07-12 22:15:19 +02:00
Kodoque
574e74e89a q[y/n][y/n] options added 2016-07-12 21:50:25 +02:00
monosource
b21603cfeb libr/core/cmd_debug: using r_core_cmd_help for "de" 2016-07-12 21:31:42 +02:00
monosource
bb79c50024 core/cmd_log: Fixed T description 2016-07-12 21:24:55 +02:00
Jeffrey Crowell
9fd13fba06 move some string related macros to r_str.h 2016-07-11 23:00:55 -04:00
Jeffrey Crowell
0cb7dd6c77 style guide for declarations of functions 2016-07-10 19:54:31 +00:00
Maijin
306a790187 Separate more r_* from r_util 2016-07-10 15:02:01 +02:00
Maijin
a38aec4568 Separate more r_* from r_util 2016-07-10 14:22:15 +02:00
Jeffrey Crowell
fa75406fa2 move r_graph header out of r_util.h 2016-07-09 19:59:37 -04:00
Anton Kochkov
3ce9d8ef3f Install libr/include/r_util/* 2016-07-10 01:12:20 +03:00
Jeffrey Crowell
13f52c16f7 separate debruijn to it's own header file (#5318) 2016-07-09 11:58:30 -04:00
Jeffrey Crowell
3c3775b3d0 fix broken build ( 2016-07-09 01:50:06 -04:00
Jeffrey Crowell
e65ceb5dee fix some memory leaks reported by coverity 2016-07-09 01:41:56 -04:00
Álvaro Felipe Melchor
0522b93047 Fix null dereference 2016-07-08 23:28:21 +02:00
Álvaro Felipe Melchor
3bcca60853 Fix crash dwarf again 2016-07-08 23:16:24 +02:00
Álvaro Felipe Melchor
c24a12c4c8 Fix paddr to vaddr translation in elf (#5300) 2016-07-08 21:42:02 +02:00