Jump to content

[C++] Small protection files


VegaS™
 Share

Recommended Posts

MOVED HERE:


 


Debes iniciar sesión para ver el contenido del enlace en esta publicación.


 


 


And who want to check size for different files: (shit)



int GetSizeOfMyDLL(char* fileName)
{
HANDLE file = CreateFileA(fileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
return GetSizeOfMyDLL(file, NULL);
}

#define SIZE_DLL 16896
#define NAME_DLL "bdvid32.dll"
HINSTANCE hGetProcIDDLL = LoadLibrary(NAME_DLL);

if (hGetProcIDDLL == NULL)
{
MessageBox(NULL, "The client can't start without one dll, please update autopatcher.", "#System Error", MB_ICONSTOP);
return 0;
}

else if (GetSizeOfMyDLL(NAME_DLL) != SIZE_DLL)
{
MessageBox(NULL, "DLL has been changed, please update autopatcher.", "#System Error", MB_ICONSTOP);
return 0;
}

Edited by VegaS™
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...