mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 15:49:46 -08:00
render: handle dn tokens
This commit is contained in:
@@ -24,6 +24,8 @@ See the License for the specific language governing permissions and limitations
|
||||
"""
|
||||
import tabulate
|
||||
|
||||
import dnfile.mdtable
|
||||
|
||||
import capa.rules
|
||||
import capa.render.utils as rutils
|
||||
import capa.render.result_document
|
||||
@@ -50,7 +52,9 @@ def format_address(address: Address) -> str:
|
||||
elif isinstance(address, DNTokenAddress):
|
||||
return str(address)
|
||||
elif isinstance(address, DNTokenOffsetAddress):
|
||||
return f"{str(address.token)}+{rutils.hex(int(address.offset))}"
|
||||
name = dnfile.mdtable.ClrMetaDataTableFactory._table_number_map[address.token.table].name
|
||||
rid = address.token.rid
|
||||
return f"{name}[{rid}]+{rutils.hex(int(address.offset))}"
|
||||
elif address == NO_ADDRESS:
|
||||
return "global"
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user