Commit Graph

257 Commits

Author SHA1 Message Date
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
pancake
e6f2cd0b2a
Remove trailing spaces (#19460)
$ git grep ' $' | grep -v ^test/ | cut -d : -f 1 | sort -u > /tmp/trailing
$ for a in `cat /tmp/trailing` ; do sed -i -e 's/ *$//' $a ; done
2021-12-02 17:39:59 +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
51e890ca3e Add ragg2 -e to pass egg programs as argument, and improve code quality
* Use more bool and r_return asserts
* Update manpage and help message
* Spotted some issues in the x86 assembler
2021-05-04 13:16:55 +02:00
pancake
4ae7cef832 Add dxe? help, improve parsing and few egg boolification 2021-05-04 12:51:09 +02:00
pancake
da3db59a22
Remove some exit() calls in libr ##api (#18565)
Co-authored-by: Anton Kochkov <xvilka@gmail.com>
2021-04-11 02:34:23 +02:00
pancake
a7c08c15ce Don't scream out WARNINGs, capitalizing it is enough 2021-03-19 11:02:54 +01:00
Paul I
902d12b5ec Free objects allocated by rz_syscall_get() 2021-03-15 02:24:16 +01:00
Alexis Ehret
21c98d60ac Remove all dead assignment detect by clang sa (#310) ##rizin 2021-01-19 05:37:17 +01:00
pancake
76cd69ad66 Proper artifact naming and use more r_str_get to avoid some null derefs 2021-01-13 02:08:06 +01:00
Liumeo
4287408a3e
Fix ARM64 db/tools/ragg2 (#17801) 2020-10-19 18:21:49 +08:00
pancake
aa7de006e6 Fix TinyCC build ##build 2020-09-27 13:33:26 +08:00
Khairul Azhar Kasmiran
d9057505dc
Set RPATH/RUNPATH on r2 libs too if local (#17639) 2020-09-15 09:16:14 +02:00
Riccardo Schirone
594b940b7c
Fixes some of the issues in Travis (#17267)
* Do not check with r_return_ if the convention is present

Let's just assume the NULL default in such a case, so that architectures
for which we don't have a defined calling convention can still be
processed somehow by the analysis code. It won't be precise, but it's
better than nothing.

Also add a warning message so users are aware when the calling
convention is not defined.

* Fix oob-read when # is at the end of the cmd string

* Do not set TMPDIR when the new value is the empty string

When TMPDIR is set to empty value, clang+ld behaves in weird ways and
you cannot compile files from within the r2 shell (e.g. when using #!c
or #!cpipe)

* Use meson and add -lasan to pkgconfig files when sanitizer are used
2020-07-16 20:47:30 +08:00
pancake
160fc95e66
Use (void) instead of () in function signatures (#17026) ##refactoring
* Use (void) instead of () in function signatures
* Add test to avoid further contributions to commit the same mistake
2020-06-14 16:08:32 +02:00
Anton Kochkov
ffe743ef39
Fix #4056 - rename DEPS to R2DEPS ##build (#17020)
* Rename DEPS to R2DEPS
* Cleanup of sys/build.sh
2020-06-12 10:49:28 +08:00
pancake
58f0d8343a
Fix segfaults in fuzzed bins (#16538) 2020-04-12 12:16:51 +02:00
Frédéric Tobias Christ
3563cc33cb
Fix shellcode path customization (#16384) ##egg 2020-04-09 00:44:36 +02:00
Florian Märkl
0b5e78e923
Make size arg of r_file_slurp() size_t (#16221) 2020-03-15 23:34:38 +01:00
radare
f70702c299
Fix #16093 - support syscall redefinition in REgg (#16106) 2020-03-02 23:46:22 +01: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
GustavoLCR
07b5e062f2 Fix #15545 - Fix NULL derefs after r_file_slurp() fails 2019-12-15 23:38:38 +01:00
Anton Kochkov
e11b2a9145
Some Coverity defect fixes (#15626) 2019-12-13 11:25:19 -06:00
Khairul Azhar Kasmiran
39b40cdedd
ONE_STREAM_HACK & scr.onestream: Force expected ONE_STREAM order if necessary (#15535) 2019-12-02 23:09:38 +08:00
Florian Märkl
aad2a2c79e Link sdb fully into r_util in meson (#15338) ##build 2019-10-23 15:52:19 +02:00
Brenton Morris
497717bb15 Add ROP chain execution support in ragg2 ##rop (#13609) 2019-08-18 01:55:38 +02:00
Anton Kochkov
f93ebed36d Small cleanup of libr/egg 2019-08-06 12:32:50 +08:00
Florian Märkl
24d3a9cb5d Add r_parse_ctype ##parse (#14596)
* Add r_parse_ctype

* Add mpc to acr

* Readability

* Fix r_parse for acr
2019-07-20 12:50:27 +02:00
pancake
b50e7e9602 Fix ragg2 *.c on macOS 2019-06-26 10:35:51 +02:00
Anton Kochkov
20e19d6023 More spelling fixes in the code 2019-06-20 13:36:02 +08:00
Anton Kochkov
d3909cab84 Fix more grammar 2019-06-18 14:51:30 +08:00
radare
93af319e0a
Fix #14296 - Segfault in ragg2 (#14308) 2019-06-15 14:18:54 +02:00
radare
571a080ca7
s/CORELIB/R2_PLUGIN_INCORE/g (#14295) 2019-06-13 19:12:51 +02:00
Lowly Worm
e710401ebb patch #14211 heap buffer overflow in large ragg2
inputs. this should be refactored to use an RBuffer to enable dynamic
resizing, but for now just patching it to bail out if we are about to
overwrite the allocated statically sized buffer
2019-06-02 23:07:50 -07:00
Riccardo Schirone
66f7403245 Rewrite the RBuffer API to make it safer and adjust the codebase ##refactor (#13656)
* Reimplement r_buf_fread/fwrite
* Add slice buffer and introduce readonly field
* Do nothing if size is 0
* Prevents an overflow when 8 is subtracted from size.
* Fix ragg2 when patching outside currently existing buffer
* Implement r_mem_mmap_resize for systems where mremap is not defined
* r_buf_buffer can be called with no size arg as well
* Use size_t instead of ut64
2019-05-15 15:34:06 +02:00
Riccardo Schirone
820e3dbe73
Improve r_buf_buffer and remove r_buf_get_at (#13676)
* Make r_buf_buffer return a ut8 and the associated size of the buffer
* Remove r_buf_get_at uses and make it static
2019-04-15 13:24:15 +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
Giovanni
8058018973 Fix #11133 - Remove buf_hex frield from RAsmOp ##refactor 2019-03-26 12:50:13 +01: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
pancake
f33ebcbd89 Use r_return in RAsm APIs and fix some regressions ##asm 2019-02-04 00:25:27 +01:00
pancake
0daae3d9af Remove R_ASM_BUFSIZE, all buffers are now dynamic ##asm 2019-02-04 00:23:40 +01:00
radare
d0eaeeb848
Fix asan crash in PE parser (oobread) (#12966) 2019-02-01 16:47:33 -06:00
lzutao
1365948cee Do not use reversed keyword of meson ##build
`files` is a reversed keyword in meson. Try to avoid using it.
2019-01-10 14:15:50 +01:00
lzutao
9cc6d2d291 meson: Do not use glob with meson ##build
* meson: Explicit is better than implicit
* meson: Fix deprecated warnings in Meson 0.49.0
* meson: Do not need separate array for installed files

libr/socket/meson.build:30: DEPRECATION: Library r_socket was passed to
the "libraries" keyword argument of a previous call to generate() method
instead of first positional argument. Adding r_socket to "Requires" field,
but this is a deprecated behaviour that will change in a future version
of Meson. Please report the issue if this warning cannot be avoided in
your case.
2018-12-27 14:17:54 +01:00
dav1901
f24556c189 Fix few clang-analyzer warnings (#12548) 2018-12-24 01:18:12 +01:00
dav1901
303a57bb85 Minor code cleanups/fixes (#12519) 2018-12-20 11:50:29 +01:00
dav1901
9b0fbf1ee4 Minor code cleanups - free/R_FREE/etc 2018-11-13 00:23:49 +01:00
bannsec
e56d3de4ab Fix memleaks in ragg2 (#11788) 2018-10-12 12:18:22 +02:00
Riccardo Schirone
7677ef9246 Memleaks (fix #11389) (#11674)
* util/strbuf: r_return ification!
* r_core_anal_hasrefs returns malloced string, free it after use
* util/list: r_return ification
* anal/fcn: prevent memleaks of RListIter objects in fcn->fcn_locs
The fcn_locs list was not freed because we don't need to free functions
from fcn_locs but we free them in core->anal. However, the list->free
method was set, even if never used, so I removed it.
Moreover, we should free the fcn_locs list anyway (but not the elements
inside) because the RListIter elements have been allocated on the heap.
* egg: remove *uck message
* core/cbin: check returned list before using it
* core/cbin: check list before using it
* util/strbuf: fix r_return condition in strbuf_append
* libr/core: fix some possible NULL deref and avoid function ptr casts
* only fcn->fcn_locs doesn't need the free function, the others do
2018-10-01 09:33:30 -04:00
Paul I
bf29250ddd Fix #11487 (#11534) 2018-09-15 22:52:12 +02:00