mirror of
https://github.com/mandiant/capa.git
synced 2025-12-05 20:40:05 -08:00
sequence: better collect sequence-related addresses from Range statements
This commit is contained in:
committed by
Willi Ballenthin
parent
f55086c212
commit
e6bdcff5d9
@@ -328,6 +328,13 @@ def collect_sequence_locations(
|
|||||||
child_mode = MODE_FAILURE if mode == MODE_SUCCESS else MODE_SUCCESS
|
child_mode = MODE_FAILURE if mode == MODE_SUCCESS else MODE_SUCCESS
|
||||||
for child in match.children:
|
for child in match.children:
|
||||||
yield from collect_sequence_locations(child, child_mode)
|
yield from collect_sequence_locations(child, child_mode)
|
||||||
|
elif isinstance(match.node.statement, rd.RangeStatement):
|
||||||
|
for location in match.locations:
|
||||||
|
if location.type not in (frz.AddressType.CALL, ):
|
||||||
|
continue
|
||||||
|
if mode == MODE_FAILURE:
|
||||||
|
continue
|
||||||
|
yield location
|
||||||
else:
|
else:
|
||||||
for child in match.children:
|
for child in match.children:
|
||||||
yield from collect_sequence_locations(child, mode)
|
yield from collect_sequence_locations(child, mode)
|
||||||
|
|||||||
Reference in New Issue
Block a user