How to write a shellcode

Source: Internet
Author: User

ShellCode 's writing is to change the function or variable in memory of the indirect address to a function or variable in memory of the direct address, directly call!

Take the MessageBox function as an example to explain the following

New shellcode.cpp:

Write the following code:

Operation Result:

Convert the VC code into assembly instructions:

Memory Data graph:

After the actual address of the function is found, the code is modified as follows:

Convert the above assembly instructions into binary data:

Memory Data graph:

copy binary data between 0x0040103c~0x00401049

As follows:

6A 6A xx 6A 6A xx B8 1E FD 0B D0 FF

Final shellcode code:

Operation Result:

How to write a shellcode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.