Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backends/bn_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def _sanitize_asm(self, text: str, keep_labels: bool = False) -> tuple[str, List
if re.match(r"^\s*\.", s):
# e.g., .intel_syntax, .text, .globl
continue
if re.match(r"^(?i)(global|extern|extrn)\b", s):
if re.match(r"^(global|extern|extrn)\b", s, re.IGNORECASE):
continue
lines.append(s)
mapping.append(idx)
Expand Down
5 changes: 3 additions & 2 deletions backends/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def _parse_sequence(self, s: str) -> Optional[bytes]:

def match_patterns(self, data: bytes) -> List[PatternMatch]:
matches: List[PatternMatch] = []
hexstr = data.hex()
hexstr = " ".join(f"{x:02x}" for x in data)
print(hexstr)
for p in self.patterns:
if not p.enabled:
continue
Expand Down Expand Up @@ -117,7 +118,7 @@ def match_patterns(self, data: bytes) -> List[PatternMatch]:
offs = []
for m in rx.finditer(hexstr):
# Map hex index to byte offset: every 2 hex chars per byte
start = m.start() // 2
start = len(hexstr[: m.start()].replace(" ", "")) // 2
offs.append(start)
if offs:
matches.append(PatternMatch(pattern=p, offsets=offs))
Expand Down