Apprentice
- Joined
- Dec 14, 2007
- Messages
- 839
- Reaction score
- 430
??how to compress DLL?
pack with PECompact
Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!
Join Today!??how to compress DLL?
I build with VS2010 Ultimate...
afxres.h is a part of the MFC Library. VS Express edition doesn't contain MFC. If your project doesn't use MFC you can safely replace afxres.h with windows.h in your crc2.rc or delete crc2.rc...
here is what you need in few steps:
1. VS2010
2. OllyDbg
3. launch CheckCRC.exe and find CRC32 of Data/Player/player.bmd file;
4. open project and put your value (replace 7D56FCEB with your value)
4. repeat step 3 and 4 for all your protected files
5. build crc32.dll
6. hook crc32.dll in your main
7. COMPRESS crc32.dll, so smart guy like DeathArmy can not modify your protected value (see in pictures how can be modified using olly)
8. embed all your dlls with main using Enigma Virtual Box (same reason like 7)
here it is 2 pictures with what happens if you do not compress your crc32.dll:
You must be registered to see links
You must be registered to see links
that is all...
like this but crc32 hook with main.exe? how about if your using jewels.dll (which have your ip+serial) then hackers change main.exe because info to connect in server are in jewels.dll not in main.exe... XD
oo, let me see if u can do that:
here is my item_spn.bmd:View attachment 109542
which have crc32: FAEA638A
please, make Kris damage 200 and send me back with original crc...
#include "cFile.h"
cFile MyFile;
//files size
int sizePlayerFBMD = 3324834;
int sizeItemF_engBMD = 688132;
int sizeItemF_porBMD = 688132;
int sizeItemF_spaBMD = 688132;
void checkFilesSize()
{
bool StatePlayerF = MyFile.iCheckFileSize(PlayerF,sizePlayerFBMD);
bool StateItemF_eng = MyFile.iCheckFileSize(ItemF_eng,sizeItemF_engBMD);
bool StateItemF_por = MyFile.iCheckFileSize(ItemF_por,sizeItemF_porBMD);
bool StateItemF_spa = MyFile.iCheckFileSize(ItemF_spa,sizeItemF_spaBMD);
if(StatePlayerF == false)
{
MessageBoxA(0, "Player file modified!", "Error", MB_OK | MB_ICONSTOP);
ExitProcess(1);
}
if(StateItemF_eng == false)
{
MessageBoxA(0, "Item file modified!", "Error", MB_OK | MB_ICONSTOP);
ExitProcess(1);
}
if(StateItemF_por == false)
{
MessageBoxA(0, "Item file modified!", "Error", MB_OK | MB_ICONSTOP);
ExitProcess(1);
}
if(StateItemF_spa == false)
{
MessageBoxA(0, "Item file modified!", "Error", MB_OK | MB_ICONSTOP);
ExitProcess(1);
}
}
#include "Stdafx.h"
#include "cFile.h"
cFile::cFile() // constructor
{
}
int cFile::iGetFileSize(const char* FileName)
{
HANDLE hFile = CreateFileA(FileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL, NULL);
return GetFileSize(hFile,NULL);
}
bool cFile::iCheckFileSize(const char* cFile,int Size)
{
int iSize = this->iGetFileSize(cFile);
if(iSize == Size)
return true;
return false;
}
cFile::~cFile() // distructor
{
}
#include "Stdafx.h"
#ifndef cFile_H
#define cFile_H
class cFile
{
public:
cFile();
~cFile();
bool iCheckFileSize(const char* cFile,int Size);
int iGetFileSize(const char* FileName);
};
#endif
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#include "checkcrc.h"
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
checkCrc32();
checkFilesSize();
case DLL_THREAD_ATTACH:
checkCrc32();
checkFilesSize();
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
It is also possible with same file size... instead of adding 4 bytes, you can also modify 4 other unimportant bytes to get the same checksum. As I posted some months ago, use a cryptographic hash algorithm(SHA-2 etc.), else it wont be safe.it seems it is possible to modify / edit a file and obtain same crc32 (do not know how, navossoc did this, but without keeping the same file size), so i implemented a checkFilesSize function to avoid this:
add in checkcrc.h:
add cFile.cpp to project:
add cFile.h to project:
modify dllmain.cpp
It is also possible with same file size... instead of adding 4 bytes, you can also modify 4 other unimportant bytes to get the same checksum. As I posted some months ago, use a cryptographic hash algorithm(SHA-2 etc.), else it wont be safe.