一个简单的C++程序从汇编提取ShellCode

Home / C++ MrLee 2015-3-30 3319

网上逛街看到的文章,然后简单的写了一个小例子,记录下来!
// AsmDemo.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include 
unsigned char *asm_code()
{
	__asm
	{
		lea eax,__code
		jmp __ret
	}
	//这里放shellcode的汇编代码
	int address = 0x55D330;
	__asm
	{
		__code:
		mov eax,ebx
		mov ebx,6
		mov eax,3
		call address;
		int 3;
		__ret:
	}
}
void main()
{
	unsigned char temp;
	unsigned char *asm_p = asm_code();
	while((temp = *asm_p) != 0xCC)
	{
		printf("%.2X",temp);
		asm_p ++;
	}
	getchar();
}

随便写的汇编代码,效果图:

QQ截图20150330152253

本文链接:https://www.it72.com/1641.htm

推荐阅读
最新回复 (0)
返回