Commit graph

15 commits

Author SHA1 Message Date
Fish
7c2e3501e6
SimStruct: Remove _arch_memo to fix the cache leak. (#6757)
* SimStruct: Remove _arch_memo to fix the cache leak.

* Fix the comment

* Better typing.

* Fix RustSimTypes.

* More fixes.

* Fix caching for anonymous structs.

* SimUnion: Cache alignment.

* Convert returnty to a arch-ed returnty.

* RustSimType: Do not shadow SimType.with_arch.

* Rust: Bind an arch to types before they reach the type solver.

* RustSimType: Make it a subclass of SimType.
2026-08-05 01:12:55 -07:00
Kevin Phoenix
f939c5b88c
Enable ruff isort rule (#6452)
* Enable ruff isort rule

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-06-02 14:48:07 -07:00
Fish
4e16bcd876
SimStruct.__eq__: Fix recursion error in rare cases. (#6410) 2026-05-19 09:47:55 -07:00
Fish
f02783db38
Function: Record prototype source. (#6325)
* Function: Record prototype source.

Fix the issue in decompiler where the callee's prototype cannot be
updated to the more accurate version (e.g., the prototype coming from
decompiling the function) than the one that's generated at call sites.

* Delay import.

* Update some test cases.

* Preserve function return type if the original prototype wasn't guessed.

* Fix another test case.

* Tweak

* Type check.
2026-04-07 01:29:27 -07:00
Fish
06e3f969ad
Remove TypeLifter (TypeTranslator supersedes it). (#6173)
* Remove TypeLifter (TypeTranslator supersedes it).

* Add a test case for lifting recursive structs.

* Reuse VRA's type translator in Typehoon.

* Fix struct name assignment.
2026-02-23 15:47:56 -07:00
Fish
5ee75140ff
Dev: Switch from black to ruff format. (#6097)
* Dev: Switch from black to ruff format.

* Reformat all the files.
2026-02-05 14:29:21 -07:00
Ati Priya
bfae5313ab
Decompiler: Show (void) for functions without arguments (#6037)
* show void if no arg

* fix test cases

* add option

* type check
2026-01-22 08:00:06 -07:00
Fish
7169b5aae9
Update Windows type library for Enums. (#6034)
* Update Windows type library for Enums.

* Fix test cases; Fix PWSTR definition; Fix to_json for nested structs.

* Fix an infinite recursion.

* Type check and lint code.

* Update a test case.

* Add array support to VariableManager.stack_offset_to_complex_types.

* Remove special handling for char* and wchar_t* in VRA. Fix bugs in SimpleSolver.

* InlinedMemset: Fix the prototype of memset.

* VRA: Do not record variables.

* Type check.

* Ughhhhhhh

* Lint code.
2026-01-21 20:02:01 +00:00
Fish
e64f191807
Decompiler: Type inference for enums (#6033)
* Type lifting support for enums.

* Add some test cases.

* Enable type inference for Enum constants.

* Use contextlib.suppress.

* Remove special case typing logic for NULLs; Update a test case.

* Fix test cases.

* Make AILExprIdAnnotation eliminatable so that it does not hinder expression simplifications.

* CondProc: Invoke claripy.simplify() before calling claripy.is_true() to remove eliminatable annotations.

* Fix a test case.

* Lint and type check.

* Fix a test case.

* VRA: Fix the bug that stack struct variable typevar gets incorrectly associated with the first member of the struct.

* Use equivalence instead of subtyping between a const typevar and another
typevar; Fix the test case.

* SimpleSolver: Fix missing solutions for typevars because of _equivalence.

* CCodeGen._access: Support dereferencing plain integers. Fix a test case.
2026-01-21 09:07:24 -05:00
pre-commit-ci[bot]
563fb5f862
[pre-commit.ci] pre-commit autoupdate (#6025)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.14.11 → v0.14.13](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.11...v0.14.13)
- [github.com/psf/black-pre-commit-mirror: 25.12.0 → 26.1.0](https://github.com/psf/black-pre-commit-mirror/compare/25.12.0...26.1.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-19 13:37:06 -07:00
Dustin Fraze
773dd85c2c
Add SimTypeEnum for enum type representation and enhance prototype handling (#5988)
* Add SimTypeEnum for enum type representation and enhance prototype handling

* Add SimTypeBitfield support and integration tests for enum types

* Remove unused variable assignment in enum decompiler integration tests

* Lint and type check test_enum_integration.py.

* Minor fixes.

Co-authored-by: Fish <fishw@asu.edu>
2026-01-08 00:17:47 -07:00
Ati Priya
377b4c6a2c
Parse qualifiers from pycparser and add them to SimType for getting correct function prototype for glibc decls (#5946)
* keep const in declarations

* parse qualifiers from pycparser and add them to SimType objects for getting correct function prototype

* fix test 9

* fix test

* do not deepcopy

* regenerate glibc.json w/o deepcopy

* always return

* change qualifiers to q

* don't modify shared type

* add test case

* regenerate glibc.json

* update q to qualifier
2026-01-06 12:16:45 -07:00
Fish
4675fb00da
SimType.to_json: Fix recursive error when serializing recursive types. (#5818) 2025-11-19 23:10:12 -07:00
Fish
f2b8686ac4
Types: Add utility functions to convert types to typerefs. (#5817) 2025-11-19 22:15:47 -07:00
Fish
9b3788dfb1
Fix store and extract for SimTypeWideChar. (#5522)
* Fix store and extract for SimTypeWideChar.

* Type check test_types.py.
2025-06-11 22:29:52 -07:00