Commit Graph

80 Commits

Author SHA1 Message Date
pancake
1e57fabb3e Warn when bypassing the word bounds of numeric arguments in wo ##write 2022-09-09 13:50:15 +02:00
pancake
0affc893be New syntax for wo[x]([n]+[v]) to differentiate hex and numbers ##write 2022-09-09 13:50:15 +02:00
pancake
cd10051282 Fix #20387 - woa 1 confusing error message ##shell
* Better help messages and argument handling
2022-09-09 13:50:15 +02:00
pancake
f9f9e367de Use rlog instead of eprintf in 300 more places 2022-08-22 14:35:04 +02:00
pancake
7a35f03471 More source spacing linting 2022-08-18 14:37:29 +02:00
Richard Patel
b78855c38d Refactor a few eprintf 'Cannot …' to R_LOG_ERROR 2022-08-01 16:46:46 +02: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
pancake
704bf823d1
Cleanup and boolify some more debug apis ##refactor 2021-10-04 20:56:34 +02:00
pancake
b4c4c0fe98 Implement 'woi' command to inverse contents of current block ##io 2021-09-18 22:16:45 +02:00
pancake
e7c29ed232
Boolify cfg.debug (#18452) 2021-03-14 22:22:04 +01:00
condret
eb48818342 Rename r_io_map_get to r_io_map_get_at ##io 2021-03-12 17:56:46 +01:00
Liumeo
a74ca8f07b
Remove core.file ##refactor (#18178) 2021-01-06 23:44:18 +01:00
pancake
839f438b58 Refactor tcc and afcl commands, improve help and JSON ##types 2021-01-05 02:17:37 +01:00
Lazula
243bc871c3 Multiple refactors in io and util ##io ##util ##refactor
* Add r_io_map macros throughout code base
* Update string NULL-checking with renamed functions r_str_get() and r_str_getf()
* Change string NULL-checks throughout code base to use functions
* Add r_str_get_fail() to specify a custom string to return if NULL-check fails
* Mark JSON to be updated with PJ with "TODO PJ"
* Incidental style updates such as missing spaces
2020-12-13 05:09:13 +01:00
Riccardo Schirone
c8f99840ab
r_core_seek accepts a boolean as 3rd argument (#16618)
Replaces all 0/1 passed as 3rd argument to r_core_seek with false/true.
2020-04-17 12:53:35 +02:00
pancake
a52506a362
Fix #16210 - Show error message and update help for we ##io (#16427)
* Fix wen command for io.va=true, add two tests
2020-04-08 14:22:01 +02:00
Liumeo
d41bc2b878
Comparison always false (#16444) 2020-04-06 22:47:27 +02:00
radare
6ae8806411
Do not use the elvis operator for bool expressions (#16073) 2020-02-28 15:19:37 +01:00
Florian Märkl
a5e11a3f55
Refactor Anal Hints (#15876) ##anal
* Use RVector for Address Hints
* Add Arch/Bits Hint Trees
* Add Unit Tests for Addr, Arch and Bits Hints
* Add unset for newbits
* Fix jmptbl hint fetching
* Fix r_anal_*_bits_foreach
* Print grouped Anal Hints
* Fix arch bit affect on disasm
* Add Reset Hints to Commands
2020-02-13 11:48:24 +01:00
GustavoLCR
42350f4942 Initial implementation of LX/LE file plugin ##bin 2019-12-28 18:46:14 +01:00
radare
9fc6367338
Fix ignored asm.bits settings because of RBin overrides ##asm (#15677) 2019-12-18 17:33:56 +01:00
Florian Märkl
5870b5df85 Fix Alignment Check in aae on bit change 2019-12-15 23:36:44 +01:00
pancake
865fd0b902 Fix regression in wo2/4/8 2019-09-03 09:49:14 +02:00
pancake
11c5cfe5a6 Fix a couple of bugs in wo* and implment wo8 ##io 2019-09-02 21:12:57 +02:00
bagginslin
c22844b506 Fix logic in 2-byte endian swap used by "wo2" (#14951) 2019-09-02 20:54:55 +02:00
bagginslin
d67d1634cf Fix #14936 - Add po[..] set of commands ##print (#14936) 2019-08-31 16:46:07 +02:00
pancake
bd520474d7 Code cleanup 2019-08-21 12:53:41 +02:00
Carles Pey
a3d9bf170e Consider endiannes when performing block write operations ##io (#14789) 2019-08-18 01:53:07 +02:00
radare
2f2e07e8f4
Some code cleanup in RUtil.lib ##core 2019-08-09 23:49:15 +02:00
pancake
baa91ca899 Initial working implementation of bin.libs ##bin 2019-07-05 19:03:03 +02:00
pancake
d4fefa1ff9 Set cmd.gprompt=.dr* when cfg.debug=true ##debug 2019-06-10 18:07:33 +02:00
radare
14d17d5b4e
Deprecate the RBinObject.id field ##refactoring 2019-06-05 19:23:59 -04:00
radare
aea7c35ffd
Implement RBinFile.at and make it work with e bin.at ##bin 2019-06-02 11:16:08 -04:00
pancake
24cebb4ed4 Fix assert in wai trying to write an empty buffer 2019-05-21 23:45:31 +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
radare
ab3a7be704
Almost completely kill RIOSection from io and core (-218LOC) ##refactoring
* Use RBinSection, RDebugMap or RIOMap instead
* Remove omps command
* Fix segfault in ?E+
* Improve anal.eobjmp (bug spotted after almost killing iosections)
2019-01-13 03:07:51 +01:00
radare
d1d9404907
Implement /s, /s* to search for sections depending on entropy ##search 2019-01-03 15:22:26 +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
GustavoLCR
7530895d0a Fix a few clang scan-build bugs (#12562)
* Removed unnecessary variable from libr/core/disasm.c
* Removed not necessary assignment in libr/core/casm.c
* Removed not used assignment in libr/bin/dwarf.c
* Rem. duplicate declaration and not used values
* Fixed potential memory leak in java/class.c
* Fixed potential memory leak in ragg2
* Removed unnecessary variable in visual.c
* Another potential memory leak in class.c
* Removed not used value assignment
* Fixed memory leak in dwarf.c
* Removed not needed assignments
* Remove more not used assignments
* Refactored where bin_sections gets arch & bits for clarity
* Removed more assignments that are not used
* Rem. more unused assignments
* Surround assignment with paranthesis
2018-12-26 12:54:12 +01:00
dav1901
024d65e288 Fix few more clang warnings (#12429) 2018-12-11 10:28:01 +01:00
Álvaro Felipe Melchor
23d01f869c Improvements arm/thumb analysis ##anal
* anal: arm: emulate correctly BX PC in arm32/thumb ##anal
* anal: arm: handle BX PC in analysis to propagate bits

PC is well known without ESIL, that way it is possible to propagate the
bits to correctly create the hints

* anal: arm: modify r_anal_build_range_on_hints ##anal

This function now accepts a second parameter that specify when to
dispose hints when overlapping.

The rationale is that if this is performed in a continuos basis, old
ranges are lost when in a latter stage in the analysis is inserted a new
hint.

For example, if we have something like

0x80000 -> 16 bits
0x82000 -> 16 bits

With the previous logic this would have been become

0x8000 -> 16 bits

However, during analysis a new hint like this might happen

0x8100 -> 32 bits

Therefore, 0x8200 which was 16 bits is lost.  With the second parameter
update, we postpone this until the user print the disassembly - we wait
until the end to clean up hints to speed up the looks up. However,
during analysis we mantain all the hints.

* anal: arm: handle better anal hints to increase performance ##anal

new API r_anal_hint_get_bits_at

This saves time for example on r_anal_build_range_on_hints without the
need to use heap for RAnalHints speeding up the analysis

Added cb when calling r_anal_hint_set_bits and rbtree for anal ranges
which improves lookups

fix __anal_range_tree_find_bits_at

fix conflicts and coding style

* arm: set anal hint when BL instruction
2018-11-22 21:31:54 +01:00
Neven Sajko
4a722e80d8 Add braces to if, else, for, while ... (#11504) 2018-09-13 10:17:26 +02:00
pancake
31ad955bab Use r_io_read_at instead of r_core_read_at which is now deprecated 2018-05-21 23:06:00 +02:00
Xilokar
d903205fc0 Force @b @a over hints (#9767) 2018-03-26 14:11:33 +02:00
Fangrui Song
ac4db23570 Report error if write fails. (#9416) 2018-02-17 19:05:04 -06:00
pancake
43420e4671 Add Vb[is] for imports/symbols 2018-01-24 10:47:33 +01:00
Ziyaddin Sadigov
d4dd6fd5e6 Fix typo regarding byte size (#9067) 2017-12-27 18:33:58 +01:00