Commit graph

24 commits

Author SHA1 Message Date
Florian Märkl
76e776907e
[RzIL] Add remaining comparison aliases and tests (#2295) 2022-02-08 17:29:35 +01:00
Florian Märkl
e2edd9d1ef
Fix many pointer/int conversion warnings on arm32 (#2246)
This is -Wint-to-pointer-cast and -Wpointer-to-int-cast of gcc 10 on
arm32
2022-01-25 11:41:17 +01:00
Florian Märkl
efa41b86d7 [RzIL] Refine events and add tests
* Removed nullability where not needed
* Made events take RzILVal instead of force-converting to RzILBitVector
  for variables
* Added more fine-grained tests for events from specific ops
2022-01-22 18:40:10 +01:00
Florian Märkl
a1e7306e2f [RzIL] Fix fill bit in shiftl/shiftr 2022-01-22 09:40:20 +08:00
Florian Märkl
111cd2c476 [RzIL] Make jumptargets independent of opsize
Previously, after a (jmp x) with opsize y, the jump target would
actually be x + y because the addition happened after the evaluation.
Now we actually jump to the target specified by the op.
2022-01-13 21:35:25 +01:00
Florian Märkl
54318a2268
[RzIL] Rework Variable Handling (#2174)
There are now three kinds of vars: global, local and local pure. Global
and local pure are exactly like in BAP, local ones are defined by their
initial set op and have the scope of a single lifted instruction.

The set op now handles both global and local vars, let is now pure and
binds only inside its body. Vars have static types, global and local are
always mutable, local pure naturally immutable.

The var op specifies the kind of variable to take from, and the
individual variable sets are separate. This corresponds to BAP's
behavior where the kind of variable is part of the identifier.

Variable content storage has also been rewritten and RzILBag removed.
2022-01-05 11:16:47 +00:00
Florian Märkl
5ddb19c692 [RzIL] Clarify what append actually does
high/low is more descriptive than x/y. Test has also been added.
2022-01-03 17:18:33 +01:00
Dhruv Maroo
386008482f
[RzIL] Implement effects: BLK and REPEAT (#2119) 2022-01-03 12:41:52 +00:00
Florian Märkl
c34ae1a7b5
Rename RZIL occurences to RZ_IL 2022-01-03 10:20:11 +01:00
Florian Märkl
7a8d5af180 [RzIL] Add rz_il_op_new_(unsigned|signed)() 2021-12-30 10:21:45 +01:00
Florian Märkl
5d93ca3330
[RzIL] Flatten out all RzILOpArgs* structs (#2151)
This reduces heap usage and indirection.
2021-12-28 20:47:10 +00:00
Florian Märkl
aa80d2870f
[RzIL] Make cast work as in BAP (#2152) 2021-12-28 21:22:30 +01:00
Florian Märkl
78025648ea
[RzIL] Make RzILOp statically typed (#2140) 2021-12-27 00:13:24 +08:00
Giovanni
5963da2bba
[RzIL] Add loadw/storew and bind memories against RzBuffer (#2105)
* [RzIL] Load/Store via RzIO and RzBuffer
* [RzIL] LoadW/StorWe via RzIO and RzBuffer
Co-authored-by: Florian Märkl <info@florianmaerkl.de>
2021-12-24 16:53:20 +01:00
Florian Märkl
544905631c
[RzIL] Fix concept of Effects and Effect ops (#2109)
This brings our concept of effects in line with BAP and fixes issues
like values being evaluated prematurely in seq. The main point is that
ops themselves are the effects, rather than returning them to be
evaluated later.
2021-12-20 14:21:40 +00:00
wargio
8c2cb05af8 [RzIL] Add let, rewrite using RzPVector and various bugfixes 2021-12-14 12:34:55 +01:00
wargio
d288a24726 [RzIL] Refactor definitions and VM 2021-12-14 12:34:55 +01:00
Giovanni
c1c1fe05ec
[RzIL] refactored rz_il_op to expand new methods to rz_il_op_new_* (#2092) 2021-12-11 17:27:13 +08:00
Dhruv Maroo
648c267bc7
Rename and refactor to use RzBitVector instead of RzILBitVector (#2048) 2021-12-01 14:28:04 +05:30
wargio
5f7d85de8e Avoid heap for < 65 bits and simplified rz_il_bv_new_from_* methods 2021-11-15 14:56:15 +01:00
Giovanni
0d8d08951e
[RzIL] fix jmp & added bitvector type due limitation of int type (#1924)
Adds RZIL_OP_BITV and removes RZIL_OP_INT due host limitation
Fixed type RZIL_OP_JMP to work and apply effect.
Implemented rz_il_bv_new_from_st32 rz_il_bv_new_from_st64
2021-11-02 17:36:47 +01:00
Giovanni
4ca140a97b
[RzIL] implemented ao statement output (#1901)
* RzIL implemented il string and json representation
* Added json representation
* Fixed some memleaks on rz_il_free_op
* Implemented rz_il_op_stringify and rz_il_op_json
* RzIL Fixed memory leaks
2021-10-30 11:41:30 +08:00
Riccardo Schirone
75fc447873
Fix some memleaks in unit tests (#1869)
* Cleanup RzAnalysisRzil when freeing RzAnalysis

* Fix str leaking in rz_core_write_string_at

* Fix buf leaking in rz_core_yank_paste

* Fix memleak in json unit tests

* Fix features leaking in RzBinInfo

* Fix features leaking in RzAsm

* Fix memleaks in RzTable

* Fix test_str_search memleaks

* Fix memleak in test_io.c

* Fix memleaks in RzBuf and test_buf.c

* Fix memleaks in test_cmd.c

* Fix memleaks in test_config.c

* Fix memleaks in RzCons

* Fix hashes leaking in test_bin.c

* Fix memleaks in test_id_storage.c

* Fix memleaks in test_il*.c and adjust APIs
2021-10-22 09:33:20 +08:00
Heersin
e0d3d6bc66
New RZIL integration (#1663)
The new intermediate language is based on the BAP (Binary Analysis Platform) Core Theory.
It operates on SMT-like bitvectors and their arrays to represent values and memory.
Apart from that, it has also representation for the data and code side effects.
2021-10-09 18:14:44 +08:00