mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 15:49:46 -08:00
@@ -30,6 +30,7 @@ See the License for the specific language governing permissions and limitations
|
||||
"""
|
||||
import logging
|
||||
import binascii
|
||||
from pathlib import Path
|
||||
|
||||
import ida_nalt
|
||||
import ida_funcs
|
||||
@@ -68,7 +69,7 @@ def main():
|
||||
if not path:
|
||||
return 0
|
||||
|
||||
result_doc = capa.render.result_document.ResultDocument.parse_file(path)
|
||||
result_doc = capa.render.result_document.ResultDocument.from_file(Path(path))
|
||||
meta, capabilities = result_doc.to_capa()
|
||||
|
||||
# in IDA 7.4, the MD5 hash may be truncated, for example:
|
||||
|
||||
@@ -31,6 +31,7 @@ Example:
|
||||
import sys
|
||||
import logging
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
import capa.render.proto
|
||||
import capa.render.result_document
|
||||
@@ -64,7 +65,7 @@ def main(argv=None):
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
|
||||
rd = capa.render.result_document.ResultDocument.parse_file(args.json)
|
||||
rd = capa.render.result_document.ResultDocument.from_file(Path(args.json))
|
||||
pb = capa.render.proto.doc_to_pb2(rd)
|
||||
|
||||
sys.stdout.buffer.write(pb.SerializeToString(deterministic=True))
|
||||
|
||||
Reference in New Issue
Block a user