Commit Graph

17518 Commits

Author SHA1 Message Date
Khairul Kasmiran
524874fd6d Move Vpk hang regression fix into prevop_addr() 2018-12-18 15:31:10 +01:00
Khairul Kasmiran
25006e4bc7 Fix prevop_addr() no-anal solution when near 0 2018-12-18 12:59:16 +01:00
Khairul Kasmiran
a72de3cfef Fix pd -N start addr to be equal to so -N 2018-12-18 12:59:16 +01:00
pancake
d2133cbdf8 Fix V?? regression. Avoid tabs and ?y was deprecated a while ago 2018-12-17 16:48:29 +01:00
pancake
2cdbb8e785 Fix Vpk hang regression 2018-12-17 16:12:35 +01:00
radare
df480622f2
Fix issue in asm.hint.pos=0 (#12496) 2018-12-17 16:03:01 +01:00
radare
8fb9275f2a
Update cmd_type.c 2018-12-17 13:47:37 +01:00
radare
95d92d12dc
Fix for(int issue 2018-12-17 13:33:14 +01:00
radare
0ca4d00251
Implement support for nword in ahi ##anal (#12494)
- ahi0 == ahi
- any digit from 0 to 9 is valid
- test case:

	$ r2 -qcq - << EOF
	wx c7458843c6ff00
	pd 1
	ahi 10
	pd 1
	ahi-
	ahi1 10
	pd 1
	EOF

	mov dword [rbp - 0x78], 0xffc643
	mov dword [rbp - 120], 0xffc643
	mov dword [rbp - 0x78], 16762435

* Fix behaviour in ahi nword and assume nword is 0 by default
* Add VdI
2018-12-17 12:56:07 +01:00
pancake
276effe4f2 Properly fix the static build issue that caused generic build fail 2018-12-17 12:49:49 +01:00
iamahuman
a54dbe914b Support r2core.js for Emscripten >=v1.37.24 (#12502)
* Support r2core.js for Emscripten >=v1.37.24

cwrap needs to be exported explicitly via EXTRA_EXPORTED_RUNTIME_METHODS
+ allocate larger memory, allow for growth and no aborting malloc

* wasm_asm was wrongly also included in anal.wasm

This causes link errors where duplicate symbols aren't allowed.

* supply wasm plugin to suppress meta arch warning

r2 core initializes itself for the current architecture until one is
explicitly specified (e.g. loading a binary).  Since asm.wasm and
arch.wasm isn't supplied by default, r2 when built for WebAssembly
emits some ugly warnings when loading.  Besides, those modules
(incl. bin.wasm) aren't that large.

* r2core: Make it possible to know when init is done
2018-12-17 11:55:44 +01:00
radare
7060103292
Improve RBuffer api, start to refactor rbin to use more rbuf ##bin (#12495)
- Added a new rule in the DEVELOPERS.md file
2018-12-17 11:54:46 +01:00
radare
63fae31b1e
Implement ecoo and extend scr.rainbow into pd ##visual (#12499) 2018-12-17 11:04:11 +01:00
radare
4b10376904
Add hex.ascii config variable ##print 2018-12-17 02:17:45 +01:00
pancake
2e076185e3 Kill local IS_NUMBER macro 2018-12-17 00:53:11 +01:00
davidpolverari
63ddd4ab87 Fix quoting typo in libr/socket/run.c (#12491) 2018-12-16 21:46:34 +01:00
dav1901
ede39f120c Fix few build compiler warnings (#12490) 2018-12-16 14:54:40 +01:00
radare
a2cb135280
Support uneven columns in hex.cols and fix stack after scope issue in scr.rainbow ##print (#12488) 2018-12-16 10:04:58 +01:00
iamahuman
9ed24b16a3 Fix Emscripten support 2018-12-15 18:32:24 +01:00
iamahuman
51ab0994c6 Add missing net stub r_socket_accept_timeout 2018-12-15 18:32:24 +01:00
iamahuman
4462e73306 Move mipsasm from mips_gnu to mips_cs
Including mipsasm.o in mips_gnu prevents builds with plugin configurations
lacking libopcode (e.g. emscripten / static.nogpl) from working properly.
2018-12-15 18:32:24 +01:00
pancake
161f014369 Remove noisy warning in iso9660 2018-12-15 16:04:59 +01:00
pancake
6a2cec4d20 Add asm.hint.cdiv 2018-12-15 12:47:45 +01:00
Anton Kochkov
0d62ea62a6 Fix tc and afc commands ##types 2018-12-15 12:41:06 +01:00
Marco Milanese
82ed6388b6 Fix ESIL borrow flag handling for SUB/SBB on x86 ##anal
The `size` field represents the size in *bytes*.
2018-12-15 12:40:38 +01:00
pancake
4a83ba9dc0 Improvements for repeated Vd 2018-12-15 12:39:09 +01:00
pancake
2f176bdc61 Better asm.hints and support repeating in dw ##visual 2018-12-15 12:30:15 +01:00
radare
b641373b97
Fix #12482 - Unify asm.shortcut/asm.{lea,jmp}hints ##core (#12484) 2018-12-15 11:37:19 +01:00
pancake
3d5af19794 Fix leahints regression 2018-12-15 01:27:47 +01:00
radare
69778a4f95
Fix glitches in asm.shortcut=1|0 with and leahints ##disasm 2018-12-15 01:13:55 +01:00
Steven
26d1c3db9d Fix typo (#12481) 2018-12-15 00:13:13 +01:00
David CARLIER
bdc454215b Display all metas in current offset instead of just one ##analysis 2018-12-14 12:39:32 +01:00
pancake
077d01b006 Add magic headers for GPG symmetric crypto ##magic 2018-12-14 11:54:53 +01:00
dav1901
5b644dcb74 Minor cleanups/fixes (#12478) 2018-12-14 00:17:50 +01:00
David CARLIER
519c969e5c Fix #12473 - implement C. command ##meta 2018-12-13 15:49:59 +01:00
pancake
6125b9541e Fix visual leahints hotkeys ##disasm 2018-12-13 11:17:24 +01:00
radare
370d0fede6
Handle meta hints for dwords in visual disasm hotkeys ##disasm (#12472) 2018-12-13 02:35:35 +01:00
David CARLIER
75dfeeffc6 Various build compiler warning fixes attempts. (#12468) 2018-12-12 22:04:11 +01:00
Khairul Azhar Kasmiran
b6905cfc88 Fix so -N when no anal info available (#12469) 2018-12-12 22:03:32 +01:00
dav1901
3a24f6d8a1 Minor cleanups/fixes (#12467) 2018-12-12 22:02:32 +01:00
radare
78ee6c0896
Improve pds ##disasm (#12465) 2018-12-12 22:02:06 +01:00
Vanellope
616bc6c1ad Help message for Snow ##panels (#12466) 2018-12-12 15:29:49 +01:00
David CARLIER
6196093599 Few build compilation warning fixes. (#12464) 2018-12-12 13:25:44 +01:00
EvenCode
134ac4c962 Implement kj command 2018-12-12 13:24:07 +01:00
Vanellope
eb33d382f6 Snow is supported in Panels because it is winter ##panels (#12460) 2018-12-12 13:23:00 +01:00
pancake
a29759af72 Improve scr.rainbow in hexdump with hex.bytes=0 2018-12-12 13:20:50 +01:00
dreamist
f051f2b185 Add relocation search in disassembly jump substituion. (#12459) 2018-12-12 12:24:10 +01:00
dav1901
97b94b3f94 Fix more clang warnings (#12458) 2018-12-12 12:22:36 +01:00
pancake
2382f616b0 Fix p- to honor multiple regions ##print 2018-12-12 12:22:02 +01:00
pancake
4fee4c8eab Fix .in=io.maps, improving aap analysis (2052 vs 41 functions find) ##anal 2018-12-12 12:22:02 +01:00
pancake
ce99ae1139 Add hex.bytes to toggle px/pxx 2018-12-12 01:11:21 +01:00
Khairul Kasmiran
cd9097c5ef Visual 'k' honors asm.bb.middle 2018-12-11 18:17:51 +01:00
David Carlier
9c158c9e41 Fixing few leaks 2018-12-11 15:55:38 +01:00
pancake
006c9b9cda Fix hex header issue 2018-12-11 13:10:10 +01:00
Iain Lane
5549ad6160 Move #endif (HAVE_PTRACE) after functions which use it
When built with --disable-debugger, HAVE_PTRACE is not defined. The
function r_io_ptrace_func() is outside of an "#if HAVE_PTRACE" block and
uses ptrace_* functions. This causes a build failure because the
functions are only defined under HAVE_PTRACE.

Move the adjacent "#endif" for a HAVE_PTRACE guard to include this
function too.
2018-12-11 12:29:12 +01:00
Khairul Kasmiran
db71288fc3 Use entry.init0 instead of entry0.init 2018-12-11 11:10:07 +01:00
pancake
8ff572b26f Improve pxa, use more colors. honor VdF (pf format) 2018-12-11 11:07:59 +01:00
pancake
c07f0120e3 Optimize r_meta_find (~4x faster :D) ##performance 2018-12-11 11:07:59 +01:00
pancake
87cc1da85d Highlight the flagged bytes on hex.style ##print 2018-12-11 11:07:59 +01:00
pancake
22d05696de Add hex.style and grab flags, not just comments 2018-12-11 11:07:59 +01:00
dav1901
024d65e288 Fix few more clang warnings (#12429) 2018-12-11 10:28:01 +01:00
Young-X
c2cfa547f1 Fix leak introduced in b703dfbf17. (#12452)
Edition in commit b703dfbf17 for compute_calls in libr/core/cmd_anal.c
is wrong, since it leads to memory leak.

If xrefs is null, then r_list_free (xrefs) does nothing;
else, xrefs is set to null in if branch True, then r_list_free dose nothing.
Therefore, call to r_list_free is useless.
However, we should free xrefs in if branch True.

Signed-off-by: Young Xiao <YangX92@hotmail.com>
2018-12-11 09:23:18 +01:00
Ben Gardiner
31f03570cd Small msp430 improvements ##anal
* msp430: registers names for pc, sp, sr and cg
* msp430 initialize more default op fields
2018-12-11 03:17:39 +01:00
radare
8e8fe2e810
Fix aap for thumb ##anal (#12450) 2018-12-11 03:16:07 +01:00
condret
e424924c2a Fix #8054 - Update cpu flags in arm/thumb ADD/SUB ##anal 2018-12-10 22:05:13 +01:00
Amith Venugopal
768d31016c Implemented tc command as an alias for tuc;tsc;tec... ##types 2018-12-10 19:39:02 +01:00
radare
e9f5589a31
Implement hex.hdroff (disabled by default) ##print (#12443) 2018-12-10 19:37:25 +01:00
radare
ff87cc8029
Fix glitch in some graph shortcuts (#12445) 2018-12-10 18:19:00 +01:00
David CARLIER
e5c14c167b Fix #12417/#12418 (arm assembler heap overflows) 2018-12-10 16:42:02 +01:00
dav1901
db18c78456 Fix #11756 - Implement tsc and tuc ##types 2018-12-10 14:45:45 +01:00
dav1901
d067c16266 Fix more clang-analyzer warnings (#12427) 2018-12-10 14:41:38 +01:00
Khairul Azhar Kasmiran
2ebd956fdd Use separate counters for init, fini, preinit entries (#12441) 2018-12-10 14:35:41 +01:00
dav1901
9a91f96101 Fix realloc misusages (#12433) 2018-12-10 11:56:12 +01:00
David CARLIER
3aed538f7b Fiximg little clang warnings in various places. (#12439) 2018-12-10 11:55:35 +01:00
pancake
d8888bb312 Fix null assert in 2018-12-10 10:31:51 +01:00
Vanellope
61d28bb00b Better Hexdump support ##panels (#12432) 2018-12-10 00:04:46 +01:00
David CARLIER
384fe0f903 Silencing/fixing clang warnings. (#12430) 2018-12-10 00:04:21 +01:00
Khairul Azhar Kasmiran
7a12996f2e r_anal_bb_from_offset() honors anal.jmpmid (#12436) 2018-12-10 00:03:54 +01:00
pancake
fb55a230e3 Fix wasm analysis for the end instruction ##wasm 2018-12-09 00:26:05 +01:00
Vanellope
b9651f764c Remove mouse events thoroughly from panels ##panels (#12425) 2018-12-06 23:02:18 +01:00
David CARLIER
7bf0380e77 Further clang warning fixes (#12416) 2018-12-06 17:00:08 +01:00
dav1901
b88806f65f Fix more clang-analyzer warnings (#12424) 2018-12-06 16:55:09 +01:00
Álvaro Felipe Melchor
8ea9758b8e Remove logic from _CbInRangeAav when arch equal to arm/thumb (#12398)
It was assumed all the values were functions but that might not be
true and then wrong hints would be set.

This should be handled by ESIL which is the only one it will know whether
a call is gonna be made with the data under analysis.

The issue #12340 shows how data is wrongly interpreted.

const int a = 0x000103c9;

int main()
{
	int b;
	b = 2;
	b = b + a;
	return 0;
}

It gets translated to
┌ (fcn) main 56
│   main (int argc, char **argv, char **envp);
│           ; UNKNOWN XREF from entry0 (+0x34)
│           0x000103c8      04b02de5       str fp, [sp, -4]!
│           0x000103cc      00b08de2       add fp, sp, 0
│           0x000103d0      0cd04de2       sub sp, sp, 0xc
│           0x000103d4      0230a0e3       mov r3, 2
│           0x000103d8      08300be5       str r3, [local_8h]          ; 8
│           0x000103dc      1c209fe5       ldr r2, aav.0x000103c9       ; [0x10400:4]=0x103c9 aav.0x000103c9
│           0x000103e0      08301be5       ldr r3, [local_8h]          ; 8
│           0x000103e4      023083e0       add r3, r3, r2
│           0x000103ec      0030a0e3       mov r3, 0
│           0x000103f0      0300a0e1       mov r0, r3
│           0x000103f4      00d08be2       add sp, fp, 0
│           0x000103f8      04b09de4       pop {fp}
└           0x000103fc      1eff2fe1       bx lr
            ; DATA XREF from main (0x103dc)
            0x00010400      .dword 0x000103c9 ; main

There are other cases where they should be handled elsewhere like below

|       #   0x000102f8      0c009fe5       ldr r0, [0x0001030c]        ; [0x1030c:4]=0x103c8 main
|       #   0x000102fc      0c309fe5       ldr r3, aav.0x00010404       ; [0x10310:4]=0x10404 aav.0x00010404
|       #   0x00010300      ebffffeb       bl sym.imp.__libc_start_main ;[1]   ; int __libc_start_main(func main, int argc, char **ubp_av, func init, func fini, func rtld_fini, void *stack_end)
        #   0x00010304      f0ffffeb       bl sym.imp.abort            ;[2]   ; void abort(void)

r2 should handle __libc_start_main to detect those functions but aav
should not make those assumptions
2018-12-06 15:19:39 +01:00
Giovanni
973b8e703e Fix #12409 - wasm function ids and exports (#12414) 2018-12-06 15:19:15 +01:00
Vanellope
a6a234024a Minor fix when opening a new panel ##panels (#12419) 2018-12-06 15:18:40 +01:00
Khairul Azhar Kasmiran
2a25cddf41 Use size instead of section->size in section comments (#12423) 2018-12-06 15:18:28 +01:00
EvenCode
2150ffce75 Issue #12103 resolved (#12422) 2018-12-06 15:17:45 +01:00
Dan Robertson
e980677887 r_bin_dwarf_expand_*: fix memory error (#12411)
The use of memset to set the rest of the newly realloc'd buffer in
various r_bin_dwarf_expand_* functions was overwriting portions of
the buffer that had previously been written to.

The functions including said error were the following:

 - r_bin_dwarf_expand_die
 - r_bin_dwarf_expand_cu
 - r_bin_dwarf_expand_abbrev_decl
 - r_bin_dwarf_expand_debug_abbrev
2018-12-06 15:12:47 +01:00
dav1901
3b03e923f5 Fix few clang-analyzer warnings (#12415) 2018-12-06 15:12:27 +01:00
dav1901
ab17935659 Fix clang warnings (#12413) 2018-12-05 12:35:37 +01:00
Vanellope
01614a9720 Cleaned up some macro ##panels (#12410) 2018-12-05 12:32:07 +01:00
David CARLIER
9e20fe9bbb Various mem leak fixes (#12400) 2018-12-04 17:23:09 +01:00
Vanellope
b6f2ebb20b Boolify caching param and fixed a bug of loading saved layout, plus added afvW and afvR in menu ##panels (#12401) 2018-12-04 16:09:54 +01:00
dav1901
cdaa507e15 Fix more clangs (#12399) 2018-12-04 16:09:18 +01:00
dav1901
3ca357b182 Fix few clang warnings (#12394) 2018-12-04 14:19:30 +01:00
radare
bbebd7ed86
Fix aaa issue in NSO bins which use io.cache (#12396) 2018-12-04 12:50:09 +01:00
pancake
5df3872b9d Boolify r_cons_yesno() 2018-12-04 12:49:43 +01:00
Vanellope
7653c2eda9 Creating a panel from the menu inquires the user for cache ##panels 2018-12-04 12:48:42 +01:00
dav1901
083810065c Fix few leaks in asn1 strings 2018-12-04 11:45:45 +01:00
radare
a3d181a8a0
Fixes spotted by clang-analyzer (#12391) 2018-12-04 10:45:46 +01:00