Skip to content

Commit

Permalink
fix: support .arr, support ios/wasm binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
iaincoulter committed Oct 22, 2024
1 parent 5df7cb0 commit 0bb15a0
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions cve_bin_tool/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,28 @@ def check_pe(_filename: str, signature: bytes) -> bool:
def check_fake_test(_filename: str, signature: bytes) -> bool:
"""check for fake tests under windows."""
return signature == b"MZ\x90\x00"


def check_mach_o_32(_filename: str, signature: bytes) -> bool:
"""Check for Mach-O 32-bit signature."""
return signature[:4] == b"\xFE\xED\xFA\xCE"


def check_mach_o_64(_filename: str, signature: bytes) -> bool:
"""Check for Mach-O 64-bit signature."""
return signature[:4] == b"\xFE\xED\xFA\xCF"


def check_mach_o_universal(_filename: str, signature: bytes) -> bool:
"""Check for Mach-O Universal Binary signature."""
return signature[:4] == b"\xCA\xFE\xBA\xBE"


def check_ios_arm(_filename: str, signature: bytes) -> bool:
"""Check for Mach-O Universal Binary signature."""
return signature[:4] == b"\xCF\xFA\xED\xFE"


def check_wasm(_filename: str, signature: bytes) -> bool:
"""Check for WebAssembly (WASM) signature."""
return signature[:4] == b"\x00\x61\x73\x6D"

0 comments on commit 0bb15a0

Please sign in to comment.