Remove output in the whole project

Please use verbose instead. See core.py for details
This commit is contained in:
mio
2021-03-29 16:41:02 +08:00
parent e18615ed3a
commit ad0456596a
64 changed files with 218 additions and 241 deletions
+13 -12
View File
@@ -9,6 +9,7 @@ from binascii import unhexlify
sys.path.append("..")
from qiling import *
from qiling.exception import *
from qiling.const import QL_VERBOSE
test = unhexlify('cccc')
X86_LIN = unhexlify('31c050682f2f7368682f62696e89e3505389e1b00bcd80')
@@ -24,65 +25,65 @@ X8664_macos = unhexlify('4831f65648bf2f2f62696e2f7368574889e74831d24831c0b00248c
class TestShellcode(unittest.TestCase):
def test_linux_x86(self):
print("Linux X86 32bit Shellcode")
ql = Qiling(code = X86_LIN, archtype = "x86", ostype = "linux", output = "off")
ql = Qiling(code = X86_LIN, archtype = "x86", ostype = "linux", verbose=QL_VERBOSE.OFF)
ql.run()
def test_linux_x64(self):
print("Linux X86 64bit Shellcode")
ql = Qiling(code = X8664_LIN, archtype = "x8664", ostype = "linux", output = "off")
ql = Qiling(code = X8664_LIN, archtype = "x8664", ostype = "linux", verbose=QL_VERBOSE.OFF)
ql.run()
def test_linux_mips32(self):
print("Linux MIPS 32bit EL Shellcode")
ql = Qiling(code = MIPS32EL_LIN, archtype = "mips", ostype = "linux", output = "off")
ql = Qiling(code = MIPS32EL_LIN, archtype = "mips", ostype = "linux", verbose=QL_VERBOSE.OFF)
ql.run()
#This shellcode needs to be changed to something non-blocking
def test_linux_arm(self):
print("Linux ARM 32bit Shellcode")
ql = Qiling(code = ARM_LIN, archtype = "arm", ostype = "linux", output = "off")
ql = Qiling(code = ARM_LIN, archtype = "arm", ostype = "linux", verbose=QL_VERBOSE.OFF)
ql.run()
def test_linux_arm64(self):
print("Linux ARM 64bit Shellcode")
ql = Qiling(code = ARM64_LIN, archtype = "arm64", ostype = "linux", output = "off")
ql = Qiling(code = ARM64_LIN, archtype = "arm64", ostype = "linux", verbose=QL_VERBOSE.OFF)
ql.run()
# #This shellcode needs to be changed to something simpler not requiring rootfs
# def test_windows_x86(self):
# print("Windows X86 32bit Shellcode")
# ql = Qiling(code = X86_WIN, archtype = "x86", ostype = "windows", rootfs="../examples/rootfs/x86_reactos", output="off")
# ql = Qiling(code = X86_WIN, archtype = "x86", ostype = "windows", rootfs="../examples/rootfs/x86_reactos", verbose=QL_VERBOSE.OFF)
# ql.run()
# #This shellcode needs to be changed to something simpler not requiring rootfs
# def test_windows_x64(self):
# print("\nWindows X8664 64bit Shellcode")
# ql = Qiling(code = X8664_WIN, archtype = "x8664", ostype = "windows", rootfs="../examples/rootfs/x86_reactos", output="off")
# ql = Qiling(code = X8664_WIN, archtype = "x8664", ostype = "windows", rootfs="../examples/rootfs/x86_reactos", verbose=QL_VERBOSE.OFF)
# ql.run()
#This shellcode needs to be changed to something simpler, listen is blocking
#def test_freebsd_x64(self):
# print("FreeBSD X86 64bit Shellcode")
# ql = Qiling(code = X8664_FBSD, archtype = "x8664", ostype = "freebsd", output = "off")
# ql = Qiling(code = X8664_FBSD, archtype = "x8664", ostype = "freebsd", verbose=QL_VERBOSE.OFF)
# ql.run()
# def test_macos_x64(self):
# print("macos X86 64bit Shellcode")
# ql = Qiling(code = X8664_macos, archtype = "x8664", ostype = "macos", output = "off")
# ql = Qiling(code = X8664_macos, archtype = "x8664", ostype = "macos", verbose=QL_VERBOSE.OFF)
# ql.run()
# def test_invalid_os(self):
# print("Testing Unknown OS")
# self.assertRaises(QlErrorOsType, Qiling, code = test, archtype = "arm64", ostype = "qilingos", output = "default" )
# self.assertRaises(QlErrorOsType, Qiling, code = test, archtype = "arm64", ostype = "qilingos", verbose=QL_VERBOSE.DEFAULT )
# def test_invalid_arch(self):
# print("Testing Unknown Arch")
# self.assertRaises(QlErrorArch, Qiling, code = test, archtype = "qilingarch", ostype = "linux", output = "default" )
# self.assertRaises(QlErrorArch, Qiling, code = test, archtype = "qilingarch", ostype = "linux", verbose=QL_VERBOSE.DEFAULT )
# def test_invalid_output(self):
# print("Testing Invalid output")
# self.assertRaises(QlErrorOutput, Qiling, code = test, archtype = "arm64", ostype = "linux", output = "blafooxyz" )
# self.assertRaises(QlErrorOutput, Qiling, code = test, archtype = "arm64", ostype = "linux", verbose=QL_VERBOSE.DEFAULT )
if __name__ == "__main__":