Commit Graph

241 Commits

Author SHA1 Message Date
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
Neven Sajko
4a722e80d8 Add braces to if, else, for, while ... (#11504) 2018-09-13 10:17:26 +02:00
Riccardo Schirone
eee1385466
Meson private (#11331)
* meson: refactor library cflags
* meson: use visibility=hidden by default
* remove unused var
* magic/meson: replace tabs with spaces
2018-09-03 10:07:28 +02:00
Neven Sajko
d8784641ee Add parentheses in macros where needed for safety (#11290) 2018-08-30 13:16:50 +02:00
pancake
87eb500d32 Fix last coverity 2018-08-19 16:39:55 +02:00
radare
586bf7fc15
ragg2 *.c shows stderr and fix clang cflags (-Os makes non-pic code 🤦) (#11122) 2018-08-18 03:41:24 +02:00
Jacob Rosenthal
ef781d0add Check for macos as well as darwin (#11090) 2018-08-16 04:18:37 +02:00
Benjamin Levy
98fa58028a Add -fno-stack-protector to ragg2 CFLAGS 2018-08-01 00:55:18 +01:00
Riccardo Schirone
7572f315ea
meson improvements (#10617)
* meson.build: fix meson build when not on git
* meson.build: make capstone a dependency
* meson.build: make r_magic library optional
* meson.build: capstone include is already in the dependency
* meson.build: use dependencies instead of manual linking + includes
* meson.build: add travis
* flag/meson.build: include sdb dependency
* travis-script: print messages based on install system
* io/meson.build: add sdb as dependency
* syscall/meson.build: missing sdb dependency
* {parse,config}/meson.build: add sdb dependency
* travis.yml: pass INSTALL_SYSTEM var to docker
* {bin/shlr}/meson.build: add sdb_dep to r2java and bin
* install meson and ninja-build in r2-travis docker
* travis.yml: allow meson build to fail for now
* anal/meson.build: add sdb and java dependencies
* egg/meson.build: add sdb dependency
* travis.yml: meson build env should be also in the includes list
* core/meson.build: add java dep
* meson.build: use dependencies also to create main r2 dependency
* rasm2/meson.build: replace link_with with dependencies
* rasm2/meson.build: add sdb as dependency
* meson.builds: convert link_with to dependencies and fix tabs
* travis-script: change meson install prefix and set PKG_CONFIG_PATH
* travis-script: add lib64 to LD_LIBRARY_PATH
2018-07-09 16:58:38 +02:00
pancake
4a3057f9fc s/\r\n/\n/g 2018-05-21 22:13:07 +02:00
Paul I
7e9f982849 Meson: some cleanup (#10076) 2018-05-16 10:24:35 +02:00
pancake
9faa4f695b Fix crash in ragg2 for x86-64 (and spit 'dword' in mov) 2018-05-13 03:59:37 +02:00
Paul I
cc90ec6be5 [WIP] Move hardcoded paths to r_userconf.h (#9959)
* Move hardcoded paths to r_userconf.h

* Add R2_HOME_* macros

* Some cleanup
2018-04-28 10:02:55 +02:00
Paul I
40b4a5b557 Meson: disable libversion info for Windows (#9858) 2018-04-10 22:44:54 +02:00
Paul I
ca3652da4b Meson: Add version info for shared libs (#9763) 2018-03-24 18:18:32 +01:00
Paul I
4e73ad7d19 Meson: some cleanup (#9753) 2018-03-23 07:47:46 +01:00
Gromimousse
a5c9fc7855 Ragg2-cc -> Ragg2 merge (#9658)
- change of 'access' function for 'r_file_exists' for windows portability
- several changes in the way ragg2.c is done, see PR #9658 pancake comments
- change function for the remove of 'file'.text
- open changed for r_file_dump
- some elt of cEnv_t are now const
- skip all the pointers verification in set_cEnv but do them in check_cEnv instead
- add 2 r_str_sanitize for file and CC in parseCFile
- rewrite the removal of .o, .tmp, .bin, .s files, with cleaner code
- changed the long command with sed and grep to 2 C functions.
  - The function parseCompiled that basically does what the command was doing
  - And r_str_stripLines that is equivalent to "grep -v" (maybe we should put this one in str.c ?)
- simplify a bit getCompiler function with a const char* array
- add ternary operator for armOrMips condition
- use r_file_path for finding path to compilers
- new file created in libr/egg which contains all the C file parser
- modifications of 2 files to match the change :
  - libr/egg/r_egg.h
  - libr/egg/Makefile
- the function r_str_stripLine is simplier (the mallocs wasn't needed)
- the function r_str_stripLine is moved to libr/util/str.c
- libr/include/r_util/r_str.h is changed accordingly
2018-03-15 11:48:21 +01:00