Commit Graph

63 Commits

Author SHA1 Message Date
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
pancake
7e0db0ff8f Fix #8941 - Fix crash in arm.winedbg (null deref) 2017-12-03 13:10:59 +01:00
pancake
fb35122459 Some code cleanup 2017-10-22 23:52:39 +02:00
pancake
94b2fc64d2 Implement RIODescData and adjust RIOMach to work with it
- Handles a magic to ensure the destination struct is the expected one
- Based on r_str_hash, but it must be cached
- Use more r_io_desc_get_pid ()
2017-09-11 01:24:13 +02:00
alvarofe
5d29ca1af6 Fix type matching tests 2017-09-02 22:31:08 +02:00
Fangrui Song
800fed2e31 Fix wt #8394 2017-09-01 19:34:09 +02:00
pancake
949fc79e37 Fix last covs 2017-08-27 13:42:16 +02:00
pancake
16dcd8c10e Fix r_io_seek and coreBlockShift crash 2017-08-25 23:45:37 +02:00
condret
b0c612bf0f kill is_valid_section_offset (#8288) 2017-08-24 00:19:57 +02:00
pancake
9189886f75 Fix infinite loop in afta and other bugs 2017-08-23 00:50:15 +02:00
condret
0161fa0ec2 make read_at bool again and implement RIOAccessLog for accurate error-handling
This reverts commit a9bf4aae2b.
2017-08-22 17:24:04 +00:00
Fangrui Song
a9bf4aae2b Misc fixes to siol (#8262)
* Fix onIterMap (divide-and-conquer like USACO Shaping Regions), check return values of every `op` call
* Change return types of r_io_read_at and friends back to `int`
* Fix some analysis tests and others
* Fix mem leaks
2017-08-22 10:46:48 +02:00
condret
2f201bded0 opsalamance - merge the big siol branch
- Thanks @MaskRay and @condret
2017-08-22 09:42:16 +02:00
alvarofe
2e462ec8f0 Bring RIODesc from SIOL and cleanup 2017-08-18 01:31:57 +00:00
Tzaoh
991a1b8dd9 Replace dh for dL (#7682)
* Replace dh for dL

* Changed places where 'dh' cmd was used.
2017-06-05 14:45:45 +02:00
pancake
e641318973 Fix a bunch of bugs reported by clang-analyzer 2017-04-17 19:59:14 +02:00
pancake
676c7d7176 Some more tiny changes comming from siol into master 2017-03-15 11:06:19 +01:00
Álvaro Felipe Melchor
b245751f33 Arm (#6966)
* Fix issue with arm/thumb bits detection

* r2-indent cmd_print.c
2017-03-09 23:29:48 +01:00