MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / is_valid_for_data

Method is_valid_for_data

python/examples/nsf.py:45–55  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

43
44 @staticmethod
45 def is_valid_for_data(data):
46 hdr = data.read(0, 128)
47 if len(hdr) < 128:
48 return False
49 if hdr[0:5] != "NESM\x1a":
50 return False
51 song_count = struct.unpack("B", hdr[6])[0]
52 if song_count < 1:
53 log_info("Appears to be an NSF, but no songs.")
54 return False
55 return True
56
57 def init(self):
58 try:

Callers

nothing calls this directly

Calls 2

log_infoFunction · 0.90
readMethod · 0.45

Tested by

no test coverage detected