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函数

posted @ 2019-04-24 22:24  样子2018  阅读(980)  评论(0编辑  收藏  举报