diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2020-07-21 22:40:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-21 22:40:52 +0200 |
| commit | a1c2dcbf6c4f3191984a781119d131c7c7f8d9ad (patch) | |
| tree | e90ca108dd1c130d015a3960051276d2c58d233a /miasm/core/utils.py | |
| parent | 6ccbedd2928d52aff605ede73adbdfadb6152582 (diff) | |
| parent | 82c5d696eb97b5816a276cbf9708d0b3602d7055 (diff) | |
| download | focaccia-miasm-a1c2dcbf6c4f3191984a781119d131c7c7f8d9ad.tar.gz focaccia-miasm-a1c2dcbf6c4f3191984a781119d131c7c7f8d9ad.zip | |
Merge pull request #1267 from serpilliere/int_expr_arg
Int expr arg
Diffstat (limited to 'miasm/core/utils.py')
| -rw-r--r-- | miasm/core/utils.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/miasm/core/utils.py b/miasm/core/utils.py index 37248c40..ed630bde 100644 --- a/miasm/core/utils.py +++ b/miasm/core/utils.py @@ -129,6 +129,9 @@ def decode_hex(value): def encode_hex(value): return _ENCODE_HEX(value)[0] +def size2mask(size): + """Return the bit mask of size @size""" + return (1 << size) - 1 def hexdump(src, length=16): lines = [] |