Commit Graph

41 Commits

Author SHA1 Message Date
Giacomo Vercesi 40da49548b Add Binaries list to the model
Add to the model an entry detailing the list of input binaries under
`Binaries`. This will be referenced by `Segments` when needed.
2025-10-16 17:48:45 +02:00
Ivan Krysak ecb9d76c64 Model: drop obsolete default value handling 2025-10-13 18:33:10 +03:00
Ivan Krysak 6c0c758e67 Model: make TTG verification more strict
Some stuff that was before implicitly checked during deserialization
now need explicit checks, those are introduced here.

This also fixes test failures related to the changed serialization
format (which fields can or cannot be omitted when they have
the default value).
2025-10-13 18:33:10 +03:00
Ivan Krysak 89282f31da Minor improvements 2025-10-13 18:33:10 +03:00
Lauri Vasama 653d451e6c Remove undef name configuration support
Also adds a model migration removing
Configuration.Naming.UndefinedValuePrefix.
2025-09-29 18:05:55 +03:00
Giacomo Vercesi 18509a4ca0 Add missing string to VH.fail
Add missing string to invocations of `VH.fail` that do not depend on a
child's `verify` method.
2025-09-09 12:27:33 +02:00
Ivan Krysak e6d8ac2c87 Model: improve RFT verification output 2025-07-23 11:38:53 +02:00
Ivan Krysak 554ffa376a model::Function: introduce GotoLabels field 2025-07-23 11:38:51 +02:00
Ivan Krysak 1ebeb8f493 model::Function: introduce LocalVariables field 2025-07-23 11:38:50 +02:00
Ivan Krysak 4e3c6cccd0 Model: introduce LocalIdentifier struct 2025-07-23 11:38:50 +02:00
Ivan Krysak d7c089799c StatementComment: separate location verification 2025-07-23 11:38:50 +02:00
Ivan Krysak b982ae68d0 NamingConfiguration: add UnnamedGotoLabelPrefix 2025-07-23 11:38:50 +02:00
Pietro Fezzardi b441fc9916 CABIFunctionDefinition: no pointer-to-array return
This commit bans from the model pointer-to-array return types in
CABIFunctionDefinition.
CABIFunctionDefinition implies we're decompiling towards C, and C does
not support such return types, because it doesn't have valid syntax to
express them without using typedefs.
2025-05-28 17:11:11 +02:00
Pietro Fezzardi 0426c773b2 CABIFunctionDefinition: drop array argument/return
This commit bans from the model array types in as argument or return
types in CABIFunctionDefinition.
CABIFunctionDefinition implies we're decompiling towards C, and C does
not support array arguments (passed by copy) nor array return types.

Banning these from the model reduces the number of situations where we
have to emit artificial array wrappers (not present in the model) around
types when printing C code, simplifying the handling of such situations
when translating to clift and in general in the decompilation pipeline.
2025-05-28 17:11:11 +02:00
Ivan Krysak 0d868894a2 model::Function: switch to indices as comment keys 2025-05-08 15:42:00 +02:00
Khaled Ismaeel 030becfeba Adapt the build to the new schema version field
This is a followup to the commit where we introduced the `version`
field in the schema YAML.
2025-04-30 15:08:45 +02:00
Ivan Krysak 1622bb91a1 Introduce automatic names for dynamic functions 2025-04-24 13:22:14 +02:00
Ivan Krysak 79964eac74 Avoid ' misuse in error messages and comments 2025-04-17 16:41:21 +02:00
Ivan Krysak 57b5eb7f98 NameBuilder: allow different name checkers 2025-04-17 11:19:17 +03:00
Ivan Krysak dce5c1a02c NamingConfiguration: pull more prefixes inside
Unify additional values that used to be hardcoded in the old backend
under the same naming configuration root.
2025-04-17 11:19:17 +03:00
Ivan Krysak f070f1f1e1 Model: sunset double name system 2025-04-17 11:19:17 +03:00
Ivan Krysak 645cf7fc2e NameBuilder: sunset deduplication
This reworks NameBuilder to ease the transition to the system where
the model will be guaranteed to never contain any name collisions, both
between user-specified names and the automatic ones.
2025-04-15 16:35:42 +03:00
Ivan Krysak 6ea75f02b3 Model: switch to the new namespace verifier 2025-04-15 16:35:42 +03:00
Ivan Krysak 08bd4ecca8 Model: introduce statement comment verification 2025-02-13 13:09:50 +02:00
Ivan Krysak 6c43cebc90 Model: let VerifyHelper depend on NameBuilder 2025-02-13 13:09:50 +02:00
Ivan Krysak 288448f009 Never include model::VerifyHelper from headers 2025-02-13 13:09:50 +02:00
Alessandro Di Federico 37feb2dd77 Binary::verify: verify executable addresses
Fail if code addresses are not within an executable segment.
2024-11-28 14:04:36 +01:00
Ivan Krysak 672ee5df50 Replace std::string_view with llvm::StringRef 2024-11-06 15:43:13 +02:00
Ivan Krysak 2a5d50630b Model: adopt name builder in verification 2024-11-06 15:43:13 +02:00
Ivan Krysak 0a3628e6fe Model: introduce naming configuration 2024-11-06 15:42:44 +02:00
Ivan Krysak 8c313a73af Model: make sure segments use generic addresses 2024-10-08 13:53:52 +02:00
Alessandro Di Federico 2cdedc71f4 s/serialize/toString/
We keep serialize for method dealing with streams.
If it returns a `std::string`, let's use `toString`.
2024-09-27 12:07:17 +02:00
Alessandro Di Federico d3b945c6c2 PECOFFImporter: use Generic Segment::StartAddress 2024-08-05 18:00:27 +02:00
Ivan Krysak 4a2db0ba4f UpcastablePointer: streamline empty behavior 2024-06-27 11:05:52 +02:00
Ivan Krysak 2ae19ef30a DynamicFunction: ban / in the name 2024-06-27 11:05:51 +02:00
Ivan Krysak 776a5cdc52 Model: move path data away from the header 2024-06-27 11:05:51 +02:00
Ivan Krysak dfa7478685 Adopt reworked model::Type 2024-06-27 11:05:51 +02:00
Ivan Krysak 925690a1e1 VerifyHelper: reduce pointer usage 2024-06-27 11:05:50 +02:00
Ivan Krysak b33eb7cf70 Model: reduce pointer usage in verify 2024-06-27 11:05:50 +02:00
Ivan Krysak e8288d1e70 Model: reorganize verifier order
This helps keeping track of them and making sure none of them is lost.

The order is bottom-to-top, so ends with `model::Binary::verify` and
contains verification of all of its dependencies in the order they
appear in their user's `verify`s, kind of like a flattened tree.
2024-06-27 11:05:49 +02:00
Ivan Krysak 277cba213c Model: separate verification 2024-06-27 11:05:49 +02:00