Commit Graph

20679 Commits

Author SHA1 Message Date
radare 72093ac706
Fix #16138 - Do not preincrement when it's not necessary (#16151) 2020-03-05 19:06:59 +01:00
radare a044c3e0e2
Remove cmdtail usage from walkthrough_arm_jmptbl_style() (#16140) 2020-03-05 19:06:47 +01:00
radare e37a2e1b9c
Fix UAF in om= (#16149) 2020-03-05 18:07:03 +01:00
radare d96120799d
Added size info to anal classes (#16129) ##bin 2020-03-05 18:06:27 +01:00
pancake d5fe33b92e Fix wopD 2020-03-05 15:48:23 +01:00
radare 1be8f02906
Add test for r_reg_get_value() and r_reg_set_value() (#16136) ##test 2020-03-05 14:42:47 +01:00
radare 0cacc6e829
Fix file reopen in debug mode ood/doo (#16131) ##debug 2020-03-05 14:42:32 +01:00
radare 5e1d5faebd
Support iter_hit_command and update radare2-shell-parser (#16132) ##core 2020-03-05 14:41:37 +01:00
radare d502dcc8cd
Deprecate cmdtail and kill r_anal_case() (#16139) 2020-03-05 13:28:56 +01:00
Florian Märkl 4271bce56a
Remove RAnalFunction.loc (#16134) 2020-03-04 20:13:40 +08:00
Riccardo Schirone cf9e1d5327
Fix compilation with capstone3 (#16133) 2020-03-04 20:11:58 +08:00
pancake eef255a8ba Fix build on pre-c99 compilers 2020-03-04 11:59:34 +01:00
pancake bb78ef3457 Drop the reset attributes on newlines 2020-03-04 02:10:07 +01:00
pancake bd1cad9b38 Fix build 2020-03-04 01:00:49 +01:00
pancake 7bedf42af1 Fix #15211 - null deref in calling convention analysis 2020-03-04 00:37:17 +01:00
radare 33f2e9bed6
Fix again the EOL bgcolor issue (and improve scr.html) (#16120) ##cons 2020-03-04 00:09:12 +01:00
radare db39ca95c0
Implement ecHj to list highlight rules in json format ##cons
Authored-by: Rishi Bhatt <bhattrishi8@gmail.com>
2020-03-04 00:08:39 +01:00
Paul I e345e7d829 Fix memory leak in core_anal_bytes() 2020-03-03 22:48:34 +01:00
Paul I 993cbf48c4 Fix memleak in anal_mask() method of arm_cs plugin 2020-03-03 22:48:14 +01:00
pancake ee8c6e23a5 Fix assert joining null lists in flirt 2020-03-03 22:47:49 +01:00
pancake dd9d36c10f Fix regression in compiler identification 2020-03-03 18:42:20 +01:00
pancake 0d776be8f9 Add new BIND_OPCODE_THREADED constant for MACHO binaries (arm64e) ##bin 2020-03-03 18:36:30 +01:00
Florian Märkl ca84c970c3 Fix some UAF, Overflows and Fcn API Usage in FLIRT (Fix #16104) 2020-03-03 18:36:17 +01:00
Drew McGowen b399e42335
Cleanup RAnalOp after disassembly (#16113) (#16118) 2020-03-03 18:34:51 +01:00
pancake cffb724bab Fix crash in elf parser found in the mtk-su binary with asan 2020-03-03 15:07:57 +01:00
Riccardo Schirone d88a76d2df
tree-sitter: support iter commands (#16111) ##core
* radare2-shell-parser: shrink to single-command output when substituing

Before this patch, when substituing arguments the entire input string
was considered, making the process potentially slow if the input was
long. With this patch, substitute_args and parse_args work on a shrinked
version of the input, which includes only the current command.

Not only it improves performance, but it also prevents issues where
other non-related parts of the input string could be replaced during
apply_edits.

* radare2-shell-parser: implement some iter commands
* Add support for number_command and recursive help
* cmd_ignbithints should be set everywhere for consistency
* Save rnum->value before doing a cmd substitution
* Update radare2-shell-parser to fix null deref in html_disable_command
2020-03-03 12:42:38 +01:00
radare b82b24c135
Fix last coverity issues (#16114) 2020-03-03 12:41:32 +01:00
Paul I d573241c47
Make r_strbuf_fini() safer (#16115) 2020-03-03 12:41:19 +01:00
radare f74dd31440
Fix debugger build on Linux/s390x ##build (#16105) 2020-03-03 00:03:43 +01:00
Drew McGowen cd3a2972b8 [ppc] Only free op->esil if ESIL not requested (#16102) 2020-03-02 23:52:06 +01:00
radare f70702c299
Fix #16093 - support syscall redefinition in REgg (#16106) 2020-03-02 23:46:22 +01:00
radare 5e629a3260
Avoidify the strTrim() APIs + cleanup/refactor ##util (#16056) 2020-03-02 21:39:37 +01:00
radare cf1e7d9a68
Fix #16096 - Fix C warnings in the ELF parser (#16100) 2020-03-02 19:34:29 +01:00
Zi Fan 2a5ca0ae60
Add Windows Crash Dump format support (#16087) ##bin 2020-03-02 19:20:27 +01:00
Florian Märkl 9e713900e5
Fix a null-deref in afn (#16091) 2020-03-02 14:34:58 +01:00
kuqadk3 53f21d9ae6
Fix #14647 - Add output of sections to segments mapping for ELFs (#16045)
Add output of sections to segments mapping for ELFs
2020-03-02 13:44:49 +08:00
Florian Märkl 04cec0e5e9
Fix FLIRT v9 loading and some related issues (#16083) 2020-03-02 13:41:05 +08:00
Khairulmizam Samsudin ae1ef3ffbe
Create RReg test unit (#16081)
* Add test for r_reg_set_name() and r_reg_get_name()
* Add test for r_reg_set_profile_string()
* Add test for r_reg_setv() and r_reg_getv()
2020-03-02 13:39:47 +08:00
Paul I e32686931d
Fix some anal cmd handlers (#16085) 2020-03-02 13:39:08 +08:00
Florian Märkl 5ad486923e
Make Strings in RIOPlugin const char * (#16080) 2020-03-01 15:00:11 +01:00
Paul I c017695b88
Fix memory leak in r_config_hold_num_free() (#16079) 2020-02-29 23:39:12 +01:00
Paul I 0e62dda341
Fix fgets() usage (#16068) 2020-02-29 20:47:10 +01:00
David CARLIER a17179a379
Memory leak fix proposal into the LE parser. (#16077) 2020-02-29 19:31:11 +01:00
Florian Märkl 9672967a45
Rename the Function Flag on afn (#16078) ##anal 2020-02-29 19:30:09 +01:00
Riccardo Schirone ed8c0291e2
Fix build after last commit (#16076) 2020-02-29 08:49:55 +08:00
pancake 5b8366441d Fix last covs 2020-02-28 17:38:51 +01:00
radare 6ae8806411
Do not use the elvis operator for bool expressions (#16073) 2020-02-28 15:19:37 +01:00
Khairulmizam Samsudin 2bd738abbd
Fix r_table_tostring for string with ansi escape code (#16069) ##cons 2020-02-28 14:43:38 +01:00
Florian Märkl 6604006629
Fix null-deref on afv[rbs]-* without function (#16071) 2020-02-28 12:00:07 +01:00
Khairulmizam Samsudin 2afe6ea71b
Use RString and minor cleanup (#16070) 2020-02-28 11:41:27 +01:00
radare 12495ec098
Fix #16063 - bgcolor not reset on newlines ##cons (#16064) 2020-02-28 11:34:36 +01:00
pancake 2bd7459f71 Initial implementation of the 'rb' command to rebase all the things ##core 2020-02-28 01:55:23 +01:00
Khairulmizam Samsudin 5c26bacac8
Use RTable API in r_core_debug_rr (#16066) ##debug 2020-02-28 01:07:58 +01:00
Florian Märkl 204e038211
Fix r_cons_rgb_parse() harder (#16061)
Also fix init of some ret args in r_meta_print()
2020-02-27 20:13:34 +01:00
radare a836f9c694
Fix 'af' missing lines bug when analyzing in frida://0 ##anal (#15953)
* Boolify try_walkthrough_jmptbl
* Add R_ANAL_RET_NOP constant
* Add test case
2020-02-27 12:28:58 +01:00
karliss ed12f89868
Replace O(n2) ELF symbol matching with hashmaps (#16052)
* Replace O(n2) ELF symbol matching with hashmaps

* Swap loop order to ensure that all phdr_symbols are marked.

* Use name, size and offset as hashmap keys.
2020-02-26 20:22:53 +01:00
Maxim Ivanov ae07700055
Preserve "functions" flagspace when saving projects (#16057) ##projects 2020-02-26 17:37:23 +01:00
Khairul Azhar Kasmiran 74d832d0b9
Add [?] to fd help entry (#16058) 2020-02-26 14:24:12 +01:00
Florian Märkl fd23790d3c
Minor Fixes and Tests for NSO/NRO (#16053) ##bin
* Add some very basic tests for NSO/NRO
* Remove broken readLE* functions from NSO/NRO
2020-02-26 11:18:10 +01:00
Anton Kochkov 9ae41ae69f
Revert "Avoidify the RUtil.strTrim() APIs, rename trimHeadTail() and add asserts in RConfig ##refactor" (#16055)
This reverts commit 38b61c7bcf.
2020-02-26 09:59:04 +08:00
Roman Valls Guimera b26a3ac19e
Remove stray pancake activity ;) (#16054) 2020-02-26 09:03:21 +08:00
radare 38b61c7bcf
Avoidify the RUtil.strTrim() APIs, rename trimHeadTail() and add asserts in RConfig ##refactor 2020-02-25 17:53:09 +01:00
radare 307fb50c24
Fix a segfault in libmagic when error string > 4096 (#16050) 2020-02-25 15:55:00 +01:00
XYlearn 9e85a9201a
Fix address representation minbound maxbound in afij (#16051) 2020-02-25 15:54:40 +01:00
Khairulmizam Samsudin 3ed91d6e83
Fix consecutive call to r_table_sort (#16049) ##refactor
* Fix r_table_sort
* Force sorting of rows in the event of consecutive sort
* Remove global Gdec and use r_list_reverse for decreasing sort
* Add test for r_table_tostring and r_table_sort
2020-02-25 11:05:06 +01:00
Khairulmizam Samsudin f3f5d5699a
Fix r_table_sort segfault when column type is NULL (#16047)
* Rename argument to 'dec' (decreasing) to reflect existing output
* Add test
2020-02-25 02:28:19 +01:00
Zi Fan 97498c377c
Fix iS hash outputs (#16044) ##bin
* Refactor bin_sections function
* Add filter_hash_string function
2020-02-25 00:08:38 +01:00
haystack-ia e8cbbc9bf1
Fix segfault in Authenticode hash check (#16042) (#16043)
I noticed that `r2` will crash when loading a PE file with
Authenticode digest algorithm other than SHA-1 or MD5. I traced
it down to the `PE_(bin_pe_compute_authentihash)` function returning
`NULL` if it encounters an unsupported digest function. This results
in `NULL` being passed to `strcmp` which causes the segfault.

Solution was to add a check for `PE_(bin_pe_compute_authentihash)`
returning `NULL` and to set `bin->is_authhash_valid` to `NULL`.
The real solution is to add support for more algorithms but this will
stop crashes for now.
2020-02-25 00:07:38 +01:00
Riccardo Schirone 397c8697ec
Fix read stack-based buffer overflow when using str with pk_js (#16040)
In some cases I noticed `str` is not correctly terminated, so when it is
later used in `pk_js`, that function reads a very long string, outside
of the memory bounds of the original buffer.
2020-02-24 11:22:34 +01:00
Riccardo Schirone f322c1b1bc
Add support for @* commands in new r2-shell-parser (#16038)
* Use TSSymbol instead of comparing type strings

This patch uses ts_node_symbol instead of ts_node_type to check whether
a node is of a given type. Since TSSymbol is just an integer, the check
will be much faster. Also, it allows to store commands handler in an
hashtable, instead of having if-cascade.

* Make sure r_config_hold works even when keys do not exist or are freed

* Add support for all _tmp_commands

* Make sure to always reuse the same TSLanguage

* Update both tree-sitter and radare2-shell-parser

This way we use TSLanguage version 11, which fixes some problems with
TSSymbols.

* Compute is_last_cmd on each single command and fix logging

is_last_cmd should be set on a per-command basis, so if you analyze
things like `pd 3; .; .; .;` the `.` refers to `pd 3`.

This also fixes logging, so when an invalid command is parsed, it is
still available in the history.

* Add comment about directly using r2-shell-parser in r_core_cmd_lines

r_core_cmd_lines tries to parse the input and split it in lines, but at
least in theory, we don't need it as the new parser can already handle
full scripts.

* Allow other tasks to run between commands even in the new parser

* Update radare2-shell-parser
2020-02-24 09:46:15 +01:00
Khairulmizam Samsudin 45f3715e51
Add tests for RList (set, get, reverse, clone, append, prepend) and remove legacy ##test (#16037) 2020-02-24 03:44:41 +01:00
pancake bf027117aa If esil.addr.stack is mapped find an available one ##esil 2020-02-24 01:16:14 +01:00
pancake 5f82d077eb When esil.stack.addr is -1 set it to the next unallocated address ##esil 2020-02-24 01:16:14 +01:00
pancake 5677390ca6 Fix #10696 - Kill r_io_map_add_next_available
The function is just renamed to be reused and we have no tests for it, but it may fall into an infinite loop
2020-02-24 01:16:14 +01:00
radare b334dac312
Fix ecH- deleting ecHi and deleting meta highlight items ##cons (#16039) 2020-02-24 01:10:51 +01:00
radare 2b74ff5cda
Fix #15359 - Enable key.f# keys to be used in the shell ##cons 2020-02-23 11:55:54 +01:00
Paul I b714b5fe72
Fix memleak in get_src_regname() (#16030) 2020-02-23 11:52:24 +01:00
Paul I b06dc59c2f
Fix memleak in cmd_anal_aaft() (#16029) 2020-02-23 11:52:02 +01:00
Paul I b2ece18876
Fix sdb API usage to avoid extra strdup() (#16028) 2020-02-23 11:49:37 +01:00
Florian Märkl 820693b718
Make r_table_columns() faster, leak- and double free free (#16031) 2020-02-23 11:49:13 +01:00
Itay Cohen 0ad05eb090
Support real names in "fd" command (#16027)
* add tests for fdj and fd.j
* Add support for realnames in fd
* Add a Test for fd with realname

Co-authored-by: Florian Märkl <info@florianmaerkl.de>
2020-02-23 10:08:04 +02:00
Florian Märkl 1dddfd83d4
Fix Spaces Interference in r_flag_get_at() (#16019) 2020-02-22 21:32:30 +01:00
Khairulmizam Samsudin 07d9203366
Code cleanup for r_core_esil_step() (#16017) ##esil
* Code cleanup in r_core_esil_step()
* remove unnecessary call to initializeEsil()
* remove another set PC register in initializeEsil()
* Add test for aes without initialization
2020-02-22 10:09:53 +01:00
abcSup 6acd523a0d Refactor r_bin file hashes
* Add r_bin_file_compute_hashes
* Add r_bin_file_set_hashes
* Refactor it itj commands
* Introduce hashes method to RBinPlugin
2020-02-21 23:58:47 +01:00
Riccardo Schirone 40187725f2 Make `env` command trim key/value strings before setting env variables 2020-02-21 23:58:24 +01:00
Riccardo Schirone 2ec4a2a92c Fix memory leak due to not freed uri 2020-02-21 23:58:24 +01:00
Marco Grassi 05ee096280
Fix null pointer in bobj.c (#16015)
* fixing memory leaks
* use the return if macro
* removed redundand checks
* fixed some out of bound accesses
* fixed null pointer bug in bobj
2020-02-21 11:05:55 +01:00
pancake f3b9ed65eb Fix crash in LE parser 2020-02-20 21:43:39 +01:00
pancake 0b17d35d18 Fix null deref in the ELF version parser
test/bins/fuzz: null_pointer__elf_init__store_versioninfo__store_versioninfo_gnu_versym
2020-02-20 21:34:41 +01:00
pancake 6eb93dbf21 Fix crash in mach0 mach0_invalid-addr_walk_exports 2020-02-20 21:23:21 +01:00
Zi Fan 2c6fc43b7e
Add Authentihash support for PE (#15987) ##bin
* Add Certificate Table parser to PE plugin
* Add SpcIndirectDataContent ASN.1 structure parser
* Add Authentihash calculation and check
* Refactor r_bin_file_hash
* Add tests for Authentihash check
2020-02-20 21:03:16 +01:00
David CARLIER e71cd20268
Memory leak fix proposal in syscmd_join ##util (#16012) 2020-02-20 21:02:43 +01:00
Khairulmizam Samsudin 17026c8c62
Fix show register value in column (#16010) ##debug
* Fix for ar= and dr= and add tests
* increase width to accomodate register name larger than 4 chr
* fix flag type register value not printed
* update r_debug_reg_list() to accept '=' arg
2020-02-20 16:26:29 +01:00
Riccardo Schirone a295504570 Use the "concatenation" concept in radare2-shell-parser 2020-02-20 00:35:41 +01:00
Riccardo Schirone 88af64e47f Implement repeat_command and do not unwrap quoted args
For back-compatibility it's better to not unwrap quoted args, because
existing commands right now just understand this syntax.
2020-02-20 00:35:41 +01:00
Florian Märkl 2e32de6441
Fix ELF symbols for names just before the end of strtab ##bin (#15999) 2020-02-19 00:34:51 +01:00
Drew McGowen 60028dd53d
Fix incorrect PPC ESIL and add testcase (#15970) (#15995) 2020-02-18 16:08:38 +01:00
radare 7af5c55683
Kill all globals in rabin2.c ##refactor 2020-02-18 12:00:32 +01:00
pancake b4cab37bc0 Add ecH. command to show highlight info in the current offset 2020-02-18 10:52:20 +01:00
pancake 5e4991f5a2 Fix 32bit format string bug in the protobuf decoder 2020-02-18 10:27:12 +01:00
pancake 3b5c9bd775 Improve ecH (ecH-* dels them all, ecH- doesnt segfault, ecH list) ##disasm 2020-02-18 01:07:33 +01:00
pancake 560c59c848 Fix ASAN segfault in RCons.rgbParse() 2020-02-18 01:04:08 +01:00
pancake 6a729b6678 Remove globals from main.r2 ##refactor 2020-02-17 16:52:28 +01:00
pancake d2b29db4c9 Remove globals from rax2 ##refactor 2020-02-17 16:52:28 +01:00
pancake f55c51443d Handle return code in r2r.v and fix crashing unit test 2020-02-17 16:36:31 +01:00
pancake 306b6f11cd Fix asan crash in ecH- 2020-02-17 16:35:10 +01:00
Zi Fan b3e4c5d8e0
Fix compilation warnings (#15988) 2020-02-17 16:05:51 +08:00
bannsec 7a39bb9245
Echi bad color (#15986)
* Outputting error on ecHi bad color
* Added a testcase
2020-02-17 11:54:48 +08:00
Khairul Kasmiran 78e21373be Revert "ONE_STREAM_HACK & scr.onestream: Force expected ONE_STREAM order if necessary (#15535)"
This reverts commit 39b40cdedd.
2020-02-17 00:00:46 +01:00
fooxax 9e02536974
Fixing typo in command documentation of /m (#15982)
'patters' -> 'patterns'
2020-02-16 21:38:16 +01:00
Francesco Tamagni e9c7896154
Parse dyldcache local symbols ##bin (#15980)
Add logic to parse unmapped local symbols.

Every macho image present in the dyldcache has all the metadata about its local symbols stripped away from the corresponding macho header. Instead, this information is present as dyldcache-specific metadata stored in unmapped parts of the cache file.

This PR, for every loaded image, takes care of adding the local symbols which are missing.

Bonus

Fix a potential use-after-free caused by r_bin_object_set_items, by rebuilding class-related hash tables after replacing the class list.
2020-02-16 15:43:31 +01:00
Florian Märkl cf09972367
Remove more members from RAnalBlock ##anal (#15975)
* Remove RAnalBlock.type
* Remove RAnalBlock.cases
* Remove RAnalBlock.label
* Reorder RAnalBlock members to free 16 more bytes
2020-02-14 17:50:10 +01:00
Khairulmizam Samsudin e94b70b900
Fix #13908 - x86 aoj for instruction with hidden operand ##asm (#15972)
* Handle instructions with hidden operand
* Add hidden_op() for instructions with hidden operand
* Added operands info for pushf, popf, pushfd, popfd, pushfq, popfq
* Add test for aoj for pushf
2020-02-14 17:34:14 +01:00
radare 7c115b1eda
Fix last covs (#15976) 2020-02-14 17:30:34 +01:00
Riccardo Schirone 88a424164c Fix too long var name and assert on strlen (c) > 1 2020-02-14 16:29:36 +01:00
Riccardo Schirone 54404da94b Fix grep when there is also {}
r_cons_grep_strip expects the ~, otherwise it does not work well.
2020-02-14 16:29:36 +01:00
Riccardo Schirone 78db2b12dc new parser: fix multiple words in grep and add support for > $alias 2020-02-14 16:29:36 +01:00
abcSup 30b6ae559b Update afcr, afs command 2020-02-14 07:59:41 +01:00
abcSup 7ca08bf6b9 Add support for self, error register argument (Swift) 2020-02-14 07:59:41 +01:00
abcSup ffdb81d41a Refactor and Add Swift calling conventions to sdb 2020-02-14 07:59:41 +01:00
Riccardo Schirone 037a521d39
Use state struct and start handling cmd_substition_arg in tree-sitter (#15966) ##core
* Fix escape/unescape in new shell parser
2020-02-13 20:41:00 +01:00
Florian Märkl 19ee4b2df7
Remove prev, jumpbb and failbb from RAnalBlock ##anal (#15969) 2020-02-13 20:40:37 +01:00
pancake 51020062bc Fix #15963 - Handle / in Vx (visual xrefs) ##visual 2020-02-13 20:38:52 +01:00
radare f502016c57
Fix UB, oobread, infinite loop and other bugs in the LE parser (#15968) 2020-02-13 19:39:15 +01:00
Marco Grassi 73325df4d2
Fix some out of bound accesses in LE (#15943) ##bin 2020-02-13 18:31:38 +01:00
Florian Märkl 896c417f27
Cleanup some RAnalBlock Members (#15965) 2020-02-13 17:02:23 +01:00
pancake 9e3d175638 Simplify ownership in the PE resource parser to fix a double free 2020-02-13 16:54:53 +01:00
Florian Märkl a5e11a3f55
Refactor Anal Hints (#15876) ##anal
* Use RVector for Address Hints
* Add Arch/Bits Hint Trees
* Add Unit Tests for Addr, Arch and Bits Hints
* Add unset for newbits
* Fix jmptbl hint fetching
* Fix r_anal_*_bits_foreach
* Print grouped Anal Hints
* Fix arch bit affect on disasm
* Add Reset Hints to Commands
2020-02-13 11:48:24 +01:00
David Carlier ab19ced2af Memory leak fix for kernel cache module. 2020-02-13 09:55:27 +01:00
abcSup 7f41c28a2e Add missing afis info in afi? and fix afis? 2020-02-13 09:49:43 +01:00
pancake 2fca96c248 Skip empty esil expressions in 'aeab' to fix partial results issue ##anal 2020-02-11 01:20:56 +01:00
pancake bca9d74b1a Add graph.aeab to show esil stats instead of disasm ##graph 2020-02-11 01:20:56 +01:00
pancake 5ed92be0c0 Add 'aba' command as an alias for aeab ##anal 2020-02-11 01:20:56 +01:00
pancake 00bf84610d Fix aeab and add V (values) in aea outputs ##anal 2020-02-11 01:20:56 +01:00
pancake 446727b1f8 Improve the gentoo theme ##cons 2020-02-11 00:49:40 +01:00
pancake bd3ae4fcaf Handle ^C in r2r.v and support threads in fuzz tests ##test
* Note that ^c is only supported on unix systems for now
* Some tests use the new radare.r2 api to use RCons.isBreaked()
* Other tests use os.signal() to catch C.SIGINT
2020-02-10 22:58:15 +01:00
pancake 10d2a1bfba Implement aeab command ##anal 2020-02-10 19:23:07 +01:00
Khairulmizam Samsudin fbd6667dc9 Fix #15851 /wj without arg produce '\n' (#15885) ##json
* Fix /wj without argument produce stray \n
- Change logic to prevent unreachable branch
- Revert to R_MODE_RADARE if there is no argument
2020-02-10 09:25:45 +01:00
Khairulmizam Samsudin 0de6f6481d Add asm x86 neg 2020-02-10 08:09:17 +01:00
pancake 0075f3fdcb Add 'wao jinf' for Dalvik ##asm 2020-02-10 00:59:39 +01:00
Khairulmizam Samsudin f4fa3923e7
Fix /j when there is no input argument (#15935) 2020-02-07 13:56:16 +02:00
Manuel Prinz 273133da7d
Determine Gameboy hardware registers in disassembly (#15909) ##asm
* Return address for unknown Gameboy hardware registers
2020-02-07 09:41:30 +01:00
yossizap 0881f89703
Add 'dbH' to set hardware breakpoints (#15933) ##debug 2020-02-07 09:40:23 +01:00
Zi Fan 78d870bec0
Fix tccj, tccl, tcc* output errors and add tests (#15931) ##types 2020-02-07 00:41:20 +01:00
Zi Fan 9de9237c86
Fix #14325 - Honor segments in DEX files (#15920) ##bin 2020-02-07 00:34:46 +01:00
Vane11ope 2d7f7e4e6d
Fix a bug on clicking in panels (on Mac and Linux) ##panels 2020-02-06 00:19:33 +01:00
Michael Rodler 8850bc6aaf
fixed esil for arm push/pop with conditional (#15922) 2020-02-04 09:34:02 +01:00
Florian Märkl c40d1978dc
Fix Comment about RAnal.bb_tree (#15919) 2020-02-04 08:31:55 +01:00
Khairul Azhar Kasmiran 88c9d34626
Terminate on missing script when doing radare2 -i -Q (#15918) 2020-02-03 20:15:03 +08:00
Itay Cohen 3d68a3adce
Add realname to anj (#15917) 2020-02-03 10:47:51 +01:00
Florian Märkl b6080f86c0
Fix a format string in arm (Fix #15915) (#15916) 2020-02-02 00:25:33 +01:00
Khairul Azhar Kasmiran ca7bc22984
Fix radare2 -i -Q output when script has no nl at eof (#15914) 2020-02-01 16:19:59 +02:00
David CARLIER ae4f84a946
Few code simplifications ##egg (#15913) 2020-01-31 01:25:27 +01:00
Marco Grassi 75f8920594 Fix some memory leaks in LE (#15911) 2020-01-28 16:30:32 +01:00
karliss 0a86b4c3a2 Respect agAw output file name, simplify common graph format handling. (#15908) ##graph 2020-01-27 21:15:51 +01:00
Marco Grassi 83005a686b Fix null pointers in the LE parser (#15905)
* fixed some out of bounds and null pointers in LE
* bailout if calloc of objtbl fails because the header has a huge number of obj
2020-01-27 16:59:50 +01:00
Todd 4673490e33 rasm2: treat reading from stdin the same as reading from a file (#15903)
Add the missing return flag inversion so reading from stdin and a regular
file both return zero on success.
2020-01-27 07:44:51 +01:00
Hye Sung Jung 757c23d5db Fix spelling errors (#15904) 2020-01-27 07:43:47 +01:00
Xiao Di Guan 3a0dd576c0 Fix bounds check for flag registers in last byte of arena (#12949) (#15893) 2020-01-26 16:19:19 +01:00
Marco Grassi ee86cb00fc Fix some out of bounds and null pointers in LE (#15895) ##bin 2020-01-26 16:19:04 +01:00
Khairulmizam Samsudin 694f9365a6 Added arm64 ESIL for bic (#15896) ##asm 2020-01-26 16:18:47 +01:00
Manuel Prinz 3a7ce897e0 Add interupt enable mnemonic 2020-01-26 16:17:46 +01:00
Manuel Prinz 38f182f653 Add Gameboy sound registers 2020-01-26 16:17:46 +01:00
Manuel Prinz b34258a58e Rename Gameboy register comments to commonly used mnemonics 2020-01-26 16:17:46 +01:00
Manuel Prinz 4eb6e7313f Add more custom registers to Gameboy hardware 2020-01-26 16:17:46 +01:00
Florian Märkl 11dad4facb
Remove unused Function Tree and Fix Relocate (#15898) 2020-01-26 00:07:54 +01:00
Francesco Soncina 04f065c68c Add undocumented waF* command (#15889) 2020-01-24 17:59:22 -05:00
Francesco Soncina c96af952f5 Add undocumented waF command to help (#15887)
it's implemented here: https://github.com/radareorg/radare2/blob/master/libr/core/cmd_write.c#L1578
2020-01-23 13:07:13 -05:00
David CARLIER 915b9a1dfa Various little mem leak fixes proposal (#15883) 2020-01-23 11:42:09 -05:00
Khairulmizam Samsudin 8f752d435e Arm64 assembler mov immediate word fix (#15884) ##asm 2020-01-23 11:41:44 -05:00
Riccardo Schirone 65d959f299
Run a travis job that uses the radare2-shell-parser (#15879)
* Run a travis job to use the radare2-shell-parser
* radare2-shell-parser: add support for grep_commands, pipes, and others
2020-01-23 09:10:28 +01:00
radare cd069ce2fd
Fix #15858 - Long compiler identification in ELF ##bin 2020-01-22 14:25:42 -05:00
Riccardo Schirone 6c2ed0d81b
Update radare2-shell-parser and improve tree-sitter related code in cmd.c (#15875)
* A bit of refactoring in the code that deals with tree-sitter cmds
* Fix redirect_command parsing
* Better handling of last_commands and update radare2-shell-parser
* Fix printing of helps for @, @@, @@@
2020-01-22 11:05:24 +01:00
Khairulmizam Samsudin d937bebf67 Add cbnz and cbz instruction for arm64 assembler (#15871)
* Add cbz and cbnz instructions
* Added cbnz and cbz test case
2020-01-21 14:59:41 -05:00
Vane11ope c3346ff56f hacky fix for a resizing issue but fine for now (#15872) 2020-01-21 14:59:24 -05:00
Khairul Azhar Kasmiran 2b7bf5bee2
Treat empty string as false when boolifying (#15859)
* Treat empty string as false when boolifying

* Fix :, in ej output
2020-01-21 21:01:06 +08:00
Florian Märkl 020bcb7d37 Fix #15091 - Make 0 fcnsize warning more meaningful and verbose-only (#15866) ##anal 2020-01-20 17:39:41 -05:00
dodococo 2c3249c2f3 Fix #15789: Increment offset for reads as well (#15865) ##io 2020-01-20 17:39:16 -05:00
dodococo 5aa8ab5c75 Implemented pmj (#15864) ##print 2020-01-20 17:39:04 -05:00
Vane11ope 05d5e77f24 Fix resizing issue (#15863) 2020-01-20 11:51:01 -05:00
Florian Märkl 683694c3f5 Fix pkgname version check for real now (#15862) 2020-01-20 11:50:22 -05:00
Florian Märkl c01a491bd2 Check version for pkgname correctly (#15860)
dot can be null
Using R2_VERSION_MAJOR/MINOR is wrong because they will be continuously updated and we want to check for exactly 4.2.0
The version check logic itself was wrong
2020-01-20 07:36:25 -05:00
pancake 066c1277dc Fix #15833 - Only print pkgname if the plugin is for r2 >= 4.2 2020-01-19 22:54:49 -05:00
pancake 84f10732c1 Update/improve jmptbl size tests 2020-01-19 22:44:05 -05:00
d4em0n d50d1ffc3d Fix jumptable size #13812 (#15822) ##anal 2020-01-20 04:43:29 +01:00
pancake f715f01fad A bit more picky fix 2020-01-19 17:59:26 -05:00
Óscar Carrasco 1a57682ed0 Fix afs not working without rettype ##anal (#15847)
* Add test for afs without type
2020-01-19 23:56:00 +01:00
pancake fe30246d91 Fix #15767 - Temporarily disable colors in drrj 2020-01-19 17:54:53 -05:00
pancake 35b05d8697 Fix warnings 2020-01-19 17:11:07 -05:00
Riccardo Schirone f410795ec4 Update radare2-shell-parser 2020-01-19 22:57:40 +01:00
pancake 84436bfaad Implement ar, and dr, commands to list registers in table format ##cons 2020-01-19 22:56:47 +01:00
pancake 1d42b95e78 Add f, command to list flags in table format ##table 2020-01-19 22:56:47 +01:00
pancake 222302ee61 Use void because we don't do anything with the return value 2020-01-19 16:49:29 -05:00
Anton Kochkov d0a915458a Coverity fixes 2020-01-19 20:37:29 +08:00
radare 1ac6209c88
Fix #14424 - Handle ~ operator in the `ms` shell ##cons (#15846) 2020-01-19 07:40:21 +01:00
Vane11ope 908727e223 More fix for resizing issue (#15844) ##panels 2020-01-18 23:11:37 +01:00
Itay Cohen 0d45034037 Remove realname from strings (#15841) ##disasm 2020-01-18 23:11:12 +01:00
Florian Märkl 3e819bfb76 Fix a null deref in fcn_recurse ##anal 2020-01-18 02:47:00 +01:00
pancake a15b8b7362 Add ?V0 ?V1 ?V2 - for semver support ##core 2020-01-18 02:46:36 +01:00
vane11ope c3746f3bbb Resizing works not perfectly yet but close 2020-01-18 02:45:13 +01:00
Riccardo Schirone 7fb34164aa Introduce SETBPREF to handle "boolish" vars like asm.cmt.off 2020-01-17 12:22:44 +01:00
Riccardo Schirone d8f2b4a4db Do not try to convert to true/false, as it breaks integer vars
See discussion at https://github.com/radareorg/radare2/pull/15681 .
Unfortunately the change cannot be done for non-int vars only, because
right now vars are not statically typed, so a var that is initially
CN_INT can then become CN_STR if you set a string.

Changing vars to assign them a static type when they are created would
require a much bigger change and discussion.
2020-01-17 12:22:44 +01:00
Riccardo Schirone 8a330bedb0 A bit of refactoring in r_config.h 2020-01-17 12:22:44 +01:00
radare 45eb0052b1
Upgrade to acr-1.8.1 to get semver support ##core (#15816)
Move all version defines into r_version.h and handle it from meson too

- R2_VERSION_MAJOR
- R2_VERSION_MINOR
- R2_VERSION_PATCH
- R2_VERSION_NUMBER
2020-01-17 12:18:05 +01:00
radare 0d701a3b79
Use PJ api in the output of isj and show realname ##json (#15826) 2020-01-17 11:14:18 +01:00
David CARLIER 7ef9dc813e Mach-O io: mem leak fix proposal. (#15829) 2020-01-17 13:31:09 +08:00
Jeong Jihoon 6928ae192d Fix r_list_set_n() to allow empty element (#15820) ##util 2020-01-16 23:23:08 +01:00
radare 9ddfafcd65
Show flag realname when finding a function and realname is enabled ##disasm (#15827) 2020-01-16 21:15:42 +01:00
dok fec55f8c74 C89 Fixup for r_sign_fcn_types function (#15824)
Fix error: `for` loop initial declarations are only allowed in C99 mode
2020-01-16 15:03:32 +01:00
Florian Märkl 3ead80cca8 Remove Custom Analysis for Java (#15817) ##anal 2020-01-16 11:25:49 +01:00
Óscar Carrasco 0efbb81c91 Apply types on matching zignature data ##signatures (#15746)
* Implement new zignature types format
  * Adapt zignature types deserialization to new format
* Integrate fcn types when zignatures match
2020-01-16 10:26:03 +01:00
Riccardo Schirone 3c788a4967 Use node->i_value in the log.level/log.traplevel callbacks 2020-01-16 00:06:34 +01:00
Florian Märkl 14215350af Refactor RAnal Basic Blocks and Functions (#15169) ##anal
Basic Blocks are now global instead of owned by a single function.
2020-01-15 15:23:34 +01:00
Florian Märkl 5bb7e28ad4 Change RAnalBlock.size to ut64 ##anal 2020-01-15 15:23:34 +01:00
Florian Märkl a68ff59a32 Make type matching independent of bb list order ##anal 2020-01-15 15:23:34 +01:00
Florian Märkl 50040f8810 Add explicit fingerprint_size to RAnalFunction ##diff 2020-01-15 15:23:34 +01:00
radare 31e71d340f
Add pkgname in RLibStruct for r2pm on outdated plugins ##core (#15813) 2020-01-15 09:49:41 +01:00
yossizap f64f2211fb Added reverse step and continue support to gdbr ##debug
This feature only works with server implementations that have ReverseStep
and ReverseContinue enabled, such as rr. The official gdbserver doesn't support it.
2020-01-15 09:49:03 +01:00
Riccardo Schirone abb30be72a Remove opt->sz checks and operations in r_bin_open_buf
opt->sz is not used anyway in r_bin_open_buf, so there's no need to
check its value or compute it.
2020-01-14 23:18:19 +01:00
pancake d139fede85 Fix last coverities related to cbin 2020-01-14 23:17:48 +01:00
pancake 77f631ec5b Improve the op.type text representation when unhandled modifiers are used ##anal 2020-01-14 23:17:29 +01:00
radare 551a0986d6
'push rip' is not a valid instruction ##asm (#15804) 2020-01-14 14:36:45 +01:00
Anton Kochkov b4de5c5113 Some more coverity fixes (#15802) 2020-01-14 12:57:34 +01:00
Itay Cohen 3e3a06856f Hide flag comments when realname is shown (#15801) ##disasm 2020-01-14 12:38:12 +01:00
yossizap 37797f7547 Moved drC to drpC for profile comments and added drC for reg comments ##debug 2020-01-14 11:35:13 +01:00
yossizap 71669c2cb3 Added register specific comment parsing to register profiles ##debug 2020-01-14 11:35:13 +01:00
Khairul Azhar Kasmiran bf80920ed3 asm.symbol: Improve code/test a bit more (#15798) ##disasm 2020-01-14 11:33:25 +01:00
pancake 32d8fd8dc9 Implement pcV command to print byte array in Vlang 2020-01-13 23:15:06 +01:00
Vane11ope 2a20689969 Fix a small bug by removing some useless codes (#15795) 2020-01-13 10:02:15 +01:00
Khairul Azhar Kasmiran 87d09e3bea asm.symbol: Fix flag name when disasm from non-flag addr with no anal ##disasm 2020-01-12 12:51:50 +01:00
Itay Cohen 29c1344ff3 Improve realname support for symbols (#15702) ##bin
* Initial implementation of libname for flags in imports
* Initial support for PE and real flag
* Read libname for PE exports
* implement pj for imports
* Remove imp. prefix from symbol names
* Fix r_core_bin_impaddr()
* Fix some mdmp import stuff
* Print libname in ii
* Fix some imp. checks and reloc meta
* Fix r_bin_filter_sym() for imports
* Use realname for noreturn check
* Fix asm.flags.real for direct calls
* Fix realname for direct calls with fcn
* Fix resolving names from ordinal

Co-authored-by: Florian Märkl <info@florianmaerkl.de>
2020-01-12 03:09:12 +01:00
itayc0hen 3a12a2096a Add sha256 hash to "it" 2020-01-12 03:03:02 +01:00
yossizap 9e1a1e0f92 Fix crash caused by rebasing a file without sections ##debug 2020-01-12 03:02:08 +01:00
yossizap ff38565a61 Set cfg.debug to true before running oodf in doof ##debug (#15787) 2020-01-11 16:50:27 +02:00
Khairul Azhar Kasmiran 0ac5ba9c75
Refix #15331 (-nn filename with @) (#15788) 2020-01-11 15:37:35 +08:00
Guillaume Valadon 09bbba9dca C prototypes fixed 2020-01-10 16:16:05 +01:00
Khairul Azhar Kasmiran d9757db2e8 Fix broken AppVeyor due to rejected apostrophes (#15785) 2020-01-10 22:15:19 +08:00
Anton Kochkov f3a0a3d01c Some coverity fixes 2020-01-10 12:30:23 +01:00
pancake 0e34303648 Third fix attepmt for musl builds 2020-01-10 03:50:30 +01:00
pancake 5a48a40178 Second fix attempt for Alpine/musl builds 2020-01-10 03:32:13 +01:00
pancake 52d9baf988 Aim to fix the alpine build 2020-01-10 03:06:46 +01:00
yossizap 2e5f4b41b4 Fix multithreaded breakpoint behavior in linux ##debug
The plugin wouldn't properly trace breakpoint hits on different threads
since they weren't switched to and the events weren't always handled.
Also, since the breakpoints are removed after they are found in one of the
threads, it's best to stop all threads for now even if dbg.threads is false.
2020-01-10 00:30:18 +01:00
yossizap ed1f42085c Attach to new linux threads on creation ##debug
New threads were only added after being attached to manually or if
dbg->trace_clone was true. dbg->trace_clone stops debug and switches the
new thread now.
2020-01-10 00:30:18 +01:00
Florian Märkl 29d390012f Fix a format string vuln in the disassembly with comments (#15783) 2020-01-10 00:29:36 +01:00
radare c3651a43ec
Fix debugger build on linux-s390x ##debug
* Add s390x reg profile
* Add missing pc register
* Use gregset instead of regset
2020-01-09 15:21:41 +01:00
Khairul Azhar Kasmiran b25c8bb6c0 ww: Support esc seqs (#15780) 2020-01-09 15:07:33 +01:00
yossizap 0de7c21bcc Always unset bps after continue and step hard ##debug (#15772)
Breakpoints were left in disassembly after a signal/break and there
are probably other cases that may lead to it.
2020-01-09 12:00:24 +01:00
Vane11ope 11f46cee88 Offset for each panel was not correct (#15778) 2020-01-09 11:58:58 +01:00
Florian Märkl 4b02315717 Add null to pj and use for relocs (#15776)
* Add pj_null() and pj_knull()

* Print reloc name as null in json if not available

* Omit reloc name in json
2020-01-09 11:58:35 +01:00
pancake 70166dbb36 Improve shell injection check 2020-01-09 11:44:01 +01:00