Commit Graph

28 Commits

Author SHA1 Message Date
radare
a875795bb5
Completely eliminate the bytes apis in RBin ##bin
* Huge bytes->buffer on almost all the plugins, break API and ABI \o/
* Changed the way RBinFiles are created
* Changed the structure of the Sdb instance
* Improve ELF and MZ detection mechanisms to reduce false positives
* Change all the free/destroy methods to return void
* Fix "ks" shell
* Simplify and change the way RBinWrite apis work
2019-05-27 18:18:01 +02: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
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
Neven Sajko
4a722e80d8 Add braces to if, else, for, while ... (#11504) 2018-09-13 10:17:26 +02:00
Fangrui Song
814ad1d8b3 Boolify r_bin_wr_output (#8412) 2017-09-04 02:59:53 +02:00
pancake
5867365cd5 Add dummy work for mach0 in rabin2 -O 2016-04-07 15:42:06 +02:00
pancake
666d457708 Add rabin2 -O e/new-entrypoint-address (ELF only atm) 2016-01-14 14:42:36 +01:00
pancake
cfb03d3772 More indentation fixes 2015-12-09 00:27:31 +01:00
pancake
a4fc08b401 More auto-indentation enhancements 2015-12-08 23:55:23 +01:00
pancake
c4e0ac2885 Fix rabin2 -O sync issue and update manpage 2015-11-30 00:10:28 +01:00
pancake
ad6baf0824 Add rpath and scnperm in rabin2 -O 2015-11-27 20:37:27 +01:00
pancake
87162dc8bf Add wta support for appending dump. 2015-04-03 04:11:26 +02:00
deeso
1fbc7f2168 Added load_bytes, Pushed curplugin down to RBinObj, Reworking the RBinFIle loading to accomodate RBinObj reworked how all bins are loaded. Needed to hack IO to make
this work with rbinfiles and rbinobjects.

Conflicts:
	libr/bin/bin.c
	libr/bin/p/bin_te.c
2014-05-13 21:54:18 -05:00
Adam Pridgen
db1bb1a089 Changed the location of RBinObject, and created RBinFile to conform similarly to
RCoreFile, where RBinFile contains meta information for RBinObjects.  Now
RBinFiles are swapped out along with the RCoreFile when the priority is changed.
2014-01-20 02:44:25 +01:00
pancake
26a7854dd6 Rewrite DEX parser 2013-04-25 03:42:17 +02:00
pancake
9362041562 Huge RBin refactoring and fix mach0 section perms 2012-08-04 23:48:06 +02:00
pancake
370c4ceed5 * Some usability enhacements for the visual hud
* Do not load huge sections. crappy bins!
2012-01-31 03:34:23 +01:00
pancake
e557d9a385 * Drop 'r_cons.h' from r_fs
* Fix visual glitch in Vej and Vt
* Handle demangled names as comments
  - in rabin2 and core->bin_load
  - Needs to be a RAnalCall at some point
  - bin_java calls the dummy r_bin_demangle_java
  - Add R_BIN_NM_ANY enum
* Add asm.lbytes config to align disasm bytes to left
* Fix visual glitch in function boundaries
* Import upgraded versions of the idc2rdb scripts in doc/
2011-02-25 04:19:30 +01:00
Nibble
cec1f3fa73 * r_bin
- Refactor r_bin to work better with big fatbins
  - Don't load all sub-bins in memory
    Only load the fatbin and the selected sub-bin
  - Add r_bin_set_archidx() and r_bin_list_archs()
  - Update t/{rpathdel.c, test_meta.c}
* rabin2
  - Use '-f str' to select sub-bin by name
2010-10-04 03:46:58 +02:00
Nibble
793dae395d * Massive refactoring of r_bin
- Add support for fatbins (currently only fatmach0)
  - Minimize creation of r_buffers
* rabin2
  - Add flag -A for listing archs
  - Add flags -a and -B for selecting arch
  - In the next commit -A and -B will be removed and -a will work
    with the following format:
    [-a arch bits] for selecting arch
	[-a] for listing them

--HG--
rename : libr/bin/p/bin_fatmach0.c => libr/bin/p/bin_xtr_fatmach0.c
2010-09-24 21:23:13 +02:00
Nibble
49f977a696 * r_bin
- Add support for reading/removing rpath to r_bin_elf
  - Add r_bin_wr_rpath_del
  - Un-R_API r_bin_elf
  - Add rpathdel.c into bin/t/
2010-03-16 02:24:12 +01:00
Nibble
ca66fe440d * r_util
- Fix r_buf_write_at
* r_bin
  - Some fixups in section resize (now is fully working)
  - Minor r_bin_wr_output refactoring
2010-03-11 13:18:49 +01:00
Nibble
423d6a75f4 * r_bin
- More work on r_bin write
  - Add elf & elf64 section resize
    Needs refactoring and split into basic operations
* rabin2
  - Rename flag -o to -O for operations
  - Add flag -o for output file
  - Add resize operation (-O r/.data/1024) for testing purposes
2010-03-11 02:14:34 +01:00
Nibble
77f9377d1d * r_bin
- More work on write support
  - Initial API design
  - Fix typo in bin_write_elf.c filename

--HG--
rename : libr/bin/p/bin_wite_elf.c => libr/bin/p/bin_write_elf.c
2010-03-09 15:12:04 +01:00
Nibble
30a31d3970 * r_util
- Fix memory leak in r_list_free
  - Update test in list.c
* r_bin
  - Add dummy function for elf section resize
2010-03-08 19:40:21 +01:00
Nibble
420acc3ff3 * Add dummy local-var analysis stuff to r_anal
* Check return value of r_anal_set_bits in asm.bits callback
2010-03-07 14:00:26 +01:00