Skip to content

Instantly share code, notes, and snippets.

@wxsBSD
Created August 22, 2021 01:22
Show Gist options
  • Save wxsBSD/5cc0aab5fc99eccaf20eb95b94ed79e8 to your computer and use it in GitHub Desktop.
Save wxsBSD/5cc0aab5fc99eccaf20eb95b94ed79e8 to your computer and use it in GitHub Desktop.
fullword problems
import platform
import yara

print(f"Platform version: {platform.version()}")
print(f"Python version: {platform.python_version()}")
print(f"YARA version: {yara.YARA_VERSION}")

rules = yara.compile(source='rule a { strings: $a = "foo" fullword condition: $a }')
for c in range(256):
    print(f"0x{c:02x}: ", end="")
    print(rules.match(data=bytes((c,)) + b"foo"))
Platform version: Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:27 PDT 2021; root:xnu-7195.141.2~5/RELEASE_ARM64_T8101
Python version: 3.8.2
YARA version: 4.1.0
0x00: [a]
0x01: [a]
0x02: [a]
0x03: [a]
0x04: [a]
0x05: [a]
0x06: [a]
0x07: [a]
0x08: [a]
0x09: [a]
0x0a: [a]
0x0b: [a]
0x0c: [a]
0x0d: [a]
0x0e: [a]
0x0f: [a]
0x10: [a]
0x11: [a]
0x12: [a]
0x13: [a]
0x14: [a]
0x15: [a]
0x16: [a]
0x17: [a]
0x18: [a]
0x19: [a]
0x1a: [a]
0x1b: [a]
0x1c: [a]
0x1d: [a]
0x1e: [a]
0x1f: [a]
0x20: [a]
0x21: [a]
0x22: [a]
0x23: [a]
0x24: [a]
0x25: [a]
0x26: [a]
0x27: [a]
0x28: [a]
0x29: [a]
0x2a: [a]
0x2b: [a]
0x2c: [a]
0x2d: [a]
0x2e: [a]
0x2f: [a]
0x30: []
0x31: []
0x32: []
0x33: []
0x34: []
0x35: []
0x36: []
0x37: []
0x38: []
0x39: []
0x3a: [a]
0x3b: [a]
0x3c: [a]
0x3d: [a]
0x3e: [a]
0x3f: [a]
0x40: [a]
0x41: []
0x42: []
0x43: []
0x44: []
0x45: []
0x46: []
0x47: []
0x48: []
0x49: []
0x4a: []
0x4b: []
0x4c: []
0x4d: []
0x4e: []
0x4f: []
0x50: []
0x51: []
0x52: []
0x53: []
0x54: []
0x55: []
0x56: []
0x57: []
0x58: []
0x59: []
0x5a: []
0x5b: [a]
0x5c: [a]
0x5d: [a]
0x5e: [a]
0x5f: [a]
0x60: [a]
0x61: []
0x62: []
0x63: []
0x64: []
0x65: []
0x66: []
0x67: []
0x68: []
0x69: []
0x6a: []
0x6b: []
0x6c: []
0x6d: []
0x6e: []
0x6f: []
0x70: []
0x71: []
0x72: []
0x73: []
0x74: []
0x75: []
0x76: []
0x77: []
0x78: []
0x79: []
0x7a: []
0x7b: [a]
0x7c: [a]
0x7d: [a]
0x7e: [a]
0x7f: [a]
0x80: [a]
0x81: [a]
0x82: [a]
0x83: [a]
0x84: [a]
0x85: [a]
0x86: [a]
0x87: [a]
0x88: [a]
0x89: [a]
0x8a: [a]
0x8b: [a]
0x8c: [a]
0x8d: [a]
0x8e: [a]
0x8f: [a]
0x90: [a]
0x91: [a]
0x92: [a]
0x93: [a]
0x94: [a]
0x95: [a]
0x96: [a]
0x97: [a]
0x98: [a]
0x99: [a]
0x9a: [a]
0x9b: [a]
0x9c: [a]
0x9d: [a]
0x9e: [a]
0x9f: [a]
0xa0: [a]
0xa1: [a]
0xa2: [a]
0xa3: [a]
0xa4: [a]
0xa5: [a]
0xa6: [a]
0xa7: [a]
0xa8: [a]
0xa9: [a]
0xaa: []
0xab: [a]
0xac: [a]
0xad: [a]
0xae: [a]
0xaf: [a]
0xb0: [a]
0xb1: [a]
0xb2: [a]
0xb3: [a]
0xb4: [a]
0xb5: []
0xb6: [a]
0xb7: [a]
0xb8: [a]
0xb9: [a]
0xba: []
0xbb: [a]
0xbc: [a]
0xbd: [a]
0xbe: [a]
0xbf: [a]
0xc0: []
0xc1: []
0xc2: []
0xc3: []
0xc4: []
0xc5: []
0xc6: []
0xc7: []
0xc8: []
0xc9: []
0xca: []
0xcb: []
0xcc: []
0xcd: []
0xce: []
0xcf: []
0xd0: []
0xd1: []
0xd2: []
0xd3: []
0xd4: []
0xd5: []
0xd6: []
0xd7: [a]
0xd8: []
0xd9: []
0xda: []
0xdb: []
0xdc: []
0xdd: []
0xde: []
0xdf: []
0xe0: []
0xe1: []
0xe2: []
0xe3: []
0xe4: []
0xe5: []
0xe6: []
0xe7: []
0xe8: []
0xe9: []
0xea: []
0xeb: []
0xec: []
0xed: []
0xee: []
0xef: []
0xf0: []
0xf1: []
0xf2: []
0xf3: []
0xf4: []
0xf5: []
0xf6: []
0xf7: [a]
0xf8: []
0xf9: []
0xfa: []
0xfb: []
0xfc: []
0xfd: []
0xfe: []
0xff: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment