Commit graph

10197 commits

Author SHA1 Message Date
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
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
pancake
092e859c5c Release 0.10.4 - codename: padron peppers 2016-07-07 00:32:59 +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
leberus
8890d0650e Fix: segfault and #ifdef vs #if 2016-07-06 23:39:12 +02:00
pancake
d39d9b83e0 Update SDB from git fixing some possible null derefs 2016-07-06 17:03:34 +02:00
skuater
39c4a0c35f some fix in windows debugger 2016-07-06 12:44:52 +03: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
pancake
4c8a1b212f Fix warning in elf.c 2016-07-05 22:57:09 +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
48b44e8488 Fix #5271 - Support capstone3 again 2016-07-05 18:33:04 +02:00
pancake
f85536ac76 Add agC for full program callgraph
Fix afi indentation issues
2016-07-05 17:37:29 +02:00
pancake
a745a9a6f8 Update SDB from git (optimizations and new apis) 2016-07-05 15:31:51 +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
nevun
d8d6d1a073 kvm_openfiles can fail so make sure we print the error message. (#5285)
* kvm_openfiles can fail so make sure we print the error message.

On OpenBSD you can use the kvm interface without /dev/kmem access but on FreeBSD
you need root or kmem access which one do not want to give a user.

Look at ps(1) on FreeBSD and see how they do it.
2016-07-05 04:13:10 +02:00
pancake
04de3e657f Assume AVR bins have no strings 2016-07-04 16:28:58 +02:00
pancake
a81d667b53 Fix avr esil string 2016-07-04 16:12:28 +02:00
nevun
f41b706437 Fix OpenBSD build. Cannot do sizeof on a macro argument, compiler does not know what it is yet. (#5284) 2016-07-04 15:06:51 +02:00
pancake
f4f26582c7 Fix RSP esil warnings 2016-07-04 14:38:35 +02:00
nevun
5803182cbe Fixes issue #5279: kvm interface differs a bit between Open and FreeBSD. (#5282) 2016-07-04 14:32:11 +02:00
Eugene
3773a1d088 Added vars init in linux corefile gen (#5281) 2016-07-04 13:59:00 +02:00
Rene Laemmert
de37c7d71d removed double quotes from json result for search (#5280) 2016-07-04 13:01:13 +02:00
pancake
df7c33f297 Fix build for Linux <= 2.6.32 (coredump not supported) 2016-07-04 01:45:44 +02:00
pancake
4c97858e31 malloc:// forces rw and fix regression in 'f' 2016-07-03 22:36:58 +02:00
bsmiles32
622e828e1d Add basic support for N64 RSP processor. (#5269)
* Add basic support for N64 RSP processor.
This includes:
* a table driven instruction decoder (rsp_idec)
* a disassembler
* a very primitive anal plugin
2016-07-03 22:03:26 +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
Álvaro Felipe Melchor
d21ee9f00f fix crash due to UAF with io.vio option 2016-07-03 19:32:06 +02:00
Anton Kochkov
5cd31d7aa4 Fix help of eco cmd 2016-07-02 21:36:06 +03:00
nevun
20801a3ee4 Make dm work on OpenBSD by adding a native r_debug_native_map_alloc() (#5267)
Note that OpenBSD can have mappings with zero size so relax the assert.

Also note that the protection bits are flipped. Different bit order. Will fix that later.
2016-07-02 13:22:28 +02:00
nevun
b5ec7a7145 Add support for dp and dp* on OpenBSD. (#5266)
* Add support for dp and dp* on OpenBSD.

kvm_getprocs exists on Net and Free as well so it might work there as well

* Cosmetic changes after feedback. Thanks.
2016-07-02 12:35:24 +02:00
Álvaro Felipe Melchor
34fae270dd added free function into RHashTable (#5249) 2016-07-02 11:50:30 +02:00
Joshua J. Drake
09435c7317 Don't print SIGTRAP signals or stops
A TRAP signal signifes expected stops for breakpoints and so on. There's no
need to display these as signals or stops since they will be communicated
inside r_debug_bp_hit.
2016-07-01 21:32:02 -05:00
Joshua J. Drake
329acd33e4 Fix #5196: Make tracepoints work again
To accomplish this, we add a new debug stop reason R_DEBUG_REASON_TRACEPOINT
and return it from r_debug_wait whenever a tracing breakpoint is hit. Then, in
r_debug_continue_kill, we recognize this state and do the old r_debug_step
trick to progress the session. Previous rework of r_debug_recoil takes care of
the heavy lifting and we continue on our way.
2016-07-02 05:14:56 +03:00
pancake
2cc433cefa Fixes for avr to make travis green 2016-07-02 02:37:00 +02:00
monosource
cea1c14750 Typo fix "afss-" -> "afvs-" (#5261) 2016-07-01 19:46:01 +02:00
Joshua J. Drake
70ef08de79 Address feedback from PR #5198 (#5260) 2016-07-01 17:41:13 +02:00
Joshua J. Drake
d380a83d23 Invert some logic to avoid nested brace hell (#5198) 2016-07-01 16:15:42 +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
9864ef8841 Lowercase all registers to match RReg rules in AVR 2016-07-01 15:22:23 +02:00
pancake
4c21937caa Reuse 6502 regsize hack for AVR 2016-07-01 15:22:10 +02:00
pancake
77eb8656a4 Initial import of the bin.avr plugin for atmega8 chips 2016-07-01 15:08:13 +02:00
pancake
9447bfa9b9 Fix analysis and add ESIL for avr's rjmp 2016-07-01 15:07:52 +02:00
pancake
a2a032833e Show file size if not matching in radiff2 2016-07-01 14:08:25 +02:00
pancake
8361f2ea83 Honor RIO in radiff's slurp - thanks @brainstorm for the tip 2016-07-01 14:02:46 +02:00
def
6fba927804 Use UT32_MAX as a magic value 2016-07-01 13:07:21 +02:00
Pavel Borzenkov
fe9c419fa5 libr/debug: fix native debugger on Linux (#5259)
Linux kernel checks for unknown flags passed via the last argument to
waitpid() and fails waitpid() with EINVAL if it encounters one:

From kernel/exit.c:sys_wait4()

	if (options & ~(WNOHANG|WUNTRACED|WCONTINUED|
			__WNOTHREAD|__WCLONE|__WALL))
		return -EINVAL;

This makes it impossible to use debugger on Linux.

WAIT_ANY macro is actually supposed to be used as PID argument to wait
for all children without specifying particular PID.

Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
2016-07-01 11:13:57 +02:00
Jeffrey Crowell
365547ef82 libr/core/yank.c fix memleak 2016-07-01 01:00:06 -04:00
Jeffrey Crowell
73bddffbf0 /libr/bin/format/pe/pe.c fix off by one in strcpy 2016-07-01 00:57:38 -04:00
Jeffrey Crowell
d9fc1ce9fc fix random color switch statement 2016-07-01 00:56:35 -04:00
Álvaro Felipe Melchor
c3139b096d fix mem leak 2016-07-01 00:17:24 +02:00
def
c671b1c02c Fix collisions in ht.c 2016-07-01 00:17:20 +02:00
Álvaro Felipe Melchor
0e4e39db79 fix somes coverities 2016-06-30 23:38:41 +02:00
Roman Valls Guimera
4ebae2ee63 Add output ports for AVR Atmel8A. Thanks @radare and @oddcoder 2016-06-30 23:26:28 +02:00
Álvaro Felipe Melchor
4396598081 Fix oob read reported by revskill on mk68 code 2016-06-30 23:15:25 +02:00
Álvaro Felipe Melchor
d69a502eb5 fix indentation m68k_disasm 2016-06-30 23:01:24 +02:00
Álvaro Felipe Melchor
1652fccab4 Fix crash due to ht.c implementation 2016-06-30 22:01:25 +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
Anton Kochkov
22e4a1d74c Fix Android build - 2nd try 2016-06-30 21:26:36 +03:00
Anton Kochkov
35f8178632 Fix Android build 2016-06-30 21:17:31 +03:00
pancake
98e90dd3cf Implement RSyscall.IO in disasm loop for X86 and AVR 2016-06-29 17:02:43 +02:00
pancake
c3bfbcd66d Fix anal.arm.cs crash for 32bit 2016-06-29 14:24:22 +02:00
pancake
ad85da85ff Fix code indentation in libr_cons 2016-06-29 12:33:31 +02:00
pancake
6479943c46 More boolification and code cleanup -70LOC 2016-06-29 11:35:16 +02:00
pancake
a05003fd5c Code cleanup -20LOC and get pagesize from target task in io.mach 2016-06-29 10:54:27 +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
Álvaro Felipe Melchor
3d2e922dc9 Fix oob in elf parser 2016-06-29 00:03:36 +02:00
Álvaro Felipe Melchor
dcf5c45963 Fix #5229 - 31e973c21f0d27b959d0b97d7b23216c by revskills 2016-06-28 23:57:00 +02:00
Álvaro Felipe Melchor
95db0cee52 Fix oob 52961b39cfb9782c336c8a8247a6317f by revskills 2016-06-28 23:50:41 +02:00
pancake
1660237a24 Fix #5230 - Fix oob read in mach0.objc parser 2016-06-28 23:46:09 +02:00
pancake
f4e493166b Fix #5224 - Fix UAF in RBinObject.mem 2016-06-28 23:44:18 +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
Álvaro Felipe Melchor
3cedcc1c4b Trying to fix memleaks (#5218)
* Trying to fix memleaks
* fix null dereference in r_anal_var_list
2016-06-28 23:14:16 +02:00
Álvaro Felipe Melchor
5de44950cd Fix get_bits in mach0 2016-06-27 23:07:20 +02:00
Álvaro Felipe Melchor
283c8ab2bc updated warning message in dwarf 2016-06-27 16:40:24 +02:00
pancake
fe644e60ff Fix crash in r2 -a arm -b32 -c'wa str r0' 2016-06-27 15:58:43 +02:00
Álvaro Felipe Melchor
d978b2cde4 fix oob in version elf 2016-06-27 12:17:25 +02:00
Álvaro Felipe Melchor
97b6bdbc40 Fix null dereference introduced before 2016-06-26 23:44:14 +02:00
Álvaro Felipe Melchor
4b497540a1 try to fix oob 2016-06-26 23:21:41 +02:00
Álvaro Felipe Melchor
a18bd79724 fix regression version info 2016-06-26 23:07:47 +02:00
Álvaro Felipe Melchor
76522930b0 Fix oob in store_versioninfo_gnu_verneed 2016-06-26 22:34:07 +02:00
Álvaro Felipe Melchor
5a582d3a13 Fix oob in debug_info pe.c 2016-06-26 22:29:43 +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
Jeffrey Crowell
40af6b6065 fix macro for r_cons_println 2016-06-26 00:17:16 -04:00
pancake
dd6a168f82 Fix ood on OSX and clear raised on close 2016-06-26 04:51:44 +02:00
pancake
ee6be75b6e Fix bin/d installation and w32dist 2016-06-26 04:44:59 +02:00
pancake
b53a99aca2 Mark some x86-specific code only for x86 2016-06-26 03:56:08 +02:00
pancake
1a4177fed5 Fix exit in =! after o- a debugged process 2016-06-26 02:00:53 +02:00
pancake
b676e0acb3 Fix #5217 - Add anal.vars variable 2016-06-26 01:52:53 +02:00
pancake
9eef523bf9 Fix previous commit 2016-06-26 01:34:42 +02:00
pancake
564f63d9c3 Fix oobread in elf parser for 004e_00000000652b6080_000000000b3b7000.inp 2016-06-25 20:43:23 +02:00
condret
1aa3b6bf75 fix #4420, fix #4423 and refix #4422 (#5215) 2016-06-25 20:37:02 +02:00
pancake
badad8ffef Fix oobread in PE with 004e_00007fff4a3d9a9e_000000000b47b000.inp 2016-06-25 20:36:25 +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
condret
2b0124100a fix #4432 (#5212) 2016-06-25 19:17:12 +02:00
pancake
dcc02e87c5 More if DEBUGGER for linux 2016-06-25 18:48:26 +02:00
pancake
e3f7749f56 Aim to fix the sdb_version race condition issue 2016-06-25 18:26:34 +02:00
Jeffrey Crowell
7436b51095 add r_reg_32_to_64 for @condret
closes #5206
2016-06-25 00:03:44 -04:00
pancake
30deb7e3f2 Fix 004e_00007ffd2a9dc86.. from gamozo 2016-06-25 04:44:19 +02:00
pancake
4f785d398f Fix --disable-debugger on OSX 2016-06-25 04:26:07 +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
baca25dc73 Fix #5200 - __WALL is a linuxism, better use WAIT_ANY 2016-06-25 03:36:58 +02:00
condret
b8f26d248b fix #4422 (#5203) 2016-06-25 03:36:53 +02:00
pancake
90d42c0418 Refactor pia/pda and implement pdaj and pda= 2016-06-25 03:36:49 +02:00
pancake
c351c3d767 Fix oobread in dwarf die values 2016-06-24 19:35:34 +00:00
pancake
7dab05df70 Fix oobread in dwarf decls 2016-06-24 19:35:34 +00:00
Jeffrey Crowell
36650442f5 fix heap oob-read in dwarf parser
https://gist.github.com/4352a2f4a239a96b90e7b23bb22e8ef1
for repro file
2016-06-24 14:58:47 +00:00
Sven Steinbauer
2c086751b9 Add fsincos instruction [fix #5204] (#5205) 2016-06-24 15:08:52 +02:00
pancake
311a339473 Fix memleak in spawn swift-demangler 2016-06-23 17:46:37 +02:00
pancake
a55bcd628f Fix two swift demangler crashes and add tests 2016-06-23 17:11:17 +02:00
Joshua J. Drake
99678d2fe0 Fix return consistency and clarify variable naming (#5199) 2016-06-23 10:40:14 +02:00
Álvaro Felipe Melchor
efd4ece4c2 fix warning comparing unsigned int >= 0 2016-06-22 23:54:21 +02:00
Álvaro Felipe Melchor
d65889d15d add name to section when is empty 2016-06-22 23:51:33 +02:00
Álvaro Felipe Melchor
42e507ebfa comment out hackaround for huge number of sections 2016-06-22 23:51:31 +02:00
Álvaro Felipe Melchor
8e6b857cdf more work in PE loader 2016-06-22 23:51:27 +02:00
pancake
e4eb7e5ee9 Workaround for enum vs type swig hack 2016-06-22 19:43:19 +02:00
pancake
feff5b59e4 Do not use %p for ut64 values 2016-06-22 19:20:59 +02:00
Sven Steinbauer
995c952c5d Fix #5097 : mov instruction with rex regs
sil, dil, spl, and bpl, registers now supported
2016-06-22 13:04:23 +02:00
Sven Steinbauer
db76ef6497 Add bt instruction [fix #1277] (#5194) 2016-06-22 12:31:08 +02:00
pancake
aaf3ff314c Fix #5138 - crash in swift demangler 2016-06-22 11:08:51 +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
Sylvain Pelissier
50aed82b66 Add lfence, mfence and sfence to x86.nz (#5193) 2016-06-22 10:29:26 +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
pancake
bb00b4e91d Fix Android build, update Capstone and use Android's Studio NDK if available 2016-06-22 02:27:32 +02:00
Álvaro Felipe Melchor
8b957f8512 fix two uaf in anal.c 2016-06-21 23:32:40 +02:00
Álvaro Felipe Melchor
db28a0b20d fix hang in version info ELF 2016-06-21 16:42:34 +02:00