mirror of
https://github.com/mandiant/capa.git
synced 2025-12-22 15:16:22 -08:00
17 lines
430 B
Python
17 lines
430 B
Python
import codecs
|
|
|
|
from capa.features.extractors import helpers
|
|
|
|
|
|
def test_all_zeros():
|
|
# Python 2: <str>
|
|
# Python 3: <bytes>
|
|
a = b"\x00\x00\x00\x00"
|
|
b = codecs.decode("00000000", "hex")
|
|
c = b"\x01\x00\x00\x00"
|
|
d = codecs.decode("01000000", "hex")
|
|
assert helpers.all_zeros(a) is True
|
|
assert helpers.all_zeros(b) is True
|
|
assert helpers.all_zeros(c) is False
|
|
assert helpers.all_zeros(d) is False
|