100 Commits
Author SHA1 Message Date
billow e16786f799 M68k rzil base (#6706) 2026-10-11 12:06:06 +00:00
billow 7381fae172 Update capstone-next to 95c74d3d (#6698) 2026-09-04 19:28:45 +08:00
billow 73b070d397 Update libdemangle to revision 4a0af689 (#6690)
Co-authored-by agent: root/GPT-5
2026-08-29 17:21:04 +00:00
billow f82d6e2104 Fix CID 912643: Overflowed constant (INTEGER_OVERFLOW) (#6667)
Guard infinity encoding against invalid formats
2026-08-15 11:46:58 +08:00
billow 19b1783c88 Improve RzIL floating-point support (#6626)
The `RzFloat` changes fix or improve:

- binary80 explicit-integer-bit, pseudo-value, infinity, and NaN handling;
- binary16 conversions;
- gradual underflow and directed rounding;
- overflow, underflow, invalid-operation, and inexact exception reporting;
- exception propagation through nested conversions and arithmetic operations;
- binary80 fused multiply-add rounding, including reduced-precision and double-rounding edge cases;
- thread-local SoftFloat state, preventing rounding state from leaking between threads.

The `RzIL` changes add scoped binary80 precision support through `RzFloatRPrecision` and `FWITH_RPREC`. The supported precisions are 32, 64, and 80. Precision scopes restore the
previous thread-local SoftFloat state after successful evaluation and evaluation failures.

Runtime rounding modes are represented explicitly by dedicated pure opcodes:

- `FCONVERT_WITH_RMODE`
- `FROUND_WITH_RMODE`
- `FSQRT_WITH_RMODE`
- `FADD_WITH_RMODE`
- `FSUB_WITH_RMODE`
- `FMUL_WITH_RMODE`
- `FDIV_WITH_RMODE`
- `FMOD_WITH_RMODE`

Their rounding-mode operand is a 32-bit IL bitvector whose values correspond to `RzFloatRMode`: RNE, RNA, RTP, RTN, and RTZ. Invalid operand widths are rejected by validation,
while invalid runtime values cause evaluation to fail with an error.

Dedicated opcodes keep runtime-controlled floating-point expressions compact. This is useful for architectures whose rounding mode is selected from register state and avoids the
expression duplication caused by expanding every operation into nested `ITE` branches.

The new operations are supported by:

- construction, duplication, and destruction;
- type and operand validation;
- VM evaluation;
- plain, Unicode, and JSON exporters;
- graph output and opcode stringification.

`FEXCEPT` now emits a VM event only when the queried exception is present, while preserving exceptions raised by nested conversions and arithmetic operations.
2026-08-10 01:06:17 +08:00
billow ffacc9e08f Update capstone-next and support Alpha instruction ID variants (#6621)
* Support Capstone Alpha instruction ID variants
* Update capstone-next to ae11e423
* Fix memory leaks in rz-asm
2026-07-17 00:53:43 +08:00
billow bb3b7cc7b1 Add JSON projection grep (#6522) 2026-06-22 17:17:20 +00:00
billow 944816d364 ci: fix linter job (#6523) 2026-06-17 23:14:21 +08:00
billow 0421f03afe Fix bin hunk/smd plugin ownership leaks (#6515) 2026-06-16 15:45:53 +00:00
billow 9e7cc02fcf Update Capstone and add M68k ColdFire support (#6399)
* Update Capstone and add m68k ColdFire support
* Fix test 'core regs linux m68k'
* Add M68K ColdFire integration coverage
* Update Capstone v6 to version 6.0.0-Alpha9
* Refactor CPU mode detection to use case-insensitive string comparison
* Update Capstone next revision to 3df6ff0
2026-05-31 16:15:56 +08:00
billow d4ff5b7f95 librz/arch: fix m68k CPU32 detection with Capstone v6 (#6314)
Co-authored-by agent: Codex/GPT-5
2026-05-05 23:39:52 +08:00
billow 4e7c9af04c Update capstone for M68k (#6309)
* Bump capstone to the latest next
* Add capstone M68k changes
* Update M68k instruction size and fix tests
* Add M68K assembly instruction definitions for 68000, 68020, 68030, 68060, and CPU32
* Update maxopsz to 22 for bflt, hunk, and smd formats
* Add M68k ELF coredump parsing support
2026-05-05 03:16:53 +08:00
billowandGiovanni 71aa8bf1dd Fix memory leaks related to DWARF (#6245)
* fix: memory leak rz_analysis_op_fini op->src

* fix: memory leak, replaced `rz_type_clone` with `rz_type_clone_shallow` to resolve the memory leak in `rz_type_free(type.callable)`

* fix: memory leak in try_create_var_global

* fix: memory leak in dwarf

* fix: remove redundant memset calls and add documentation for rz_type_clone_shallow

* Update librz/arch/op.c

Co-authored-by: Giovanni <[email protected]>

* fix: set free and free_user to NULL in vector copy when item_cpy is not provided

---------

Co-authored-by: Giovanni <[email protected]>
2026-04-17 17:33:11 +00:00
billow 004653cc87 bump rz-libdemangle to ba048810ee76da1f2b4c62e408f13d5bcb937b87 (#6056) 2026-03-21 02:47:43 +08:00
billow 2718026d27 Update libdemangle to revision 2d1d726 (#5949) 2026-02-21 03:15:18 +08:00
billow b4ca5641e6 Update libdemangle (#5850)
* Update libdemangle to revision 37f9e9e
* Fix: C++ demangler plugin definition
* Fix: update tests
2026-02-19 12:20:29 +08:00
billow 3e6b2f7fd0 h8300: enhance compatibility for h8300h/h8300l (#5444)
* refactor h8300 register handling and improve operand definitions

h8500: add h8500h/l support

* Fix operand references in H8300 assembly instructions and update operand width handling

* Add support for H8300 instruction formats with 32-bit immediate values

* Refactor H8300 instruction decoding and operand handling for improved clarity and maintainability

* Refactor H8300 instruction decoding to enhance CPU type handling and improve code clarity

* Add H8300L specific instruction decoding for MOVFPE and MOVTPE

* Refactor stack pointer handling for H8300 instruction set to support CPU type differentiation

* Add H8300H specific register profile to enhance CPU differentiation

* Refactor H8300 instruction handling to improve CPU type differentiation and clarity

* Enhance H8300 instruction handling for CPU type differentiation in post-increment and pre-decrement operations

* h8300: add explicit `inline` mark
2025-10-17 16:28:21 +00:00
billow 697bb8ffbc linter: update clang-format entries in .git-blame-ignore-revs (#5453) 2025-10-12 12:07:13 +08:00
billow 7a77b8f7bd linter: update clang-format installation to version 20 (#5451)
* fix: format with clang-format-20
* fix: fix clang-format linter with rewrite '^#define.*/\*.*\\$'
* fix: update clang-format to version 20 in workflows and documentation
* fix: add SPDX license information to .git-blame-ignore-revs
2025-10-12 08:02:03 +08:00
billow ac55cf4675 h8500: fix coverity issues (#5442)
- Implement str_replace_once_no_heap function for safer string replacements
2025-10-09 16:13:05 +08:00
68da5f7db2 Add Renesas H8/500 plugin (#5340)
* add h8/500 plugin stub

* refactor h8500 instruction parsing and disassembly logic

* fix: remove debug print statement from h8500 EA parsing
fix: correct plugin name from h8300 to h8500
add: new test case for h8500 disassembly

* refactor: improve operand parsing and disassembly logic for h8500

* refactor: update operand representation in h8500 EA parsing

* refactor: enhance operand definitions and add test cases for h8500 instructions

* fix: add h8500 disassembly plugin to command lists

* refactor: enhance H8500 instruction and operand structures for better parsing

* refactor: update H8500 instruction set with size suffixes and enhance operand handling

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

* refactor: update H8500 operand handling and address mode definitions for consistency

* refactor: update H8500 addressing flags and operand handling for consistency

* refactor: update H8500 immediate operand syntax to use '#' prefix for consistency

* refactor: update H8500 addressing modes and mnemonics for consistency

* refactor: add new H8500 instructions BNOT, BSET, BSR, and BTST with operand handling

* refactor: update H8500 opcode definitions and add new CLR and CMP instructions

* refactor: add DADD instruction to H8500 opcode definitions and update related tests

* fix: correct memory copy size in h8500_instruction_parse function

* refactor: add DIVXU, EXTS, and EXTU instructions to H8500 opcode definitions and update tests

* refactor: add JMP instruction to H8500 opcode definitions and update tests

* refactor: add JSR instruction to H8500 opcode definitions and update tests

* refactor: add LDC, LDM, and LINK instructions to H8500 opcode definitions and update tests

* Update librz/arch/isa/h8500/h8500.c

Co-authored-by: Copilot <[email protected]>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

* refactor: update H8500 addressing mode and operand flags to use ut64 type

* refactor: update H8500 addressing modes and add MOV instruction test cases

* feat: add MOVFPE, MOVTPE, and MULXU instructions to H8500 opcode and assembly

* feat: add NEG, NOT, and NOP instructions to H8500 opcode and assembly

* feat: enhance H8500 opcode with new instructions and EA flags

* fix: change enum to typedef enum for addressing mode definition

* pjmp

* pjsr | prts

* rot*

* rt*

* scb

* sh*

* sleep | stc | stm

* sub*

* swap

* tas | trapa | trap/vs | tst

* fin disas

* fix header

* add h8500_reg_name function to retrieve register names

* implement H8500 instruction analysis and operand value extraction

* refactor H8500 addressing modes and operand definitions for clarity

* fix msvc 2017 build

* fmt

* fix: update description for H8500 disassembler plugin

* fix: cmd test

* fix: coff h8500 support

* add author and cpus

* fix: test cmd

* feat: add instruction operand string retrieval and new instruction test

* fix: change operand length type from size_t to int in h8500 instruction parsing functions

* feat: add dsub instruction and update operand syntax in h8500 assembly files

* feat: update h8500 opcode descriptions and add new branch instructions

* Fix coff permissions when rz_coff_perms_from_section_flags returns 0

* Fix missing op->size

* refactor: update addressing mode macros and improve operand handling in h8500

* Refactor assembly syntax for H8500 instructions

- Added spaces for better readability in the assembly instruction definitions.
- Updated the formatting of operand lists to include spaces around commas.
- Ensured consistency in the formatting of immediate values and register references.
- Adjusted the assembly test cases to reflect the new formatting style.

* fix: correct permissions for .drectve sections in COFF format

* feat: add initial test cases for h8500 registers and analysis

* fix: add comment to clarify H8300 machine definition in COFF specs

* fix: correct typo in expected output for h8500 analysis

* fix: update data type and constants for H8500 pattern checks

* fix: apply suggestion

* fix: update H8500 instruction encoding and address modes

* fix: add cmp.b and cmp.w instructions for H8500

* fix: refactor H8500 analysis for improved address mode handling

* fix: enhance H8500 analysis for improved operand handling and stack operations

* fix: improve operand handling in H8500 analysis for better instruction processing

* fix: update PJSR instruction format for H8500 and enhance CMP instruction handling

* fix: enhance H8500 function analysis with additional metadata for varfunc and leaffunc

* fix: add documentation and clarify PC-relative mode handling in H8500 instruction parsing

* fix: correct PJMP instruction format to include address dereferencing

* Update librz/arch/isa/h8500/h8500.c

Co-authored-by: Giovanni <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: wargio <[email protected]>
Co-authored-by: Giovanni <[email protected]>
2025-10-03 13:10:55 +00:00
billow 498b990dc5 fix gdb io plugin .open (#5375) 2025-09-14 13:37:00 +00:00
billow e72cec47ea librz/arch: add RZIL support for H8/300 and H8/300H (#5119)
* Refactor H8/300 disassembly plugin
* Add support for H8/300H architecture
* Extract ESIL uplifting for H8/300
* Implement RzIL uplifting for H8/300 and H8/300H
* Add `rz_bits_sign_ext{8,16,32,64}`
2025-08-04 12:40:43 +08:00
billow 4cdd46b54e librz/bin/dwarf: add xtensa register mapping (#4878) 2025-02-06 11:50:05 +08:00
billow b196a1f503 fix DWARF parsing leaks (#4818)
* fix leak in `variable_from_die`
* fix leak in `rz_base_type_clone`
2025-01-09 22:43:45 +08:00
billow 5de89912b5 cmd: sort avgl output by address (#4803) 2024-12-29 01:27:26 +08:00
billow 42302da16d librz/arch: add Xtensa RzIL support (#4712)
- **Add support for rzIL**: Implement various Xtensa instructions and functionalities.
- **Instruction Set Additions**:
  - **Arithmetic and Logical Operations**: sub*, add*, and*, or*, xor*, mul*, div*, rem*, neg*, abs, addi*, addmi, addexp*, addexpm*, addx2|4|8
  - **Bitwise Operations**: srl*, sra*, sll*, andb, andbc, nsau, nsa
  - **Branching and Jumps**: b*, beq*, bne*, ball, bany, bnall, bnone, j, jx, loop*, loopgez, loopnez
  - **Data Transfer**: st*, ld*, l32*, l16*, l8ui, ssi*, ssa*, src
  - **Floating Point**: sqrt0.s, float.s, floor.s, trunc*, ueq*, ule*, ult*, ufloat*, neg.s, oeq.s, ole.s, olt.s, min, max, clamps, nex
  - **System Calls and Synchronization**: syscall, simcall, entry, isync, dsync, esync, rsync, memw
  - **Miscellaneous**: const_s, extui, extw, excw, sext, witlb, wur, rur.*, mksadj.ss, mkdadj.s, const_s
- **Testing and Patches**:
  - Implement asm tests for all
- **Miscellaneous Improvements**:
  - Update Capstone and fix ARM architecture support for building.
2024-12-26 01:55:38 +08:00
billow 4c055aaffa test: add DWARF with Unicode names test (#4794) 2024-12-26 01:32:02 +08:00
billow 0cabfd2bc5 rzil: add VM event memory (read|write) index (#4789)
This is because the memory of the RzIL VM has an index, but the index is ignored when an event is generated.
2024-12-24 23:35:42 +08:00
billow 1330aa74c4 rz-test: add -y option to accept all (#4772)
* Add rz-test '-y' option to accept all
* Add '-y' into the help text
2024-12-22 17:20:57 +08:00
billow 801f2ace9e rzil: add 'fexcept'|'FEXCEPT' (#4771) 2024-12-18 13:39:01 +08:00
billow 7637377a45 fix: DWARF5 DW_FORM_strx and '.debug_str_offsets' section load (#4752)
* Fix dwarf5 DW_FORM_strx and '.debug_str_offsets' section load
* Add 'cb_dwo_path' and fix dwo load
* Add test
2024-11-30 20:43:27 +08:00
billow bb10d60d79 librz/arch: enable xtensa plugin only for capstone next (#4708) 2024-11-11 15:23:35 +08:00
billow c3c494d961 librz/arch: migrate Xtensa to Capstone (#4654)
* Add xtensa arch capstone plugin
* Remove xtensa-gnu
* fix: `asm.cpu` is not set correctly, when there is no “,” in asm plugin -> cpus
* fix core_disassembly when n_bytes==0
* fix xtensa_analyze_op_esil
* fix xtensa esil pc mod
* fix xtensa esil l32r
* fix xtensa esil call0
* fix xtensa esil extui
* fix xtensa esil store
* fix xtensa stack inc and ret
* keep `asm.cpu` when valid in cb_asmarch
* fix cb_asmarch
* fix max op size
* xtensa: add cpu select
* xtensa: mark PUSH POP
* xtensa: set src dst
* xtensa: set dir
* xtensa: fix stackframe
2024-11-11 00:38:54 +08:00
billow c6a3512866 librz/arch/tricore: bump capstone and fix RzIL generation (#4696)
* bump capstone next f6f967961b913cf4fc1c6233f6cf42194a0938ca
* fix: tricore il and test
* Fix code scanning alert no. 1874: Multiplication result converted to larger type
2024-11-03 19:47:12 +08:00
billow 2a42a6f8c5 fix: dwarf line op loading (#4669) 2024-10-14 23:44:56 +08:00
billow a13438b232 analysis/dwarf: load sourceline information for global variables (#4635)
* refactor `rz_analysis_var_global_list_show`
* Adding source line information to global variables (DWARF only)
* Add test `global variables list`
2024-09-16 03:26:09 +08:00
billow a02e608075 Fix "pic18 call instructions not detected" (#4532)
* pic18: add test and fix analysis
2024-06-04 12:31:59 +08:00
billow 255f6fdd0f tricore: lift remaining floating point instructions (#4514)
* tricore: fix `mfcr` and `mtcr`
* tricore: `ftoi`
* tricore: fix `round_to_integer`
* tricore: tricore_il_fp.inc
* tricore: fix `ftoi` `ftoiz`
* rzil: Add `rz_il_op_new_float_from_rz_float`
* tricore: add `ftoq31`
* tricore: add `ftou`
* tricore: fix `hptof` and `ftohp`
* tricore: set flags and `itof` `q31tof` `utof`
* tricore: add.f sub.f mul.f div.f
* tricore: qseed.f
* tricore: madd.f msub.f
* tricore: add rzil asm tests
* rzil: validate il op when `aoi`
* tricore : add fp emulateme test
2024-06-03 16:36:50 +08:00
billowandbrightprogrammer 14e97874a3 pic: add RzIL uplifting (#4322)
- Add uplifters
- Add memory maps for different devices in PIC16F family
- Fix pic18 register mapping
- Fix pic18 asm
- Detect pic arch
- Add pic_archinfo
- Extract ESIL uplifting to a separate file
- Support RZ_ANALYSIS_OP_MASK_DISASM
- Add pic18 emulateme test
- Add pic16 emulateme test

---------

Co-authored-by: brightprogrammer <[email protected]>
2024-05-19 12:17:53 +08:00
billow a420733022 RzIL: add aezsue to support Step until PC equals given address and output VM changes (#4466) 2024-05-04 09:31:02 +08:00
billow ea460e54c2 DWARF: fix type process with the same name (#4454)
* DWARF: Remove memory allocation for RzBinDwarfLocListEntry->range
* DWARF: fix type process with the same name
2024-04-21 22:56:22 +08:00
billow 8f7f03cff6 TriCore IL: fix CSUB/CSUBN (#4409) 2024-04-01 07:45:33 +08:00
billow 30eef53291 dwarf: refactor
- Remove dwarf's dependency on RzBuffer

- Delete `cdwarf.c` and move dwarfdump (`id`) related functions to their respective modules

- Improved output of dwarfdump (`id`)

- add more DW_AT*

- fix escape

- fix debuglink

- remove cache in RzBinDwarfStr

- replace `rz_bin_dwarf_rnglists_parse_at` with `rz_bin_dwarf_rnglists_get`

- remove rz_bin_dwarf_loclists_parse_at

- fix logging

- cache all escaped strings
2024-03-09 09:41:13 +08:00
billow cae54ff8d9 uleb128: fix sign extend in read_i{32,64}_leb128 2024-03-09 09:41:13 +08:00
billow 4a0dca6613 java: fix java_class_parse (#4318) 2024-03-03 13:45:48 +08:00
billow 3b3d57c36c project: fix global var loading (#4298) 2024-02-27 20:42:23 +08:00
billow 3eb9527bcd rl78: add DWARF register profile (#4276) 2024-02-20 22:34:40 +08:00
billow f89e875d8f v850: add local variables detection (#4271)
* v850: fix local variable detect
* v850: add local variable test
* v850: fix stack inc
2024-02-20 00:08:03 +08:00
billow cd92cce3cb rz_analysis_function_set_var: Fix incorrectly adding the same variable 2024-02-17 11:05:16 +08:00
billow 8026d94b56 rzil: add analysis and evaluation integration test (#4241)
* Try to refactor rz_core_analysis_bytes_il
* Add the RzIterator
* Refactor rz_core_analysis_op_bytes with RzIterator
* Refactor rz_core_analysis_bytes with RzIterator
* Add test_analysis_il
* Fix AnalysisBytesContext_next
* Fix heap-buffer-overflow and UBSan
* Fix use-after-free
2024-02-16 21:10:44 +08:00
billow 5d434c47a4 Add V850 32bit register profile (#4229) 2024-02-15 01:46:28 +08:00
billow dce6ac8b6b DWARF: loading DWARF in .dSYM (#4219) 2024-02-13 14:36:13 +08:00
billow 77d758da7d v850: Add some undocumented instructions (#4187)
* v850: fix `decode_formatIX` and `lift_bit`
* v850: fix `ldbu` decode
* v850: fix JR JARL format V target
* v850: fix LDBU format VII target
* v850: add float instructions
* v850: fix `fmt_list` and add `v850_decode_formatUnk_float`
2024-02-08 23:10:31 +08:00
billow ddad724740 DWARF: rz-bin -dd download DWARF from debuginfod server (#4194) 2024-02-08 18:12:40 +08:00
billow c025dcee40 DWARF: Fix ANSI Escape Sequence Injection vulns via DWARF (#4190)
* DWARF: Fix ANSI Escape Sequence Injection vulns via DWARF
* DWARF: Reduce one memory copy in rz_bin_dwarf_attr_string
* DWARF: move Doxygen of `rz_bin_dwarf_attr_string` from the header to the implementation
2024-02-07 20:09:55 +08:00
billow 6eeb9e4f83 V850: Improve RH850 support, add RzIL uplifting (#4103)
V850: Add RzIL support

V850: fix fallthrough

V850: Add docs

V850: fix v850 prelude

V850: add `loop`

V850: add docs to register profile

V850: add `syscall`

V850: add `sx[bh]` `zx[bh]`

V850: add `snooze` `sync?` `switch`

V850: add `sbf` `sch[01][lr]`

V850: fix `rotl`

V850: add `rie` `rotl`

V850: add `pushsp` `popsp`

V850: add `mac` `macu`

V850: add `ldl.w` `stc.w`

V850: add `hsh` `hsw`

V850: add `feret` `eiret`

V850: add `fetrap`

V850: add `cll` `ctret` `cmov`

V850: add caxi

V850: add callt

V850: add bsw

V850: add bsh

V850: fix bins

V850: add bins

V850: fix add and add adf

V850: format

V850: fix stack-buffer-overflow

V850: add emulateme test

V850: fix dispose and prepare

V850: fix all

V850: fix mulh and cmp satadd add shl shr sar

V850: mov

V850: fix sld.*

V850: fix runtime error left shift

V850: fix test

V850: fix jarl and refactor

V850: fix ld st

V850: fix inst.format

V850: fix rzil ld.*

V850: fix rzil dispose and prepare

V850: fix rzil and register profile

V850: fix disas memleak

V850: fix ld

V850: fix jump target
2024-02-03 06:28:12 +08:00
billow 481777220f Analysis: sort function by address while printing (#4179)
* analysis: sort function by addr when print (afl, aflm, afl=)
2024-02-02 23:50:34 +08:00
billow 809961fb59 TriCore: fix negative array index access (#4171) 2024-02-01 16:44:43 +08:00
billow 2da68927c7 canalysis: fix stack overflow in process_reference_noreturn_cb 2024-02-01 07:11:22 +00:00
billow 9e968544e3 DWARF: fix loclists dump (#4152) 2024-01-25 21:53:23 +08:00
billow d29e7ef529 v850: Add RzAsm and RzAnalysis support for rh850 (#4151) 2024-01-25 21:53:07 +08:00
billow b32e00f018 DWARF: fix CU attributes parsing and application (#4148) 2024-01-24 23:25:00 +08:00
billow 9a468f8975 Remove the one static var in RzAsm tricore (#4137) 2024-01-22 15:36:27 +08:00
billow 88f6c787cb Add cache for source line (#4129)
* Fix DWARF source line file path

* Add cache for source line

* Fix cache for source line

* Optimization

* revert formatting
2024-01-20 15:48:19 +08:00
billow df93e2c003 tricore fixes coverity (#4116) 2024-01-17 15:16:39 +08:00
billow 5b36c7c6e0 Patch for windows debugger to load libraries (#4113) 2024-01-16 13:55:10 +08:00
billow fc6e9019f2 Fix tricore RzIL ADDSC.A (#4112) 2024-01-16 07:07:39 +08:00
billow 02634787e9 v810: RzIL support (#4096)
* RzIL v810 support
* Fix v810 asm tests
* Fix analysis/v810
* v810: move ESIL formation into a separate function
* bin/elf: autodetect v810 architecture
2024-01-14 10:45:48 +08:00
billow 524fe19222 Build tricore_il only when cs =next or >v4 (#4102) 2024-01-13 23:02:33 +08:00
billow ce88bbed49 RzIL TriCore Support (#3478)
* RzIL TriCore Support
2024-01-13 13:59:55 +08:00
billow acace32cad Fix windows debug plugin (#4099) 2024-01-13 08:16:38 +08:00
billow 7da17b80e2 Add RzIL API SEXTRACT32 and NE (#4093) 2024-01-10 23:54:15 +08:00
billow a592ea1e8c Remove static and global variables in TriCore RzAsm and RzAnalysis plugin (#4092) 2024-01-10 23:44:12 +08:00
billow 770084ca98 tricore: fix rfm, ldlcx, lducx stack op set (#4035)
* Fix TriCore's `rfm` stack op set
* Fix TriCore's `ldlcx` `lducx` set
2023-12-18 01:11:44 +08:00
billow d5d29fcb37 Load symbols in modules from PDB (#4025)
* PDB: add module info parsing
* Refactor PDB component
* Refactor PDB/tpi
* Fix read_pascal_string
* Fix memory leaks
* Add test `Modules from PDB`
2023-12-10 14:14:14 +08:00
billow 81b6a3850f Fix rz_pvector_foreach (#4026) 2023-12-09 00:37:14 +08:00
billow bfe19a784b Create global variables from PDB (#4021) 2023-12-06 13:57:41 +08:00
billow 8b8d5c7769 Fix stack location in composite 2023-11-29 10:29:01 +08:00
billow 7842557ac0 Fix rz_base_type_clone_into 2023-11-29 10:29:01 +08:00
billow f5c14cdd9c RzVector add item_cpy support to rz_vector_clone_intof and rz_vector_clonef 2023-11-29 10:29:01 +08:00
billow 947e9b574e Create global variable from DWARF (#3985)
* Create global variable from DWARF
* Update test
* Add test "Static variables inside function"
* Clean typedb when apply_dwarf
2023-11-19 22:58:50 +08:00
billow 444000416c Add debuginfod support (#3954)
* Add DEBUGINFOD_URLS support
* Add rz_bin_dwarf_from_debuginfod
* Fix rz_bin_dwarf_attr_addr
* Add test for debuginfod
* Filter empty RzBinDWARF
2023-11-06 23:41:42 +08:00
billow 9cd67098da Update db/archos/linux-x64/dbg_dmh dmh allocated (#3956)
* Update `db/archos/linux-x64/dbg_dmh dmh allocated`
* Fix `scr.color` in rz_heap_glibc.h
2023-11-05 17:03:26 +08:00
billow ec112e2178 Fix #3952 (#3953)
* Check flagname and Fix `filter`

* Update test
2023-11-04 09:56:23 +08:00
billow 753f9c2367 Stop purge typedb when rz_type_db_reload (#3949) 2023-11-03 14:12:23 +08:00
billow fde03584a0 afvl command improvements (#3945)
- in SHORT mode only print `@ COMPOSITE` or `@ LOCLIST` and omit the details
- in LONG and TABLE mode `[(0x8010fb1c, 0x8010fb3f): a4,	(0x8010fb42, 0x8010fb48): a13,	(0x8010fb48, 0x8010fb5e): a4,	(0x8010fb5e, 0x8010fb64): a13,	(0x8010fb64, 0x8010fb6d): a4]`
  => `[(0x8010fb1c, 23): a4,	(0x8010fb42, 6): a13,	(0x8010fb48, 16): a4,	(0x8010fb5e, 6): a13,	(0x8010fb64, 9): a4]`
2023-11-01 00:00:29 +08:00
billow 450cc81ae5 Move afv to afvl, add more modes (#3941)
* Add detail to `afv`
* Move `afv` to `afvl`
* Add TABLE mode to` afvlt`
* Add SHORT mode to `afvl`
* Add LONG mode for `afvll`
* Add test for `afvlt`
2023-10-29 14:07:12 +08:00
billow 7982454d4c Load split DWARF (#3833)
- Add `read_debuglink` and `read_build_id`
- Fix `*.dwo` loading
- Try process DW_UT_skeleton
- Fix dwo_id
- Check buffer size
- Add `bin.dbginfo.debug_file_directory`
- Add test "Debugging Information in Separate Files"
2023-10-21 18:51:15 +08:00
billow cfb1679b21 Fix typedb reload (#3931)
* Fix typedb reload
* Fix `rz_analysis_set_cpu`
* Add test
2023-10-19 18:46:10 +08:00
billow 77778e9311 dwarf: fix heap overflow (#3930) 2023-10-19 00:25:46 +08:00
billow a974cbc864 fix: DWARF memleaks (#3923) 2023-10-14 08:43:58 +08:00
billow 19c889f690 DWARF loading '.debug_str_offsets', '.debug_line_str' and relocate (#3848)
* Try Load '.debug_str_offsets'
* DWARF unify names
* Add endian_reader.c to process relocate
* Remove RzBinDwarfLineInfoMask RzBinDWARFFlags and RzBinDWARFOption
* Fix debug_line
* Add .debug_line_str
* RzBinReloc: Add section_vaddr
* Fix info->offset_comp_dir
* Fix convert_raw in loclists and rnglists
* Remove macro `UX_OR` and relocate support for read_address
* Add RzBinDwarfLineHdr->encoding
* Remove macro 'OK_None'
* Fix loclists and rnglists
* Allow void typedef
* Fix DW_AT_name reference DW_AT_specification
2023-09-28 10:15:42 +08:00
billow 71e6f5d450 Fix DWARF FbReg Operation eval and fuzz test (#3825)
* Fix FbReg Operation eval

* Fix RzBinDwarfEvaluationResult_to_loc and debug_line directories parse
2023-09-03 17:30:02 +08:00
billow ce298395a4 Support for compressed DWARF .zdebug_* sections (#3819)
* Support for .zdebug_*

* Simplify macro.inc

* Fix ranges and loc, because it was using the wrong bigendian.

* - DW_TAG_ptr_to_member_type as Ptr type
- DW_TAG_unspecified_type as base type

* Fix union in struct
2023-09-02 15:05:18 +08:00
billow 6886b2cd45 Fix DWARF resource leaks (#3810)
* Fix 'CID 416733 Resource leak'
* Fix 'CID 416728 Unintended sign extension'
* Fix 'CID 416723 Unchecked return value'
* Fix 'CID 416721 Resource leak'
* Fix 'CID 416718 Explicit null dereferenced'
* Fix 'CID 416717 Resource leak'

* Fix multiple Resource leaks

- Fix 'CID 416716 Resource leak'
- Fix 'CID 416712 Resource leak'
- Fix 'CID 416677 Resource leak'
- Fix 'CID 416668 Resource leak'
- Fix 'CID 416667 Resource leak'
- Fix 'CID 416666 Resource leak'
- Fix 'CID 416661 Resource leak'
- Fix 'CID 416670 'Constant' variable guards dead code'
2023-08-30 20:08:11 +08:00
billow c936299fcc Coverity fixes - DWARF (#3807)
* Fix 'CID 416720:  Memory - corruptions  (USE_AFTER_FREE)'

* Fix 'CID 416725:  Memory - corruptions  (OVERLAPPING_COPY)'

* Fix 'CID 416730:  Memory - illegal accesses  (USE_AFTER_FREE)'

* Fix 'CID 416731 Resource leak'
2023-08-30 10:10:33 +08:00
billow 5999d3e824 DWARF support for load zlib and zstd compressed section (#3795) 2023-08-29 07:23:48 +08:00
billow 0c1690a7fb Fix docker build (#3792)
Fix "non-trivial designated initializers"
Fix "invalid conversion"
2023-08-26 16:25:36 +08:00
billow 8e29b959b8 DWARF improve DWARF5 support and refactor
- `RZ_PROJECT_VERSION` 14
- Add `RzCallable`.has_unspecified_parameters
- Add `RzAnalysis`.debug_info
- Add `RzAnalysisVarStorageType` composite and `eval` `pending`
- Support for parse DWARF section "debug_loclists", "debug_ranges", "debug_rnglists"
- Partial support for eval DWARF expr_loc
- Support for anonymous Type, function variable, struct member
- Cache all DWARF information in `RzAnalysisDebugInfo` and remove `SDB` based caching.
- Add arm32, arm64, TriCore DWARF register name
- Fix same name basetype
2023-08-25 23:32:05 +08:00