@@ -55,6 +55,7 @@ class SmdaReport(object):
55
55
timestamp = None
56
56
version = None
57
57
xcfg = None
58
+ xheader = None
58
59
59
60
# on first usage, initialize codexrefs objects for all functions based on inrefs/outrefs (requires knowledge about all functions)
60
61
_has_codexrefs = False
@@ -95,6 +96,7 @@ def __init__(self, disassembly=None, config=None, buffer=None):
95
96
self .timestamp = datetime .datetime .now (datetime .timezone .utc )
96
97
self .version = disassembly .binary_info .version
97
98
self .xcfg = self ._convertCfg (disassembly , config = config )
99
+ self .xheader = disassembly .binary_info .getHeaderBytes ()
98
100
99
101
def _convertCfg (self , disassembly , config = None ):
100
102
function_results = {}
@@ -257,6 +259,7 @@ def fromDict(cls, report_dict) -> Optional["SmdaReport"]:
257
259
binary_info .binary_size = smda_report .binary_size
258
260
binary_info .oep = smda_report .oep
259
261
smda_report .xcfg = {int (function_addr ): SmdaFunction .fromDict (function_dict , binary_info = binary_info , version = smda_report .smda_version , smda_report = smda_report ) for function_addr , function_dict in report_dict ["xcfg" ].items ()}
262
+ smda_report .xheader = bytes .fromhex (report_dict ["xheader" ]) if "xheader" in report_dict else None
260
263
return smda_report
261
264
262
265
def toDict (self ) -> dict :
@@ -289,7 +292,8 @@ def toDict(self) -> dict:
289
292
"statistics" : self .statistics .toDict (),
290
293
"status" : self .status ,
291
294
"timestamp" : self .timestamp .strftime ("%Y-%m-%dT%H-%M-%S" ),
292
- "xcfg" : {function_addr : smda_function .toDict () for function_addr , smda_function in self .xcfg .items ()}
295
+ "xcfg" : {function_addr : smda_function .toDict () for function_addr , smda_function in self .xcfg .items ()},
296
+ "xheader" : self .xheader .hex (),
293
297
}
294
298
295
299
@classmethod
0 commit comments