下面是以OGC注入器代码为例来说明怎么在注入器源代码中加入版权维护源代码,
OK,LET'S GO !
打开ogc-loader.cpp,
找到函数
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
在它的函数体里面可以找到这么一段:
mainInstance = hInstance;
// setup
char hookEXE [400] = ""; // "c:\\program files\\ogc hook\\notepad.exe"
char hookDLL [400] = ""; // "c:\\program files\\ogc hook\\notepad.dll"
char hookINI [400] = ""; // "c:\\program files\\ogc hook\\notepad.ini"
char hlCmdLine[400] = "";
char hlEXE [400] = "";
GetModuleFileName(0,hookEXE,390);
int len = strlen(hookEXE);
strcpy(hookDLL,hookEXE);
strcpy(hookINI,hookEXE);
hookDLL[len-3]='d';hookDLL[len-2]='l';hookDLL[len-1]='l';
hookINI[len-3]='i';hookINI[len-2]='n';hookINI[len-1]='i';
把它修改成以下的样子:
mainInstance = hInstance;
// setup
char hookEXE [400] = ""; // "c:\\program files\\ogc hook\\notepad.exe"
char hookDLL [400] = ""; // "c:\\program files\\ogc hook\\notepad.dll"
char hookINI [400] = ""; // "c:\\program files\\ogc hook\\notepad.ini"
char hlCmdLine[400] = "";
char hlEXE [400] = "";
GetModuleFileName(0,hookEXE,390);
lowercase(hookEXE);
int len = (int)strlen(hookEXE);
if(hookEXE[len-12]!='a' || hookEXE[len-11]!='b'|| hookEXE[len-10]!='c'|| hookEXE[len-9]!='d'|| hookEXE[len-8]!='h'|| hookEXE[len-7]!='o' || hookEXE[len-6]!='o' || hookEXE[len-5]!='k' || hookEXE[len-4]!='.')
{
MessageBox(0,"禁止修改Loader文件名,请尊重作者版权!","[XXXX] 版权信息",MB_ICONERROR|MB_TOPMOST);
return 0;
}
//int len = strlen(hookEXE);
strcpy(hookDLL,hookEXE);
strcpy(hookINI,hookEXE);
hookDLL[len-3]='d';hookDLL[len-2]='l';hookDLL[len-1]='l';
hookINI[len-3]='i';hookINI[len-2]='n';hookINI[len-1]='i';
编译无错后即可.那么DLL的名字就只能是abcdhook了,如果改成别的名字,使用时会自动弹出对话框:
[XXXX] 版权信息
禁止修改Loader文件名,请尊重作者版权!
就这么多了.
说明:此源代码由本人从一些作弊源代码中分离得到.