def meta_compile(compile):
"Wraps the compile() method to do dark magic, see `meta_shellcode`."
@functools.wraps(compile)
def compile_wrapper(self, state = None):
if state is None:
state = CompilerState()
self.offset = state.offset
if hasattr(self, '_compile_hook'):
bytes = self._compile_hook(compile, state)
else:
bytes = compile(self, state)
state.next_piece( len(bytes) )
return bytes
return compile_wrapper
评论列表
文章目录