def _check_platform(self, other):
"""
Verify that this and another shellcode have compatible platforms.
This means they are for the same plaform, or at least one of them is
platform independent.
:type other: `Shellcode`
:param other: Another shellcode.
:return: There is no return value.
Warnings are raised if the platforms don't match.
"""
if 'any' not in (self.arch, other.arch) and self.arch != other.arch:
msg = "Processor architectures don't match: %s and %s"
msg = msg % (self.arch, other.arch)
warnings.warn(msg, ShellcodeWarning)
if 'any' not in (self.os, other.os) and self.os != other.os:
msg = "Operating systems don't match: %s and %s"
msg = msg % (self.os, other.os)
warnings.warn(msg, ShellcodeWarning)
评论列表
文章目录