Commit graph

21 commits

Author SHA1 Message Date
Huzaifa
e82033d92c
Convert from rz_str_new to rz_str_dup (#4178) 2024-02-07 00:07:53 +08:00
Peiwei Hu
0e6ca28841
Refactor trycatch and classes from RzList to RzPVector (#3859)
* Refactor trycatch-related stuff from RzList to RzPVector
* Refactor classes-related stuff from RzList to RzPVector
* classes in RzBinPlugin (RzList -> RzPVector)
* classes in RzBinObject (RzList -> RzPVector)
* remove the deprecated API rz_bin_get_classes
2023-09-17 10:57:20 +08:00
wargio
c85b1afa4c Rewrite how bins are loaded into RzBinObject
This commit rewrites completely how RzBinPlugin are used to load info
into the RzBinObject structure.

Main changes are:
- Avoid looping multiple times to set the same data:
  now the data is cycled only once to rebase addresses, demangle strings
  and to make each loaded structure similar to each other.

- rz_bin_demangle is now demangling only strings:
  the old implementation was a hack over a hack to add classes & methods
  into the RzBinObject while demangling a string.
  This allowed methods and classes to be added to RzBinObject when for
  example invoking `is` or other printing commands.
  This was meant to be an "optimization" to avoid looping and doing
  things on-the-fly.

- Now the demangling is done after guessing the language used in the bin.
  This is done to avoid looping to various demanglers hoping that a
  string is going to be correctly demangled.
  After each string is demangled, the string is given to the language
  related function which adds classes, methods and fields into the
  RzBinObject fields.

- Swift handling is a special case, since the demangler can be disabled
  via -Duse_swift_demangler.
  The issue with the swift demangler is that is not correctly demangling
  strings and outputting swift code, but instead is creating something
  that sometimes works, sometimes doesn't.
  Also the old code only added fields and never methods for "reasons",
  and the new code just uses what the old code was doing as is.

- The new code also takes advantage of the language detection, which now
  happens before the demangling of symbols, imports and relocs.
2023-06-01 23:16:09 +08:00
Florian Märkl
d45078d639
Fix assertions in test_serialize_analysis (#3239)
RzAnalysis.ev is injected after creation and may be NULL.
2022-12-11 00:36:22 +08:00
wingdeans
a6a7a5f530 Fix annotation inconsistencies 2022-08-03 00:29:56 -04:00
Dean
6b7ea38969
Prepare headers for rz-bindgen (#2786)
* add some missing /*<types>*/ to rz_core, bin, analysis, cons
* add annotation attributes for rz-bindgen
* fix extern "C" in some headers
* rename RzBuffer functions from length to len
* fix rz_core_analysis_name naming conflict
2022-07-22 01:09:19 +08:00
Paul I
dd6de07c96
Convert ac commands to rzshell (#2160) 2022-01-08 10:58:43 +08:00
Dhruv Maroo
34d345d884 Format according to clang-format-13 2021-11-25 15:44:28 +08:00
Anton Kochkov
c4c6073074
Various memory leaks and UAF fixes (#1876)
* Fix CID 359880
* Fix CID 359879
* Fix CID 359878
* Fix CID 358605
* Fix CID 358598
* Fix CID 358593
* Fix CID 358591
* Fix CID 358591
* Fix CID 358574
* Fix CID 358573
* Fix CID 358570
* Fix CID 358561
* Fix CID 358551
* Fix CID 358551
* Fix CID 358541
* Fix CID 358531
* Fix CID 358525
* Fix CID 358521
* Fix CID 357819
* Fix CID 357816
* Fix CID 357646
* Fix CID 357646
* Fix CID 357645
* Fix CID 357643
* Fix CID 356605
* Fix CID 356312
* Fix CID 354046
* Fix CID 354036
* Fix PDB unit tests
2021-10-24 10:22:30 +08:00
Florian Märkl
65d567282b
Remove length restrictions in analysis classes and various serializations (#1718) 2021-09-18 16:48:14 +02:00
Florian Märkl
24c4f6cc09
Remove all PJEncodings (#1200) 2021-06-09 15:47:49 +02:00
Paul I
dd7e30d286 Fix segfaults in librz/analysis/class.c 2021-04-26 23:33:12 +08:00
TyeYeah
dc098a0ec4
Complete "acvf" command to better look up function address on vtable offset (#855)
* edit rtti_itanium.c and rtti_msvc.c, and update 2 tests using bins in rizin-testbins
* delete redundant vtable parsing
* alter parameters of recovery_apply_vtable()
* add filters for offset
2021-03-27 20:17:11 +08:00
Florian Märkl
286ad570c8
Fix C++ Compilation of Headers 2021-03-20 10:46:17 +01:00
Basstorm
aaf96b9697
Simply implement constructor detection and improve acll output pattern (#852)
* constructor and destructor detection simply by name
* improve method output pattern
* update test cases
2021-03-17 22:43:52 +08:00
Basstorm
31a2406f46
Pull Bin Classes into Analysis Classes in automated Analysis (#819) 2021-03-16 17:18:13 +00:00
Basstorm
3b0a4d2408
Fix display duplicate vtable in multiple use “aaa” command (#811)
* Fix display duplicate vtable in multiple use “aaa” command
* Fix vtables vector not being freed
* Add test for duplicate vtable displayed in `acll` command

Co-authored-by: parallels <parallels@vmdevelop.lan>
2021-03-12 16:50:54 +08:00
Riccardo Schirone
53bf5c497f SPDX Copyright text for all files based on history
- Add LICENSES directory
- Download additional licenses used
- Add .reuse directory
- Add doc about SPDX/reuse

Co-authored-by: Florian Märkl <info@florianmaerkl.de>
2021-03-05 19:39:15 +08:00
Anton Kochkov
a0be4e2e64 Run clang-format 2021-01-21 22:05:44 +08:00
Anton Kochkov
ad36954adb
More renames of *anal* to *analysis* (#123) 2020-12-07 13:20:29 +01:00
Anton Kochkov
041d73dce3
Change the "anal" abbreviation to "Analysis" in Code (#117) 2020-12-06 19:25:27 +01:00
Renamed from librz/anal/class.c (Browse further)