1200 Commits

Author SHA1 Message Date
radare
33428f8938
Implement the missing bits in the triple-at ##core
@@@           # foreach offset+size iterator command:
x @@@=       [addr] [size] ([addr] [size] ...)
x @@@b       basic blocks of current function
x @@@c:cmd   Same as @@@=`cmd`, without the backticks
x @@@C:cmd   comments matching
x @@@i       imports
x @@@r       registers
x @@@s       symbols
x @@@S       sections
x @@@m       io.maps
x @@@M       dbg.maps (See ?$?~size)
x @@@f       flags
x @@@f:hit*  flags matching glob expression
x @@@F       functions (set fcn size which may be incorrect if not linear)
x @@@F:glob  functions matching glob expression
x @@@t       threads
x @@@r       regs
2019-04-15 01:49:34 +02:00
pancake
54fc8d8572 Add support for r2pipe shellscripts ##r2pipe 2019-04-13 02:21:21 +02:00
radare
a756bfca4c
Fix large disasm issue with invalids and handle @{xfs} ##print
* Fix segfault and trim whitespaces to fix pd @x:9090
* Use maps and io.va=1 to make it work instead of hacky memcpys
* Fix p8f and bring back core->fixedblock to make pd/pD@x:/len work again
2019-04-09 02:56:53 +02:00
radare
bb823232f4
Fix #13491 - Handle $aliasFiles in 'cat' and 'rm' 2019-03-31 13:57:00 +02:00
Riccardo Schirone
3f4580b031
Make buf field private in RBuffer (#13473)
* Fix pemixed build (and include it in meson build)
* Do not use base_priv in yank, it was wrongly used.
2019-03-26 20:32:53 +01:00
radare
530de94b3a
Avoid unnecessary RConfig.get('cmd.times') in RCore.cmdSubst ##optimization (#13490) 2019-03-25 04:28:55 +01:00
pancake
5b392de33b Support alias files in '.' interpret too ('. $foo') ##core 2019-03-25 01:22:00 +01:00
pancake
d865d63283 Implement $foo=- to use cfg.ediitor to edit the alias ##core 2019-03-25 01:16:51 +01:00
radare
2aac9fa943
Initial implementation of alias files ##core (#13489)
pd 10 > $foo  # save the output of pd 10 into $foo
$foo          # print the contents of $foo (the output)
$*            # values are now printed in base64
$foo=base64:  # is now supported
2019-03-25 01:06:53 +01:00
Riccardo Schirone
b0ac77881e
Make other RBuffer fields "private" (#13444)
* Use r_buf_size to get the size of a buffer, not the private field

* Use r_buf_seek instead of adjusting the private cur RBuffer field

* use r_buf_read instead of r_buf_read_at(.., cur, ..)

* other r_buf_read_at/r_buf_read

* Fix RBuffer usage in REgg

* Wrong replace with r_buf_resize

* Other r_buf_resize fixes

* style fixes

* other style fixes

* Introduce r_buf_tell API instead of using seek

* other style fixes

* style

* style 2

* write_at(cur) == write

* fixes

* avoid changing test

* Make most RBuffer fields private

* Add some fixme comments

* still use base_priv in some places
2019-03-20 19:01:26 +01:00
GustavoLCR
3fba693b91 Add support for UTF console input in Windows (#13338) ##windows
* Add support for UTF console input in Windows
* Convert ANSI input to UTF-8
* Convert UTF-8 to acp when calling ANSI version of functions
* Determine if Windows console output is UTF-8 on the fly
2019-03-18 16:05:38 +08:00
Riccardo Schirone
0948f9536b
Use r_buf_size to get the size of a buffer, not the private field (#13380)
* Use r_buf_size to get the size of a buffer, not the private field
* Use r_buf_seek instead of adjusting the private cur RBuffer field
* use r_buf_read instead of r_buf_read_at(.., cur, ..)
* Fix RBuffer usage in REgg
* Introduce r_buf_tell API instead of using seek
* write_at(cur) == write
2019-03-15 20:28:52 +01:00
Anton Kochkov
bb67b54f74
Remove CYGWIN & MINGW remnants (#13377) 2019-03-15 12:55:08 +08:00
pancake
c22f707f0b Fix #13302 - Add .* as an alias for #!pipe but trimming in first space 2019-03-07 00:38:21 +01:00
radare
73f76a99b2
Make RCons.is_interactive() into the RConsContext and improve loading projects in tasks ##cons (#13132) 2019-02-18 06:20:01 +01:00
David CARLIER
58ba3a663d Various little code fixes. (#13075) 2019-02-14 10:40:38 +01:00
Gaurav Kumar Ghildiyal
e60749ed12 Added feature to return error while parsing c header file (#13030)
* Added feature to return error while parsing c header file

* Fixed cmd_type.c to pass tests
2019-02-10 01:56:28 +01:00
Riccardo Schirone
e5b4d9294c Use RSpaces in RFlag ##refactor 2019-02-03 09:06:45 -06:00
pancake
254c33c466 Trim scriptfile after '.' 2019-01-28 13:11:04 -06:00
Florian Märkl
6225fe1bea Make ! command sleep around system() ##tasks 2019-01-15 19:54:02 +01:00
Itay Cohen
07dd0067cb Remove noisy log message in the @@@ operator ##core 2019-01-15 17:10:19 +01:00
Riccardo Schirone
320a258977
Remove flag list in RFlags and just use hashtable (#12703)
* Do not directly use flags->flags, but use r_flags_foreach functions
* Remove list of flags because unnecessary
* Do not free flagitem when we just need to change the name(aka key)
* Use skiplist to iterate, so we get order for free
* Use RIOMap instead of RIOSection which is being killed
* Free flagitems when ht is freed

There's already the hashtable that can serve to iterate all flagitems.
2019-01-14 14:15:12 +01:00
pancake
80f8526fdf Documentate yfx/yw/ywf/.. 2019-01-14 10:06:06 +01:00
pancake
c8339215c6 Implement yfx (yank from hexpair) command and r_core_yank_hexpair API ##core 2019-01-14 02:38:03 +01:00
pancake
2c8d417d65 Implement the cmd_colon and experimental http.colon ##http 2019-01-13 03:42:56 +01:00
pancake
62b52e4abe Implement T=& and handle more meta events ##sync 2019-01-13 03:42:56 +01:00
radare
cd635a50e4
Fix #6424 - Disable scr.color when doing backticks ##core 2019-01-13 00:45:44 +01:00
radare
32e494a696
Improve rap:// code, r2p_ is now r2pipe_ ##io (#12699) 2019-01-09 02:47:35 +01:00
Florian Märkl
b0468f6b73 Make =h work in tasks ##threads 2019-01-07 13:24:30 +01:00
radare
0548eb5637
Rename scr.pipecolor into scr.color.pipe ##config 2019-01-07 11:37:10 +01:00
dav1901
ceeb25ce49 Minor code cleanups/fixes (#12595)
* Minor code cleanups/fixes
* use r_base64_encode_dyn
* Fix clang-analyzer warning(uninit var)
2019-01-03 00:30:06 +01:00
pancake
c40ddd3552 Several improvements in the Visual mode (help, tabs, ...) ##visual
- Remove the V@ command - not intuitive and a bit alien
- rotating print modes with tab was segfault because of UB
- Implement recursive interactive help
- Support ranged cursor selections (for pxd, pxb, pxq, ...)
- 'i' in pxb visual runs Vd1 to edit the bits under the cursor
- V' is no longer mixed with Vt
- Properly restore the print sub-modes in tabs
- Smart tab key hints (beter located and shorter)
2019-01-02 02:09:31 +01:00
dav1901
d05a119081 Fix few minor leaks (#12584) 2018-12-30 01:37:14 +01:00
David CARLIER
75dfeeffc6 Various build compiler warning fixes attempts. (#12468) 2018-12-12 22:04:11 +01:00
EvenCode
134ac4c962 Implement kj command 2018-12-12 13:24:07 +01:00
dav1901
97b94b3f94 Fix more clang warnings (#12458) 2018-12-12 12:22:36 +01:00
lzutao
50320592a6 Fix #12060 and #12072 - Rewrite r_num_abs and r_num_units ##core
r_num_abs:

- Make r_num_abs static inline
- Use unsigned long long type when defining TB macro
- Use st64 instead of long long

r_num_units:

- Add len argument for buf in r_num_units
- Add PB and EB for r_num_units
- Always display one number after decimal point

  * This change simplifies the code
- Use long double type as assigning from ut64 to double cause data loss

r_num_tail_base:

- Use isxdigit (fast) instead of isHexDigit (slower)
- Rename nth to get_nth_nibble

Update all functions to use with new r_num_units:

- Remove side effect when using in other functions like cb_printf

* Trim trailing .0 when input is power of 2
2018-11-14 23:35:44 +01:00
Riccardo Schirone
af67995ca3 macro->cmd should use a wrapper because of different types 2018-11-14 22:29:54 +01:00
dav1901
8b83d03c99 Minor code cleanups free/R_FREE (#12145) 2018-11-13 23:41:28 +01:00
dav1901
b6c3425610 Change void to RCore (#12125) 2018-11-12 00:03:06 +01:00
lzutao
b790439e28 Cast arguments to ut8 when feeding ctype.h functions ##refactor
The behavior of the `<ctype.h>` functions is undefined for negative
arguments (other than `EOF`). In such a situation, the argument should
be cast to `unsiged char` for safety.

References:
 - C Programming: A Modern Approach, 2nd Edition: page 612, chapter 23.5
2018-11-06 13:40:00 +01:00
Maijin
34abfd6d64
Remove all S commands ##refactoring 2018-10-30 13:23:18 +01:00
radare
e7d3706b8f
Fix gcc8 warnings and rename core/asm.c to casm.c ##refactor 2018-10-20 01:23:15 +02:00
F3real
70afbcc36e Fix leaks in cbin and cmd 2018-10-16 02:19:40 +02:00
David CARLIER
7995271176 Fix few code paths. (#11792) 2018-10-12 00:10:07 +02:00
David CARLIER
036db696d1 Fix couple of leaks. (#11716) 2018-10-02 15:24:27 +02:00
radare
18de6e4aff
Command repeat is now ut64 (#11656) 2018-09-27 15:18:15 -07:00
Neven Sajko
211566922b Remove three unused functions (#11633) 2018-09-27 14:14:38 -07:00
pancake
d9ba8fcdfd Fix one tiny memleak in RCore.cmd 2018-09-25 13:37:06 -07:00
pancake
41ec949204 Fix #11112 - Rename {srwx,flags,perms} to perm. (-21 LOC)
Unify R_IO, R_BIN, R_BP, .. into R_PERM_* using 1 letter syntax
2018-09-22 11:31:45 +02:00