MCPcopy Create free account
hub / github.com/CheckPointSW/Karta / checkFileHint

Method checkFileHint

src/function_context.py:543–557  ·  view source on GitHub ↗

Check if has a file string hint, now that all strings were recorded. Return Value: source file name string hint iff found one, None otherwise

(self)

Source from the content-addressed store, hash-verified

541 self.followers.remove(bin_ctx)
542
543 def checkFileHint(self):
544 """Check if has a file string hint, now that all strings were recorded.
545
546 Return Value:
547 source file name string hint iff found one, None otherwise
548 """
549 for string in self.strings:
550 name_parts = string.split(".")
551 if len(name_parts) != 2:
552 continue
553 file_name = self.file.split(os.path.sep)[-1].split(".")[0]
554 if name_parts[0] == file_name and name_parts[1].lower() in ["c", "cpp", "c++"]:
555 self.file_hint = string
556 return self.file_hint
557 return None
558
559 def isValidCandidate(self, bin_ctx):
560 """Check if the given binary context is a valid match candidate.

Callers 1

loadAndPrepareSourceMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected