Dll缺少入口点timeGetTime

Dll缺少入口点timeGetTime,dll,dllexport,dll-injection,Dll,Dllexport,Dll Injection,正在尝试使用以下命令在mingwx64中编译此DLL gcc-shared-o evil.dll evil.cpp-DWIN32_LEAN_和_MEAN 通过反复试验,我将“int fireMyLaser()”从我找到的代码示例的底部移到声明下面。但我仍然在加载EXE时遇到一个错误,即它找不到入口点timeGetTime。有人有什么想法吗 #include <windows.h> #define DllExport __declspec (dllexport) int fireMy

正在尝试使用以下命令在mingwx64中编译此DLL

gcc-shared-o evil.dll evil.cpp-DWIN32_LEAN_和_MEAN

通过反复试验,我将“int fireMyLaser()”从我找到的代码示例的底部移到声明下面。但我仍然在加载EXE时遇到一个错误,即它找不到入口点timeGetTime。有人有什么想法吗

#include <windows.h>
#define DllExport __declspec (dllexport)

int fireMyLaser()
{
 WinExec("calc", 0);
 return 0;
}

DllExport void timeGetTime() { fireMyLaser(); }

BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason, LPVOID lpvReserved)
{
    fireMyLaser();
    return 0;
}`
#包括
#定义DllExport\uuu declspec(DllExport)
int fireMyLaser()
{
WinExec(“计算”,0);
返回0;
}
DllExport void timeGetTime(){fireMyLaser();}
BOOL WINAPI DllMain(HINSTANCE hinstDLL、DWORD FDFREASON、LPVOID lpvReserved)
{
fireMyLaser();
返回0;
}`

编译DLL时,在加载EXE时,我得到“程序入口点timeGetTime无法在动态链接库中找到”

我没有访问EXE代码的权限,但通过反复试验,下面的工作正常

// includes adjusted here to allow for timeGetTime to be used as an entry point
#include <windef.h>
#include <stdio.h>
#include <WinBase.h>
//entrypoint timeGetTime below for exe to hit... repeatedly
extern "C" __declspec(dllexport) int timeGetTime() {
 WinExec("calc.exe", 0);
 return 0;
}

BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason, LPVOID lpvReserved)
{
 timeGetTime();
 return TRUE;
}
//此处调整了includes,以允许将timeGetTime用作入口点
#包括
#包括
#包括
//下面的entrypoint timeGetTime供exe点击。。。反复地
外部“C”uu declspec(dllexport)int timeGetTime(){
WinExec(“calc.exe”,0);
返回0;
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL、DWORD FDFREASON、LPVOID lpvReserved)
{
timeGetTime();
返回TRUE;
}

请显示产生错误的代码,以及您使用的场景。不要在注释中,而是编辑问题。问题已更新能否同时添加exe代码?你是如何建造它的?