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

Page 2 of 2 FirstFirst 12
Results 26 to 45 of 45
  1. #26
    NOOB quyen194 is offline
    MemberRank
    Jul 2012 Join Date
    Hoai Duc Phu, HLocation
    200Posts

    sad Re: Protect your files against unauthorized changes [ C++ Source ]

    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

    http://www.mediafire.com/?ki58a1t512pbf

    please help me!!!!!!!!!!!!!!!
    Thanksssssssssssssssssss *:*
    Last edited by quyen194; 02-09-12 at 08:57 AM.

  2. #27
    NOOB quyen194 is offline
    MemberRank
    Jul 2012 Join Date
    Hoai Duc Phu, HLocation
    200Posts

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

    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!

  3. #28
    Apprentice aecrimch is offline
    MemberRank
    Dec 2007 Join Date
    842Posts

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

    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...

  4. #29
    NOOB quyen194 is offline
    MemberRank
    Jul 2012 Join Date
    Hoai Duc Phu, HLocation
    200Posts

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

    Quote Originally Posted by aecrimch View Post
    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

  5. #30
    Valued Member huythao229 is offline
    MemberRank
    Jul 2012 Join Date
    Viet NamLocation
    103Posts

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

    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!

  6. #31
    Account Upgraded | Title Enabled! zarahlee is offline
    MemberRank
    Mar 2012 Join Date
    C:\ProgramFilesLocation
    685Posts

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

    Quote Originally Posted by aecrimch View Post
    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

    Quote Originally Posted by zarahlee View Post
    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 :)

  7. #32
    Let's do this... navossoc is online now
    MemberRank
    Sep 2004 Join Date
    BrazilLocation
    305Posts

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

    Quote Originally Posted by aecrimch View Post
    oo, let me see if u can do that:
    here is my item_spn.bmd:Attachment 109542
    which have crc32: FAEA638A
    please, make Kris damage 200 and send me back with original crc...
    Here...
    Attached Files Attached Files

  8. #33
    Apprentice aecrimch is offline
    MemberRank
    Dec 2007 Join Date
    842Posts

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

    nice navossoc, but you made Y=200 not mindmg=200...

    kriss1.jpg

  9. #34
    Apprentice aecrimch is offline
    MemberRank
    Dec 2007 Join Date
    842Posts

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

    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 by aecrimch; 13-01-13 at 01:08 PM.

  10. #35
    Developer nevS is offline
    MemberRank
    Aug 2005 Join Date
    GermanyLocation
    534Posts

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

    Quote Originally Posted by aecrimch View Post
    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.

  11. #36
    Let's do this... navossoc is online now
    MemberRank
    Sep 2004 Join Date
    BrazilLocation
    305Posts

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

    Quote Originally Posted by nevS View Post
    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

  12. #37
    Account Upgraded | Title Enabled! zarahlee is offline
    MemberRank
    Mar 2012 Join Date
    C:\ProgramFilesLocation
    685Posts

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

    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.

  13. #38
    Apprentice aecrimch is offline
    MemberRank
    Dec 2007 Join Date
    842Posts

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

    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: CheckCRC - Download - 4shared;
    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.

  14. #39
    Valued Member mudev is offline
    MemberRank
    Oct 2012 Join Date
    127Posts

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

    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?

  15. #40
    Apprentice aecrimch is offline
    MemberRank
    Dec 2007 Join Date
    842Posts

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

    no mudev... will not block speedhack... for this you need an antihack.

  16. #41
    NOOB quyen194 is offline
    MemberRank
    Jul 2012 Join Date
    Hoai Duc Phu, HLocation
    200Posts

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

    Quote Originally Posted by mudev View Post
    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?
    If speedhacking is made by change player.bmd, this crc-files-checking can prevent that problem
    But you need to create a thread for checking interval time, because before choose character they can change bmd file
    The only way to bypass this is killing the checking thread LOL

  17. #42
    -( . ) ( . )- clerigz is offline
    MemberRank
    Mar 2012 Join Date
    1,365Posts

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

    Quote Originally Posted by aecrimch View Post
    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
    how to use this all in vs2010????

  18. #43
    Valued Member MaxVoll is offline
    MemberRank
    Aug 2013 Join Date
    112Posts

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

    someone has source link....

  19. #44
    Newbie daezugun is offline
    MemberRank
    Feb 2011 Join Date
    127.0.0.1Location
    787Posts

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

    Pls reupload the source link thanks

  20. #45
    Apprentice aecrimch is offline
    MemberRank
    Dec 2007 Join Date
    842Posts

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




Page 2 of 2 FirstFirst 12

Advertisement