Created
August 8, 2017 17:40
-
-
Save njgheorghita/84dc2a609389e1b16b10d58a467b10bb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def preprocess_code(code): | |
o = 0 | |
i = 0 | |
pushcache = {} | |
code = code + b'\x00' * 32 | |
while i < len(code) - 32: | |
codebyte = safe_ord(code[i]) | |
if codebyte == 0x5b: | |
o |= 1 << i | |
if 0x60 <= codebyte <= 0x7f: | |
pushcache[i] = utils.big_endian_to_int(code[i + 1: i + codebyte - 0x5e]) | |
i += codebyte - 0x5e | |
else: | |
i += 1 | |
return o, pushcache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment