def __init__(self, *children):
# Populate the list of children.
self._children = []
parent = weakref.ref(self)
previous = self
for child in children:
if isinstance(child, str): # bytes
child = Raw(child, self.arch, self.os)
elif not isinstance(child, Shellcode):
raise TypeError(
"Expected Shellcode, got %s instead" % type(child))
elif child.parent:
msg = "Already had a parent: %r" % child.parent
warnings.warn(msg, ShellcodeWarning)
child._parent = parent
self._children.append(child)
previous._check_platform(child)
previous = child
# Dark magic to implement the metadata combination feature.
评论列表
文章目录