diff --git a/CHANGELOG.md b/CHANGELOG.md index cd49da66c..e32613272 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ - loader: skip PE files with unrealistically large section virtual sizes to prevent resource exhaustion @devs6186 #1989 - engine/render: fix unbounded range sentinel precedence so `count(...): N or more` uses explicit `((1 << 64) - 1)` @blenbot #2936 - cache: support *BSD @williballenthin @res2500 #2949 +- freeze: support float `operand number` values in feature freeze conversion @blenbot #2958 ### capa Explorer Web - webui: fix 404 for "View rule in capa-rules" by using encodeURIComponent for rule name in URL @devs6186 #2482 diff --git a/capa/features/freeze/features.py b/capa/features/freeze/features.py index 151964e55..51d0a31aa 100644 --- a/capa/features/freeze/features.py +++ b/capa/features/freeze/features.py @@ -201,7 +201,7 @@ def feature_from_capa(f: capa.features.common.Feature) -> "Feature": return MnemonicFeature(mnemonic=f.value, description=f.description) elif isinstance(f, capa.features.insn.OperandNumber): - assert isinstance(f.value, int) + assert isinstance(f.value, (int, float)) return OperandNumberFeature(index=f.index, operand_number=f.value, description=f.description) # type: ignore # Mypy is unable to recognise `operand_number` as an argument due to alias @@ -343,7 +343,7 @@ class MnemonicFeature(FeatureModel): class OperandNumberFeature(FeatureModel): type: Literal["operand number"] = "operand number" index: int - operand_number: int = Field(alias="operand number") + operand_number: Union[int, float] = Field(alias="operand number") description: Optional[str] = None