Commit Graph

706 Commits

Author SHA1 Message Date
Paul B Mahol
8ffa196193
Fix not calling r_asm_op_fini() when needed (#20506)
The RAsmOp is used on stack when disassembling and after its content is not need it needs to call its _fini to free possible heap memory previously allocated.
2022-07-29 07:30:05 -04:00
pancake
3db3750eb0
Lint for x"" ##cleanup 2022-06-28 12:07:58 +02:00
pancake
304a3a7fcf
Use more R_LOG instead of eprintfs and add more linting checks ##refactor 2022-06-28 11:24:06 +02:00
pancake
d19f21b50a
Remove newline in date and pt. output ##shell 2022-06-03 20:52:46 +02:00
pancake
67e2d6cfac Cleanup dbg.trace config vars and better error messages ##debug
* aeim;e key.S=dsb;e dbg.trace=true;ds;dsb
* aes was causing assert when no aeim was executed
2022-05-30 01:22:50 +02:00
pancake
93d9860f41
Add test for 'q' return code bug and minor cleanup r2r ##tests 2022-05-26 12:41:49 +02:00
pancake
3bc07a2d5b Fix last covs 2022-05-24 18:22:35 +02:00
pancake
0a322abc4b Support '$' in regprofile offset column ##arch 2022-05-24 11:10:27 +02:00
pancake
c25dd7e999 Handle ? in all the dc subcommands ##shell 2022-05-22 20:36:25 +02:00
pancake
90bd713794 Add d: to run the cmd callback of the debug plugins ##debug 2022-05-07 11:58:38 +02:00
pancake
5b7c970f2b eprintf requires newline
* git grep eprintf | grep -v '\\n'| grep '('
2022-05-05 13:11:52 +02:00
pancake
560f7fb424 Introduce r_arch.h. Use RArchConfig in RAnal and improve RRef api ##api
* Fix unaligned issue in hex asan test
2022-04-24 23:11:26 +02:00
pancake
f35fd1c33e
Initial implementation of shared RAsmConfig ##asm (#19972) 2022-04-22 19:47:25 +02:00
pancake
99b7a74640 Fix last covs, mainly memleaks in w 2022-04-22 05:46:34 +02:00
Lazula
0404d2d845
Fix #19966 - Reset seek in r_debug_execute() to real PC ##debug
* Add return value output arg to r_debug_execute()
* Always restore the full 4k at the stack
* Fix maybe-uninitialized warning
* Use raw RCore->offset instead of RCore.seek()
* Move seek handling into cmd_debug()
2022-04-21 18:08:21 +02:00
Lazula
724d23a6c0
Refactor, fix, and test dd command (#19842)
* Test dd commands
* Improve dd help text
* Move dd command into a self-contained function
* Take correct arguments for ddr and ddw
* Add O_CREAT to dd+ flags for python-style automatic creation
* Add permission checks to ddr and ddw

Linux debug file descriptor info bugfixes (`linux_desc_list()`)

* Fix normal files being reported as sockets due to inaccurate S_IFSOCK check
* Fix file descriptor permission reporting
* Implement offset checking functionality
2022-04-19 07:43:54 -05:00
Lazula
fc00c929c4 Honor help text capitalization 2022-04-19 01:49:12 +02:00
Lazula
81afa3aa98 Improve dx help and add dxa test 2022-04-19 01:49:12 +02:00
Lazula
540a357b8e Add dxrs command and tests for dx/dxr/dxrs 2022-04-19 01:49:12 +02:00
Apkunpacker
6d0bf405ac
Lowercase all the help messages for consistency ##shell 2022-04-11 11:09:41 +02:00
pancake
708e59b8a1
Add r_core_return_code() and use it ##shell
* Still WIP, but good to go if passing tests
* It's a macro that is only used internally for code clarity
* Ship RCmd.returnValue into RCore.num.value in some situations
2022-04-08 23:15:39 +02:00
pancake
48d34eb11e Use int instead of bool for cfg.color 2022-04-04 10:43:41 +02:00
pancake
c6114fda6e Instruct drrj to not emit ansi escapes to not damage ##json
* Add help message for drr?
* Issue lies in RTable.toJson()
2022-03-27 15:07:56 +02:00
pancake
80bde99c7f Support relative pointer resolution in pxr ##print 2022-03-27 15:07:56 +02:00
pancake
0fd97c27a7
Assume all machos are made by clang ##bin 2022-03-25 13:43:49 +01:00
Sergi Àlvarez i Capilla
969e1c141e Break emulation when register profiles don't provide enough info 2022-03-23 13:02:55 +01:00
Sergi Àlvarez i Capilla
4abf7bf9ba Add esil.maxsteps to avoid infinite emulation loops ##esil 2022-03-23 13:02:55 +01:00
Lazula
ea207c528e Fix dxr and use it in dd 2022-03-21 23:40:27 +01:00
pancake
8089224302 Improve help message for dd? and autocomplete ##debug 2022-03-17 18:36:13 +01:00
pancake
2411bc75a3 Add 'dd+' to open files in the child process as read-write ##debug 2022-03-17 18:35:41 +01:00
pancake
f8a35da205
Dont use != NULL as its implicit in C, even for bool casts ##refactor
$ find binr libr -name "*.c" -exec sed -i -e 's/ != NULL//g' {} \;
2022-03-15 19:54:04 +01:00
Lazula
d507bda91c Remove R_EMPTY and R_EMPTY2 2022-03-13 11:26:10 +01:00
pancake
63d4172d94
Fix last covs, mainly memleaks and update one test 2022-03-11 13:14:46 +01:00
Lazula
619d9cb8cc
Add ddf command ##debug 2022-03-10 07:47:30 +01:00
Lazula
90ce9c795e
Fix dd command and update tests accordingly ##debug
* Add quotes around filename for dd command
* Account for string argument size in r_core_syscall()
* Fix command comments for dd
* Use a constant static stack size in r_core_syscall()
* Allow passing an address of the filename in memory for dd
* Change consumeBuffer() to print_buffer_hex()
* Improve dsue error message
* Update egg tests
* buf ownership is transferred to egg, dont free
2022-03-09 10:20:49 +01:00
pancake
7b52e66c9c Skip wired-to-ground registers in dr= ##debug 2022-03-07 17:18:53 +01:00
pancake
a46f5e291f Fix drj in debug mode ##debug 2022-03-07 17:18:53 +01:00
Sergi Àlvarez i Capilla
36f161f207 Fix #19617 - Use PJ in dij ##json 2022-02-11 23:18:54 +01:00
pancake
f2995c2949
Introduce r_strf and stop using sdb_fmt ##util 2022-01-18 18:35:31 +01:00
Lazula
ad749a0b1a Fix static/R_API function definition formatting
* Remove spaces before parens
* Remove spaces after asterisks
2021-12-21 20:58:12 +01:00
Lazula
2255bf8b5d Many indentation style fixes
* Change several 8-space indents to tabs
* Apply tab indent style when breaking long lines
* Move operators from EOL to start of next line
* Fix ternary formatting
2021-11-18 10:43:52 +01:00
pancake
93f6b4cd3b
Initial work towards supporting mingw32/64 again ##build 2021-10-18 23:58:16 +02:00
Antoni Viciano
88d8b622bf Fix #19094 - RBinOptions renamed to RBinFileOptions 2021-10-10 20:52:46 +02:00
pancake
eb8e8a6503 Add 'dir' command as an alias for 'ls' ##shell 2021-10-09 03:26:47 +02:00
Lazula
d1631b8d34 Multiple alias improvements
* Add proper hashtable functions in RCmdAlias to prevent memory leaks
* Fix off-by-one error in alias name processing
* Don't allow 0-length aliases
* Fix memory leak in r_cmd_alias_set_raw() when malloc fails and add
  null checks to other alias set functions
* Document intended use of strlen() result for buffer size
2021-10-06 22:24:42 +02:00
pancake
704bf823d1
Cleanup and boolify some more debug apis ##refactor 2021-10-04 20:56:34 +02:00
Lazula
25fc71570c Overhaul alias system
Aliases now use a hashtable. Aliases are now either commands or data.
Data aliases may be strings or raw bytes.

* Expand alias API
* Remove remote aliases - remote commands can still be aliased normally
* Update alias help text
* Fix an alias test and add new tests
* Add r_str_escape_raw() for null-safe escaping of unprintable characters
* Remove command to print alias without newline
* Fix dif command opening files as strings
2021-10-04 09:30:37 +02:00
pancake
9a2636b32b
Remove other useless and incomplete treesitter leftovers and get +400 new commands in the recursive help ##shell 2021-08-14 18:28:20 +02:00
gogo
130c220792 Add 'sigstr' to the 'di' output for verboser stop reasons ##debug 2021-07-17 13:00:21 +02:00
pancake
188bce9f25 Use DRX APIs to handle breakpoint recoils only on x86-64 ##debug 2021-06-29 11:56:55 +02:00