Commit Graph

17434 Commits

Author SHA1 Message Date
Riccardo Schirone
baf9305ea2 Warn fixes (#12360)
* Remove unused variable from __io_attach
* Avoid using empty string with snprintf, just set \0
2018-11-30 12:09:01 +01:00
Luca Di Bartolomeo
acbbfd80de Cut flags inbytes string if too long (#12356) 2018-11-30 10:44:16 +01:00
pancake
f95ca48fba Fix double free 2018-11-30 10:42:10 +01:00
Khairul Azhar Kasmiran
5a0a03e62f Show segment comments if there are no sections (elf only) ##disasm 2018-11-30 10:36:45 +01:00
pancake
7d8bfc462e is_pure -> is-pure 2018-11-29 18:11:17 +01:00
David CARLIER
138ca20e27 Couple of mem leak fixes. (#12355) 2018-11-29 17:04:24 +01:00
bart1e
20a4168548 Detecting pure functions and add afip command ##anal 2018-11-29 17:00:26 +01:00
Florian Märkl
a906b41a46 Rename r_str_escape_utf8_to_json to ...for_json 2018-11-29 16:55:01 +01:00
Florian Märkl
8ae78d75dd Fix escaping string flag name for pdJ ##disasm 2018-11-29 16:55:01 +01:00
pancake
956b7f6209 Fix assert in rva when loading android elfs 2018-11-29 16:11:36 +01:00
pancake
141f7b03d0 Aim to fix the msc build of the updated bin-demangle 2018-11-29 11:41:22 +01:00
Vanellope
7083154dbf Set the core offset right and update the panels correctly when scrolling disassembly##panels (#12348)
* Stop the partial update and set the core offset right, plus some refactorings ##panels
* Graph and Pseudo can be updated with L command
2018-11-29 11:40:52 +01:00
David CARLIER
5dbff4a8f1 Little type correction/panels. (#12353) 2018-11-29 11:22:44 +01:00
dav1901
cc26fd73ba Minor fixes/cleanups (#12349) 2018-11-29 11:22:32 +01:00
pancake
22a880cbc9 Fix #12350 - Upgrade the c++ demangler from 2011 to 2018 2018-11-29 11:20:45 +01:00
pancake
52e614035e Fix #12336 - Handle asm.cpu in the CRIS disassembler 2018-11-29 11:01:23 +01:00
David CARLIER
8442d462b5 Fix few memory leaks/panels (#12347) 2018-11-29 10:43:47 +01:00
pancake
bd4bfbc6f3 Add clock_nanosleep configure check 2018-11-28 17:08:09 +01:00
pancake
246fe4e10b Fix compile-time breakpoints for arm<6 2018-11-28 16:53:38 +01:00
pancake
214baa4856 Fix null deref in RSocket.free when compiled with SSL 2018-11-28 11:53:27 +01:00
David CARLIER
ae8b001447 C++ RTTI classes info ita64 leak fixes. (#12339) 2018-11-28 09:31:31 +01:00
David CARLIER
ef8e2c86fb Simplification self plugin for BSD. (#12341) 2018-11-28 09:30:52 +01:00
Vanellope
c32083fae7 Fix panel’s z key 2018-11-28 09:29:04 +01:00
pancake
13d5fcdd87 Fix msp430 disasm and warnings 2018-11-27 16:43:13 +01:00
David CARLIER
260a9e64cc Couple of leak fixes, div by zero avoidance. (#12338) 2018-11-27 15:46:56 +01:00
Riccardo Schirone
752f37db4c Fixes for the --without-debugger compilations ##build
* io_ptrace: do not include io_ptrace if DEBUGGER is not defined
* meson: add `debugger` option to not use any debugger
2018-11-27 15:46:35 +01:00
pancake
c83d5f4664 Handle asm.syntax and call jump/fail for msp430 ##disasm 2018-11-27 15:38:26 +01:00
pancake
053d37f4dd Identify arch in MSP430 ELFs ##bin 2018-11-27 15:27:57 +01:00
pancake
81583efa05 More goodies for breakpoints and kill r_sys_trap 2018-11-27 11:58:11 +01:00
dav1901
4dd54e8f06 Implement tu* without args ##types 2018-11-27 10:54:33 +01:00
pancake
842dadc41d Add mips software breakpoint in the macro 2018-11-27 10:19:07 +01:00
Maijin
5cd427e91c Add ThunRTMain as noreturn ##anal 2018-11-26 23:53:09 +01:00
Vanellope
489d4dc99a JK is for quick scroll and refactor help messages ##panels 2018-11-26 23:23:43 +01:00
lzutao
becc3000a8 Change unneeded global static vars to local static (#12324) 2018-11-26 23:21:19 +01:00
Francesco Tamagni
761f6e64ad Update dyldcache to support v1 rebasing (#12331) 2018-11-26 23:18:43 +01:00
pancake
b84cbd5434 Fix linux-arm64 build 2018-11-26 05:32:28 +01:00
pancake
545efb319b Strictier CLOCK_MONOTONIC check and fix 2 warnings 2018-11-26 04:06:42 +01:00
radare
f6d374de54
Fix ANSI injection vulnerability in pd and pdj ##disasm 2018-11-26 01:47:25 +01:00
Alex Kornitzer
35363f3885 ta command now takes an optional offset argument ##types
* types: allow an offset to be set for the struct itself

Not all pointers to structs start at the beginning, thanks Microsoft
with your implementation of list entries. Therefore this commit allows
you to tweak the 'entry point' to the struct when using the ta command.
NOTE: Annoyingly this file is formatted badly so there are lots of
additions due to linting!

* ctype: handle nested structs in get_struct_memb

r_type_get_struct_memb will now parse inline structs rather than
incorrectly bailing out

* types: apply changes from review #12322
2018-11-26 00:04:30 +01:00
David CARLIER
8c7a56d98a Fix few leaks from reformatting sections/symbols names. (#12321) 2018-11-25 20:46:13 +01:00
radare
d34af95fae
Fix agc (only show call refs, not data) (#12315) 2018-11-25 14:40:20 +01:00
Khairul Azhar Kasmiran
6e7f980ee8 afi refs: remove trailing space (#12318) 2018-11-25 14:39:00 +01:00
dav1901
c7e6735105 Prevent double freeing (#12319) 2018-11-25 14:37:37 +01:00
Khairul Azhar Kasmiran
f1fee53ae0
Add missing space in afi locals (#12317) 2018-11-25 13:05:37 +08:00
David CARLIER
e339ef558b Fix #12307 - Escape ansi chars in cbin ##visual 2018-11-25 02:43:06 +01:00
pancake
ef997d8697 Vx supports mouse wheel now 2018-11-25 02:20:36 +01:00
pancake
8eb77d85ff Cleanup the visual xref code 2018-11-25 02:13:28 +01:00
pancake
272d01784e Add fcnInsteadOfAddr arg for proper xX in visualRefs from V, Vb and VV 2018-11-25 01:55:46 +01:00
BlaCoiso
0b582468ef Update output.c (#12314) 2018-11-25 01:47:11 +01:00
dav1901
a6b44e03fe Fix warnings (#12309) 2018-11-25 01:46:57 +01:00
pancake
bc322ac9cf Fix #12313 - Vbv is not VbF 2018-11-25 01:23:33 +01:00
BlaCoiso
2af904856f Fix mount shell and ed commands (#12312) 2018-11-24 22:52:08 +01:00
ahroach
2a071737c2 Fix typos in avr.sdb 2018-11-24 04:13:11 +01:00
pancake
becc6a5fab Trim refname if it exceed the screen width 2018-11-24 02:52:41 +01:00
David CARLIER
c504572cfa Further cleanup-code/less "optimistic" assumptions. (#12298) 2018-11-23 23:18:40 +01:00
Riccardo Schirone
356ff9a7ff Fix cursor when following refs/xrefs with \n in visual mode (#12304)
Commit cc9d361dd3 only partially solved
the issue. The same should have been done for \n, \r, ' '. This patch
refactors the code to be sure both cases do the same thing.
2018-11-23 21:00:18 +01:00
Khairul Azhar Kasmiran
0d74e2f51a Fix #12300 - Remove spurious xrefs to fcn addr (#12302) 2018-11-23 20:50:34 +01:00
dav1901
ef42e5a205 Fix few more covs (#12303) 2018-11-23 20:50:23 +01:00
bart1e
191ef84f03 Small code cleanups in fcn.c (#12299) 2018-11-24 00:40:07 +08:00
dav1901
c82049aaad Fix two minor warnings (#12296) 2018-11-23 13:54:28 +01:00
pancake
1c83de1e54 pF shows help instead of NYI 2018-11-23 13:53:18 +01:00
David CARLIER
2308897b3a Further meson warning build fixes. (#12290)
While here attempt fixing #12278 old version of file/libmagic.
2018-11-23 16:21:11 +08:00
pancake
c1fa170503 Improve the Visual xrefs with from/to disasm and handle JK ##visual 2018-11-23 03:07:34 +01:00
pancake
25603aa61c Fix #12292 - assert in r2 -coo -d ls 2018-11-23 02:06:28 +01:00
radare
efeca81167
Fix overflow in aac and assert in r2 -AAA /bin/ls on Mojave (#12291) 2018-11-23 01:55:48 +01:00
Luca Di Bartolomeo
59d0685b70 Fix #11427 - Crop output in vertical split in visual mode to avoid overflow 2018-11-23 01:15:05 +01:00
Luca Di Bartolomeo
a12549c43f Fix asm.flags.inbytes not showing in graph ##graph
* Added graph.bytes config option to show opcode bytes in graph
* Show bytes in graph if asm.flags.inbytes is set
2018-11-23 01:13:15 +01:00
pancake
24ae15c8bb Fix assert in ntoskrnl 2018-11-23 00:45:29 +01:00
pancake
c9a4142abb Fix maijins assert 2018-11-23 00:41:33 +01:00
pancake
11fcc3badc Fix macOS debugger slowdown regression introduced in 3b81610 2018-11-22 23:49:10 +01:00
Riccardo Schirone
cc9d361dd3 Reset cursor when using refs/xrefs in visual, otherwise it gets summed (#12277) 2018-11-22 22:21:06 +01:00
radare
d05292e485
Fix 80 warnings coming from gcc8.2 (#12280) 2018-11-22 22:11:43 +01:00
Álvaro Felipe Melchor
23d01f869c Improvements arm/thumb analysis ##anal
* anal: arm: emulate correctly BX PC in arm32/thumb ##anal
* anal: arm: handle BX PC in analysis to propagate bits

PC is well known without ESIL, that way it is possible to propagate the
bits to correctly create the hints

* anal: arm: modify r_anal_build_range_on_hints ##anal

This function now accepts a second parameter that specify when to
dispose hints when overlapping.

The rationale is that if this is performed in a continuos basis, old
ranges are lost when in a latter stage in the analysis is inserted a new
hint.

For example, if we have something like

0x80000 -> 16 bits
0x82000 -> 16 bits

With the previous logic this would have been become

0x8000 -> 16 bits

However, during analysis a new hint like this might happen

0x8100 -> 32 bits

Therefore, 0x8200 which was 16 bits is lost.  With the second parameter
update, we postpone this until the user print the disassembly - we wait
until the end to clean up hints to speed up the looks up. However,
during analysis we mantain all the hints.

* anal: arm: handle better anal hints to increase performance ##anal

new API r_anal_hint_get_bits_at

This saves time for example on r_anal_build_range_on_hints without the
need to use heap for RAnalHints speeding up the analysis

Added cb when calling r_anal_hint_set_bits and rbtree for anal ranges
which improves lookups

fix __anal_range_tree_find_bits_at

fix conflicts and coding style

* arm: set anal hint when BL instruction
2018-11-22 21:31:54 +01:00
radare
9279231918
Fix #12202 - Add asm.maxflags to specify how many flags per offset we want to see ##disasm (#12283) 2018-11-22 21:21:39 +01:00
radare
d0e6a692cb
Move the fcn refs visual feature into the view instead of adding more keys ##visual 2018-11-22 21:20:47 +01:00
pancake
e2542082f1 Refix visual graph 2018-11-22 17:36:55 +01:00
radare
40c2fecfeb
Use r_return in RAnalOp, reduce some code paths in xrefs search ##anal (#12263) 2018-11-22 16:24:04 +01:00
pancake
e821230045 Fix last covs 2018-11-22 16:19:25 +01:00
Khairul Azhar Kasmiran
b703010171 Visual 'j' honors asm.bb.middle (#12274) 2018-11-22 15:48:11 +01:00
pancake
6b9a8ee0ce Fix warnings 2018-11-22 15:41:33 +01:00
pancake
173333b3e5 Fix #12230 - Honor cursor in Vp xX ##visual 2018-11-22 15:17:47 +01:00
pancake
a4618a7010 Implement , and ; in pf to rewind and be able to support unions ##print 2018-11-22 15:17:47 +01:00
dav1901
a18fe42d96 Minor cleanups/fixes (#12256) 2018-11-22 15:14:59 +01:00
Riccardo Schirone
300844fa51 Introduce RBinArchOptions to avoid creating fake RBinFile/Objects ##bin 2018-11-22 15:14:37 +01:00
pancake
90f28ef3bd Make travis green 2018-11-22 15:08:39 +01:00
pancake
5fd1179f9a Fix #12258 - Fix glitches in VV with |= aka cmd.gprompt ##visual 2018-11-22 13:18:07 +01:00
pancake
ef67aefbc2 Fix minor warnings 2018-11-22 12:23:46 +01:00
Mathieu Tarral
a4bb80b8d1 Restore fd when loading symbols from file with oba (#12269) 2018-11-22 12:02:00 +01:00
Mathieu Tarral
8bcfc7bcbd fix help message of oba command (#12270) 2018-11-22 18:40:31 +08:00
Florian Märkl
523aafa359 Replace r_str_utf16_encode() for escaping strings for json (#12259) 2018-11-22 10:55:21 +01:00
radare
f17bfd9f1d
Fix #12242 - Crash in x86.nz assembler (#12266) 2018-11-22 10:48:39 +01:00
pancake
2aaeb80ac4 Fix newline in error message 2018-11-22 03:50:50 +01:00
radare
97bba0521d
Support REX in NOT instruction for the x86 assembler ##asm 2018-11-21 22:36:12 +01:00
Luca Di Bartolomeo
826d584405 Fix #11889 - Fix varsub when some ansi escape sequences are involved ##disasm
- findNextNumber to parse bold ascii escapes
2018-11-21 22:35:48 +01:00
Khairul Azhar Kasmiran
9cc8f6daf7 Rename skip_bytes to skip_bytes_flag (#12253) 2018-11-21 17:54:38 +01:00
Riccardo Schirone
4b7f8313e1 Fix some COVs (#12255) 2018-11-21 17:53:20 +01:00
radare
66191f7808
Fix #12239 - crash in the x86.nz assembler ##asm (#12252) 2018-11-21 17:50:58 +01:00
pancake
6d7ed2605c Fix crash in 'r2 -cww' byebye' --' 2018-11-21 16:28:28 +01:00
pancake
df151d0b1c Remove >>0 because thats a warning in C++ 2018-11-21 13:55:09 +01:00
dav1901
9bcfc5cc20 Fix few covs (#12251) 2018-11-21 13:34:43 +01:00
Riccardo Schirone
f66d965587 Access last ElfSymbol only after reallocating the array ##bin 2018-11-21 10:34:48 +01:00
pancake
0c9c615123 Add emscripten target for the cxx demangler 2018-11-20 22:58:27 +01:00
dav1901
9413169623 Minor cleanups/fixes (#12247) 2018-11-20 17:50:26 +01:00
Riccardo Schirone
0cb3d7cf2d Get cursor position only if screen_bounds == 1 ##visual 2018-11-20 17:26:32 +01:00
Riccardo Schirone
f4bf35cc16
sync sdb to a3463734c6d656ab174b32ba0b64e77475edae29 (#12244) 2018-11-20 16:50:28 +01:00
sivaramaaa
a4a3071fb3 axt with a space handles local var xrefs ##anal 2018-11-20 11:16:19 +01:00
pancake
507b1e1ca1 Initial ESIL support for WASM ##wasm
* Added basic register profile
* WIP: Resolve function calls from RBin via RCore.cmd
2018-11-20 11:09:12 +01:00
pancake
11c6fbc95a Fix VJ scrolling stuck issue ##visual 2018-11-20 11:09:12 +01:00
Amith Venugopal
4981ba1b14 Add ttc and tec in "tt?" and "te?" respectively. 2018-11-20 10:44:20 +01:00
Riccardo Schirone
d5c8b91c0b
fix some covs (#12238) 2018-11-20 10:15:18 +01:00
Giovanni
dd84bfe3de Fix #12194 - Resolve symbol names in WebAssembly bins ##bin 2018-11-20 01:19:23 +01:00
David CARLIER
033e073c4e Little warning build fixes (#12232) 2018-11-20 01:13:54 +01:00
Florian Märkl
7c0687b8fb Fix #12022 - Slow backtrace fixed by speeding up ptrace_wrap_func() ##debug 2018-11-20 01:13:30 +01:00
dav1901
8e7aea3198 Minor cleanups (#12231) 2018-11-19 22:55:34 +01:00
radare
5f270658c5
New RBin plugin for "symbols" files ##bin 2018-11-19 22:54:58 +01:00
Amith Venugopal
0f23f98c6c Implemented tec command ##types 2018-11-19 22:30:41 +01:00
Khairul Azhar Kasmiran
ef9ddac95e Simplify r_anal_fcn_add_bb() (#12226) 2018-11-19 21:09:27 +01:00
radare
c042d3e136
Fix echo in ppc disassembler on invalid instructions ##disasm 2018-11-19 18:24:25 +01:00
radare
50801791e2
Fix #9825 - Wrong import addresses in the ELF for ppc64 elfs ##bin 2018-11-19 18:24:10 +01:00
dav1901
23fb5bc197 Fix minor leak (#12220) 2018-11-19 16:22:33 +01:00
Khairul Azhar Kasmiran
389f4ddffe Honor asm.bb.middle in r_core_print_disasm_instructions() ##disasm 2018-11-19 16:21:52 +01:00
radare
f0ac280d17
Fix #11714 - VJ not working sometimes (#12217) 2018-11-19 14:44:54 +01:00
dav1901
c7fc809bd7 Minor dead code cleanups (#12203) 2018-11-19 13:00:53 +01:00
sivaramaaa
fa6cbec50b Fix #9709 - Implement aeab to get input and output regs of the basic block ##anal 2018-11-19 11:16:20 +01:00
Riccardo Schirone
9ea01145fe bin/elf: make strttabaddr a ut64 (#12214) 2018-11-19 11:13:45 +01:00
radare
f2ce982aeb
Fix #12188 - Remove unused variable and fix 1->l 2018-11-19 11:13:09 +01:00
David CARLIER
9931f0f35c Fix #12151 - unaligned acess in pic 2018-11-19 02:59:11 +01:00
Amith Venugopal
b9b32f072d Add ttc - dump types in C syntax ##types 2018-11-19 02:47:36 +01:00
Ayman Khamouma (ak42)
4dede6866e Fix r_core_anal_graph_to and abt, abtj commands ##anal 2018-11-19 02:35:23 +01:00
dav1901
cc7023dae8 Fix null deref in RAnal.java 2018-11-19 02:17:57 +01:00
Khairul Azhar Kasmiran
3d2058591f r_core_disasm_pdi() honors asm.bb.middle (#12204) 2018-11-19 02:16:54 +01:00
radare
4aacf78447
Fix some bugs in RBin.mdmp ##bin 2018-11-19 02:15:19 +01:00
Khairul Kasmiran
6d0f9ce282 Combined 2 assignments 2018-11-18 13:59:05 +08:00
David CARLIER
f21f38a255 Fix #12166 - Implement tt* to list all types at once ##types 2018-11-17 22:47:34 +01:00
Riccardo Schirone
015ed58426 ELF plugin code cleaning ##refactor
* clang-format-diff: do not put space after Elf_
* bin/elf: remove warning because it's already printed by R_LOG_WARN
* bin/elf: rename get_static to is_static
* bin/elf: a bit of refactoring in init_dynamic_section
* Revert "bin/elf: other cleaning"
This reverts commit e39af6f69e.
* bin/elf: cleaning in r_bin_elf_get_sections
* bin/elf: refactor a bit get_sections_from_phdr
* bin/elf: fix create_section_from_phdr
* bin/elf: small style fixes in get_boffset
* bin/elf: simplify the code by using READWORD instead of #if/#else
* bin/elf: fix read_phdr because you need to pay attention to the order
2018-11-17 22:45:49 +01:00
Khairul Azhar Kasmiran
d51b4bbb5f Enable pirj (#12198) 2018-11-17 18:20:05 +01:00
p2mate
f074d51bf9 Remove deprecated load methods from MZ parser ##bin 2018-11-17 18:19:39 +01:00
dav1901
558a79cae7 Fix few minor leaks and remove dead code (#12201) 2018-11-17 18:19:04 +01:00
Amith Venugopal
36bedf1131 Add ttj in tt? 2018-11-17 03:52:45 +01:00
Khairul Azhar Kasmiran
d1ef5faef8 func_walk_blocks() ignores asm.bb.middle (#12193) 2018-11-16 16:38:36 +01:00
Amith Venugopal
b0b0bbd846 Fixed ttj feature for printing in JSON ##anal 2018-11-16 16:38:13 +01:00
Riccardo Schirone
b93656e8fa Do not try to set the current binfile if it cannot be find 2018-11-16 10:32:24 +01:00
pancake
6db6c86dae Set as dword all the jmptbl offsets ##anal 2018-11-16 10:25:11 +01:00
pancake
b8deafe0a8 Handle libr/libs.custom.mk to make partial r2 builds if you need just a portion of r2 ##build 2018-11-16 08:37:47 +01:00
pancake
712fca842c Improve the support for emscripten asm.js/wasm 2018-11-15 22:49:52 +01:00
Riccardo Schirone
8a6348b692
Fix another assert when printing blocks (#12173)
* Do not NULLIFY the result if the list is empty when getting boundaries

An empty list is different than a NULL return value. The caller has to
call r_list_free anyway on the returned list, so there's no real
advantage in returning NULL, it just makes the caller's life harder
because it cannot understand if NULL is returned because the list was
empty (e.g. there are no IO maps, etc.) or because there were some
errors.

* Check for NULL and exit if so, that's an error.

* Check r_core_get_boundaries_prot return value for NULL
2018-11-15 19:35:47 +01:00
pancake
913a8563fe Improve the visual titlebar in cursor is enabled ##visual 2018-11-15 19:09:36 +01:00
pancake
f5ae9bb5b8 Change the behaviour of V< and V> to make it slurp or dump files ##visual 2018-11-15 19:09:36 +01:00
pancake
cb15913a70 Initial support for key repetitions in visual mode ##visual
* V3l is the same as Vlll, also works in cursor mode
2018-11-15 19:09:36 +01:00
pancake
cb11c0a329 Add help for wtf? 2018-11-15 19:09:36 +01:00