Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Donate
Please sign in before you donate.
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
1 Star 0 Fork 3

github-mysync/qiling

forked from qiling/qiling
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
dev
Branches (17)
Tags (10)
dev
master
ida_plugin_enhance
fix_pipe
uc2afl
old_dev
fix-windows-ci
mcu
dev_before_mcu
dev_old
revert-734-fix-new-thread-id
refactor
revert-639-dev
revert-612-dev
dev_official
revert-544-x64_partial_regs
demigod
1.4.1
1.4.0
1.3.0
1.2.4.1
1.2.4
1.2.3
1.2.2
1.2.1
1.2
1.1.3
dev
Branches (17)
Tags (10)
dev
master
ida_plugin_enhance
fix_pipe
uc2afl
old_dev
fix-windows-ci
mcu
dev_before_mcu
dev_old
revert-734-fix-new-thread-id
refactor
revert-639-dev
revert-612-dev
dev_official
revert-544-x64_partial_regs
demigod
1.4.1
1.4.0
1.3.0
1.2.4.1
1.2.4
1.2.3
1.2.2
1.2.1
1.2
1.1.3
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
dev
Branches (17)
Tags (10)
dev
master
ida_plugin_enhance
fix_pipe
uc2afl
old_dev
fix-windows-ci
mcu
dev_before_mcu
dev_old
revert-734-fix-new-thread-id
refactor
revert-639-dev
revert-612-dev
dev_official
revert-544-x64_partial_regs
demigod
1.4.1
1.4.0
1.3.0
1.2.4.1
1.2.4
1.2.3
1.2.2
1.2.1
1.2
1.1.3
qiling
/
tests
/
test_shellcode.py
qiling
/
tests
/
test_shellcode.py
test_shellcode.py 5.04 KB
Copy Edit Raw Blame History
mio_ff6a authored 2021年03月29日 16:41 +08:00 . Remove output in the whole project
#!/usr/bin/env python3
#
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
#
import sys, unittest
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')
X8664_LIN = unhexlify('31c048bbd19d9691d08c97ff48f7db53545f995257545eb03b0f05')
MIPS32EL_LIN = unhexlify('ffff0628ffffd004ffff05280110e4270ff08424ab0f02240c0101012f62696e2f7368')
X86_WIN = unhexlify('fce8820000006089e531c0648b50308b520c8b52148b72280fb74a2631ffac3c617c022c20c1cf0d01c7e2f252578b52108b4a3c8b4c1178e34801d1518b592001d38b4918e33a498b348b01d631ffacc1cf0d01c738e075f6037df83b7d2475e4588b582401d3668b0c4b8b581c01d38b048b01d0894424245b5b61595a51ffe05f5f5a8b12eb8d5d6a01eb2668318b6f87ffd5bbf0b5a25668a695bd9dffd53c067c0a80fbe07505bb4713726f6a0053ffd5e8d5ffffff63616c6300')
X8664_WIN = unhexlify('fc4881e4f0ffffffe8d0000000415141505251564831d265488b52603e488b52183e488b52203e488b72503e480fb74a4a4d31c94831c0ac3c617c022c2041c1c90d4101c1e2ed5241513e488b52203e8b423c4801d03e8b80880000004885c0746f4801d0503e8b48183e448b40204901d0e35c48ffc93e418b34884801d64d31c94831c0ac41c1c90d4101c138e075f13e4c034c24084539d175d6583e448b40244901d0663e418b0c483e448b401c4901d03e418b04884801d0415841585e595a41584159415a4883ec204152ffe05841595a3e488b12e949ffffff5d49c7c1000000003e488d95fe0000003e4c8d850f0100004831c941ba45835607ffd54831c941baf0b5a256ffd548656c6c6f2c2066726f6d204d534621004d657373616765426f7800')
ARM_LIN = unhexlify('01308fe213ff2fe178460e300190491a921a0827c251033701df2f62696e2f2f7368')
ARM64_LIN = unhexlify('420002ca210080d2400080d2c81880d2010000d4e60300aa01020010020280d2681980d2010000d4410080d2420002cae00306aa080380d2010000d4210400f165ffff54e0000010420002ca210001caa81b80d2010000d4020004d27f0000012f62696e2f736800')
X8664_FBSD = unhexlify('6a61586a025f6a015e990f054897baff02aaaa80f2ff524889e699046680c2100f05046a0f05041e4831f6990f0548976a035852488d7424f080c2100f0548b8523243427730637257488d3e48af74084831c048ffc00f055f4889d04889fe48ffceb05a0f0575f799043b48bb2f62696e2f2f73685253545f5257545e0f05')
X8664_macos = unhexlify('4831f65648bf2f2f62696e2f7368574889e74831d24831c0b00248c1c828b03b0f05')
class TestShellcode(unittest.TestCase):
def test_linux_x86(self):
print("Linux X86 32bit Shellcode")
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", 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", 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", 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", 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", 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", 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", 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", 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", verbose=QL_VERBOSE.DEFAULT )
# def test_invalid_arch(self):
# print("Testing Unknown Arch")
# 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", verbose=QL_VERBOSE.DEFAULT )
if __name__ == "__main__":
unittest.main()
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

About

Qiling Advanced Binary Emulation Framework
Cancel

Releases

No release

Contributors

All

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/github-mysync/qiling.git
git@gitee.com:github-mysync/qiling.git
github-mysync
qiling
qiling
dev
Going to Help Center

Search

Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /