Welcome!

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!

Protect your files against unauthorized changes [ C++ Source ]

Experienced Elementalist
Joined
Jul 27, 2012
Messages
200
Reaction score
48
Thanks for sharing!!!!!!!
I did the same as your guide (I think so)

There are files list i need to check crc
unsigned long ulCRC2 = MyCRC32.FileCRC("message.wtf");
unsigned long ulCRC3 = MyCRC32.FileCRC("Data/Player/Player.bmd");
unsigned long ulCRC4 = MyCRC32.FileCRC("Data/Local/ItemAddOption.bmd");
unsigned long ulCRC5 = MyCRC32.FileCRC("Data/Local/itemsettype.bmd");
unsigned long ulCRC6 = MyCRC32.FileCRC("Data/Local/Eng/item_eng.bmd");
unsigned long ulCRC7 = MyCRC32.FileCRC("Data/Local/Eng/ItemLevelTooltip_eng.bmd");
unsigned long ulCRC8 = MyCRC32.FileCRC("Data/Local/Eng/itemsetoption_eng.bmd");
unsigned long ulCRC9 = MyCRC32.FileCRC("Data/Local/Eng/ItemTooltip_eng.bmd");
unsigned long ulCRC10 = MyCRC32.FileCRC("Data/Local/Eng/ItemTooltipText_eng.bmd");
unsigned long ulCRC11 = MyCRC32.FileCRC("Data/Item/Wing44.bmd");

But not work!
I build the DLL then hook to main, then run main, but....
When i rename dll -> main run error (not found file ...dll) so i think i hooked ok
But when I replace the message.wtf with other one (has different crc) main still run >"<

This is link to my source code



please help me!!!!!!!!!!!!!!!
Thanksssssssssssssssssss :*:*:*
 
Last edited:
Experienced Elementalist
Joined
Jul 27, 2012
Messages
200
Reaction score
48
Help me please!
I download your crc32.zip
Then I Open crc32.vcxproj with VC++ 2010 Express
Then I try build (not change anything)
Build Log:
1>------ Build started: Project: crc32, Configuration: Release Win32 ------
1>crc32.rc(10): fatal error RC1015: cannot open include file 'afxres.h'.
1>
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Do you have any solution?
Thanksssssssssssss!
 
Apprentice
Joined
Dec 14, 2007
Messages
839
Reaction score
430
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...
 
Experienced Elementalist
Joined
Jul 27, 2012
Messages
200
Reaction score
48
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...

Thanks!Thanks!Thanks!Thanks!Thanks!Thanks!
The thank button isn't show for me >"<
I'm downloading VS 2010 Ultimate ^^ I'll try rebuild it
 
Junior Spellweaver
Joined
Jul 13, 2012
Messages
103
Reaction score
13
I use your main 1.04D + Pacth of chris05, but when you run the main loss of connectivity. Should I open a new offset? Please guide me! Thank you very much ^ ^!Sorry my terrible english!
 
Legendary Battlemage
Joined
Mar 28, 2012
Messages
683
Reaction score
39
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:



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

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

and ithink your jewels.dll have this kind of function. maybe release your jewels.dll SC/project file?

thanks :)
 
Apprentice
Joined
Dec 14, 2007
Messages
839
Reaction score
430
nice navossoc, but you made Y=200 not mindmg=200...

kriss1 - Protect your files against unauthorized changes [ C++ Source ] - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Apprentice
Joined
Dec 14, 2007
Messages
839
Reaction score
430
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:
#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);
}
}

add cFile.cpp to project:
#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
{
}

add cFile.h to project:

#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

modify dllmain.cpp

// 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;
}
 
Last edited:
Joined
Aug 6, 2005
Messages
552
Reaction score
298
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.
 
Junior Spellweaver
Joined
Sep 12, 2004
Messages
134
Reaction score
14
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.

I was sleepy, I changed the first value I've seen.

Yes, it's possible to change other values to calculate the same hash without change the filesize too.

If you use md5 or sha1 this tricky will be very hard to be used.

[]'s
 
Legendary Battlemage
Joined
Mar 28, 2012
Messages
683
Reaction score
39
anyone know how to put crc32 to jewels.dll not in main.exe? because when your using Jewels.dll then this crc can only be activated or use main main.exe its possible to change main.exe to disable crc...

thanks.
 
Apprentice
Joined
Dec 14, 2007
Messages
839
Reaction score
430
zarahlee,

you can crc32 protect your jewels.dll very simple, following these steps:
1. compress / embed / pack your jewels.dll with any tool (this step will hide your main SERIAL; this is the most important step, without this all is worthless);
2. find your jewels.dll crc32 with Application to generate CRC32: ;
3. edit your crc32 source adding file size and crc32 for jewels.dll;
4. build crc32.dll;
5. hook crc32.dll into main.exe using Pinkof method;
6. if you can not make 5. step protect main.exe + crc32.dll using molebox / enigma / or other tool.
 
Junior Spellweaver
Joined
Oct 1, 2012
Messages
127
Reaction score
8
If one player injects a speedhack.dll, will it change the crc of the the target file? Because if it will, then putting a crccheck on files will block speedhacking, won't it?
 
Apprentice
Joined
Dec 14, 2007
Messages
839
Reaction score
430
no mudev... will not block speedhack... for this you need an antihack.
 
Back
Top