C/C++ 之dll注入
#include <stdio.h>#include <stdlib.h>
#include <windows.h>
#include <time.h>
_declspec(dllexport) void go1()
{
while (1)
{
malloc(10 * 1024 * 1024);
Sleep(3000);
}
}
_declspec(dllexport) void go2()
{
MessageBoxA(0, "哈哈", "ok", 0);
}
_declspec(dllexport) void runGo()
{
time_t t;
int num;
srand((unsigned) time(&t));
num = rand() % 100;
num > 50 ? go1() : go2();
}
void main(){
}利用dll注射工具进行执行runGo函数
文档来源:51CTO技术博客https://blog.51cto.com/u_15309652/3156296
页:
[1]