突然我不能使用我在.h头文件中写的新函数和我写的旧函数我可以使用它,我不敢相信:S
标准数据文件
#include "function.h"
钩子.h
#include "stdafx.h"
namespace DragoN_Hook
{
void EditOrginalCastleWar(int StartHour,int EndHour){
unsigned char lol[4] = {0x83, 0x7A, 0x08,(unsigned char)StartHour};
MemoryCopy((DWORD)0x00411A05,(DWORD)&lol,4);
}
}
函数.h
LPVOID MemoryCopy(DWORD destination, DWORD source, int length);
函数.cpp
LPVOID MemoryCopy(DWORD destination, DWORD source, int length)
{
DWORD oldSource = 0;
DWORD oldDestination = 0;
VirtualProtect((LPVOID)source,length,PAGE_EXECUTE_READWRITE,&oldSource);
VirtualProtect((LPVOID)destination,length,PAGE_EXECUTE_READWRITE,&oldDestination);
memcpy((void*)destination,(void*)source,length);
VirtualProtect((LPVOID)destination,length,oldDestination,&oldDestination);
VirtualProtect((LPVOID)source,length,oldSource,&oldSource);
return (LPVOID)destination;
};
错误 *错误 C3861: 'MemoryCopy': 找不到标识符*