Commit graph

4964 commits

Author SHA1 Message Date
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
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
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
Alexandru Caciulescu
34147cd121 /Rk command for rop queries (#5403) 2016-07-28 15:05:38 +02:00
pancake
f2ac0a1d52 Enhance ignore call warning message and minor refactor in mach0 entitlements parser 2016-07-28 11:33:53 +02:00
Alexandru Caciulescu
fd76792386 All /R commands cache gadgets and use rop.db (#5398) 2016-07-27 16:19:33 +02:00
Ahmed Mohamed Abd El-MAwgood
2dbb3d8fc6 Calling convention profiles in SDB (#5358) 2016-07-27 13:50:14 +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
2a2226978e Fix dmi on OSX and minor cydia tweak 2016-07-26 15:17:07 +02:00
pancake
085a156a86 Fix #5334 - add support to analyze interrupt handler functions 2016-07-25 20:15:50 +02:00
pancake
e829c007fd Fix #5371 - format string in blocksize error 2016-07-25 18:50:14 +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
pancake
6dfba715b1 Fix #5361 - realtime hexview edit mode 2016-07-25 05:14:48 +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
Á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
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
Sushant Dinesh
aee2a7de95 aflj displays at information (#5330) 2016-07-15 03:21:09 +05:30
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
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
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
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
Ahmed Mohamed Abd El-MAwgood
46b0e3f48e fixing windows types (#5308) 2016-07-08 11:06:36 +02:00
n4☠0r
b353733041 dmhc update (#5311)
* dmhc update: chunk flags and data dump support
2016-07-08 11:00:38 +02:00
Eugene
eb6702b254 Added missed lines&sorted (#5307) 2016-07-07 23:02:27 +02:00
Ahmed Mohamed Abd El-MAwgood
5586355bb8 autoloading windows types when file is windows executable (#5304)
and few other adjustements
2016-07-07 00:14:06 +02:00
pancake
e971fd810e Implement dmh* and fix some indents in previous commit 2016-07-06 23:59:29 +02:00
n4x0r
2a84841a67 dmhc feature for dmh extension update (#5302) 2016-07-06 23:41:43 +02:00
pancake
887897e02b Fix cmd_rop tests 2016-07-06 01:05:07 +02:00
pancake
f345656ec6 Fix cmd_search 2016-07-06 00:20:42 +02:00
Maijin
8cefeeb7b6 Add @o help 2016-07-06 00:02:49 +02:00
pancake
a3f818f7e0 Add rop.db and remove the misuse of asm.esil in /Rl 2016-07-05 23:42:08 +02:00
Álvaro Felipe Melchor
bc218f8b26 change int to const bool config_get_i rop search 2016-07-05 23:38:59 +02:00
pancake
0f8a5c8635 Fixes and enhancements for the previous commits 2016-07-05 23:25:16 +02:00
Alexandru Razvan Caciulescu
8434da3f2a ESIL output for /Rl command (and save gadgets in SDB) 2016-07-05 23:11:08 +02:00
Álvaro Felipe Melchor
79601b4949 dmh - show heap info (#5251) 2016-07-05 22:48:48 +02:00
Ahmed Mohamed Abd El-MAwgood
85dcb19dae fixing type link consumes no bytes (#5288)
implementing initial api for types
Adding types profiles for x86 and x86_64 architectures
2016-07-05 22:44:53 +02:00
pancake
57d7bdfdfc Fix #4928 - Show string context in search results 2016-07-05 22:19:36 +02:00
pancake
f85536ac76 Add agC for full program callgraph
Fix afi indentation issues
2016-07-05 17:37:29 +02:00
Rakholiya Jenish
339a5b7b18 fix iZ and negative o for large files (#5242)
correct the add section check

keep commented part to it's original code

int to ut64

minor fix and limit buffer size in case file size cannot be allocted

remove section check

show size in readable format

minor changes
2016-07-05 12:46:28 +02:00
pancake
ce1ce1cf63 Add +/- for the bit editor 2016-07-05 12:31:25 +02:00
pancake
8532e0c6da Initial implementation of Vd1, the bit editor 2016-07-05 05:25:45 +02:00
pancake
04de3e657f Assume AVR bins have no strings 2016-07-04 16:28:58 +02:00
Rene Laemmert
de37c7d71d removed double quotes from json result for search (#5280) 2016-07-04 13:01:13 +02:00
pancake
87ccfd34f5 Add fi[jn*] command to list flags in range 2016-07-03 22:00:43 +02:00
pancake
fe06f16b44 Add core.iorw in i command (merge fdmode + io.cache 2016-07-03 21:04:50 +02:00
pancake
7436ce01ee ecc [arg] - show color palete in css prefixing the CSS keys 2016-07-03 20:56:44 +02:00
pancake
6361f20f3d Fix indentation in core.config 2016-07-03 20:05:01 +02:00
Anton Kochkov
5cd31d7aa4 Fix help of eco cmd 2016-07-02 21:36:06 +03:00
monosource
cea1c14750 Typo fix "afss-" -> "afvs-" (#5261) 2016-07-01 19:46:01 +02:00
Ahmed Mohamed Abd El-MAwgood
b31dd80724 Args/vars the last commit (#5245)
renaming afa, afv and afe to afvb afvr, and afvs respectively
making arguments analysis obeys e anal.vars
improving the json format for args/vars
fixing varsub to use the new comands for x86 and arm
fixing var commenting commands to use the new commands var configuration
2016-07-01 16:15:29 +02:00
pancake
4c21937caa Reuse 6502 regsize hack for AVR 2016-07-01 15:22:10 +02:00
Jeffrey Crowell
365547ef82 libr/core/yank.c fix memleak 2016-07-01 01:00:06 -04:00
Álvaro Felipe Melchor
0e4e39db79 fix somes coverities 2016-06-30 23:38:41 +02:00
Anton Kochkov
f983244e92 Do not trust input for cmd length 2016-06-30 22:24:38 +03:00
Anton Kochkov
33ec5b9865 Fix coverities
CID 1357120
CID 1357121
CID 1357112
CID 1357099
2016-06-30 22:11:09 +03:00
pancake
98e90dd3cf Implement RSyscall.IO in disasm loop for X86 and AVR 2016-06-29 17:02:43 +02:00
Álvaro Felipe Melchor
4b08d38cb1 more mem leak fixes 2016-06-29 10:11:25 +02:00
Jeffrey Crowell
5317508cdb fix build 2016-06-28 23:54:57 -04:00
pancake
682a255f1d Fix #4665 - Add more core.num.value updates after write ops 2016-06-29 00:52:29 +02:00
pancake
59524ac8c4 Fix #4665 - Add wxs and fix crash in dbg println 2016-06-29 00:41:46 +02:00
Boris
bf6f243498 fix disassembling 'backwards' (#5228)
(e.g. pdj -1) producing wrong output, same as #5105
2016-06-28 23:21:46 +02:00
Jeffrey Crowell
c145740030 replace r_cons_printf("%s\n",p) r_cons_println(p)
move from 10% of code in vfprintf to just 6% \o/ for simple tests of r2
-c "aaa" -q /bin/ls
2016-06-26 00:52:03 -04:00
Jeffrey Crowell
10b9fc1db0 rm unneeded calls to r_cons_printf 2016-06-26 00:17:16 -04:00
pancake
b676e0acb3 Fix #5217 - Add anal.vars variable 2016-06-26 01:52:53 +02:00
Jeffrey Crowell
8f205587ba kill r_cons_puts add r_cons_print/r_cons_println 2016-06-25 13:49:58 -04:00
dx
fe57aefe67 Some memleak fixes in 'agj' (#5213) 2016-06-25 19:43:05 +02:00
pancake
6ace96c3a5 Fix #5160 - make afbj great again 2016-06-25 04:17:31 +02:00
pancake
7e4cb2749e Fix #5002 - @o is a new modifier to temporary switch to another fd 2016-06-25 03:43:32 +02:00
pancake
b9e9d7fe4c Fix #4936 - Verify call destination in aac 2016-06-25 03:37:01 +02:00
pancake
90d42c0418 Refactor pia/pda and implement pdaj and pda= 2016-06-25 03:36:49 +02:00
Joshua J. Drake
722c62827b Major rework to the native debugger (esp on Linux) (#5185)
The major contribution here is completely re-worked breakpoint hit/recoil
handling. This work fixes #4907 and lays the ground work for future native
debugger improvements (multi-threading, etc).

* Give a human friendly type to enums
* Change many wait functions to return RDebugReasonType
* Better return checking (from r_debug_reg_sync, r_bp_restore)
* Optimized register synchronization
* Lots of comments and whitespace changes
* Improved inferior death detection

Handle EXIT_PID events differently than DEAD process events

* Move breakpoint/recoil handling to wait/cont/step

Rather than handing breakpoint related things inside cmd_debug.c, do that
inside the r_debug API functions. This seems like the most logical place for it
to live since it should apply to just about any platform/architecture.  This
also centralizes calling into "cmd.bp" handling via the CoreBind callback.

* Track how the caller wishes to continue

It turns out that handling break point recoils is very complicated. The ptrace
API on Linux returns SIGTRAP for just about every type of operation (not just
breakpoints getting hit). Add the "recoil_mode" flag to indicate whether we are
single-stepping or continuing and whether or not we are inside the recoil.

* Proper handling for swstep=true

Since r_debug_step_soft calls r_debug_continue, it's already hitting the recoil
case there. Move the recoil handling from r_debug_step to r_debug_step_hard
only.

For the swstep=true case, special handling is required inside r_debug_recoil.
By resetting all of the breakpoints except the one we just hit, we ensure we
can step the original instruction and hit the new swstep breakpoint. Add a new
bp function called r_bp_restore_except to do this.

To make matters worse, we cannot use a BreakpointItem pointer because that
leads to a use-after-free condition. Instead, we the breakpoint address
instead.

Now breakpoints should work regardless of the swtep setting.

* Always call the recoil before continuing

Some callers of r_debug_continue might not have ever inserted any breakpoints
before. If we don't restore breakpoints before each call to the underlying
continue we won't hit them.

* Hide software step breakpoint events from the user

When a breakpoint even happens due to a software-step, hide it from the user.
They aren't really breakpoints as far as they are concerned.

* Improve process exit handling on Linux

There are three types of process exiting events on Linux:

1. PTRACE_EVENT_EXIT occurs just before a process exits. It's not possible to
prevent it from exiting, but it can be used to inspect the pre-exit state.
2. The process can exit for a variety of reasons and we can notice when we call
waitpid(2).
3. The process could die randomly on us :-/

On Windows, h->wait will return R_DEBUG_REASON_EXIT_PID, but it's more likely
on Linux to find out the process is already dead.

* Check more bits within waitpid status

We can often make a decision about what happened strictly by looking at the
status returned from waitpid. In other cases, we need to call
r_debug_handle_signals.

If we reach the end of this function without knowing what happened, consider it
an error.
2016-06-22 10:34:45 +02:00
pancake
bc02cdb4b1 Fix regression in afl/afi 2016-06-22 10:29:16 +02:00
pancake
f9482bcae7 Add console.html 2016-06-22 03:19:10 +02:00
Álvaro Felipe Melchor
8b957f8512 fix two uaf in anal.c 2016-06-21 23:32:40 +02:00
pancake
ab5f7bb9ee Update depgraph.pl 2016-06-21 13:16:00 +02:00
Joshua J. Drake
b03c1e2b3e Improve dkp and drp
Distinguish between "dXX" and "dXXYY" or "dXX?". Treat the latter two the same.
This provides the least surprise to the user when they mistype something.

Improve default handling in arp/drp

* Adds a new command "drp." for showing the register profile size.
* Provides better help for drpXXX commands.
* Provides help in the default case (eg. drpz)
* Fixes indentation
* Provides correct help strings for arp vs. drp

Improve default handling for "dko"

* Rework "dko" handling to simplify
* Use r_core_cmd_help
* Show help when things like "dkox" are used
* Prevent allocation/free when not necessary
2016-06-20 15:28:40 +02:00
Joshua J. Drake
16c27891a0 Switch to r_sys_perror for errors and fix two typos 2016-06-20 15:24:19 +02:00