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

Page 1 of 3 123 LastLast
Results 1 to 15 of 45
  1. #1
    Apprentice aecrimch is offline
    MemberRank
    Dec 2007 Join Date
    842Posts

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

    This work perfect in combination with Pinkof Antihack (or any other free). With this dll you can protect some important files (item.bmd, player.bmd, your dlls, etc) against unauthorized changes.
    Use CheckCRC.exe to generate CRC32 of file.
    Ex. protect for 1.04d

    Code:
    //CheckSum Filesconst char* PlayerF = "Data/Player/player.bmd";
    const char* ItemF_eng = "Data/Local/Eng/item_eng.bmd";
    const char* ItemF_por = "Data/Local/Por/item_por.bmd";
    const char* ItemF_spa = "Data/Local/Spn/item_spn.bmd";
    //const char* TextF = "Data/Local/Text.bmd";
    
    
    //Checksum Code
    unsigned long PlayerFCRC = 0x7D56FCEB;
    unsigned long ItemFCRC_eng = 0xF9485939;
    unsigned long ItemFCRC_por = 0xF9485939;
    unsigned long ItemFCRC_spa = 0xF9485939;
    //unsigned long TextFCRC = 0x370F4288;
    
    
    void checkCrc32()
    {
        CCRC32 MyCRC32;
        MyCRC32.Initialize();
        unsigned long ulCRCP = MyCRC32.FileCRC(PlayerF);
        unsigned long ulCRC_eng = MyCRC32.FileCRC(ItemF_eng);
        unsigned long ulCRC_por = MyCRC32.FileCRC(ItemF_por);
        unsigned long ulCRC_spa = MyCRC32.FileCRC(ItemF_spa);
    
    
            if(ulCRCP != PlayerFCRC)
        {
            MessageBoxA(0, "Player file modified!", "Error", MB_OK | MB_ICONSTOP);
            ExitProcess(1);
        }
            if(ulCRC_eng != ItemFCRC_eng)
        {
            MessageBoxA(0, "Item file modified!", "Error", MB_OK | MB_ICONSTOP);
            ExitProcess(1);
        }
            if(ulCRC_por != ItemFCRC_por)
        {
            MessageBoxA(0, "Item file modified!", "Error", MB_OK | MB_ICONSTOP);
            ExitProcess(1);
        }
            if(ulCRC_spa != ItemFCRC_spa)
        {
            MessageBoxA(0, "Item file modified!", "Error", MB_OK | MB_ICONSTOP);
            ExitProcess(1);
        }
    }
    Download:
    Source: crc32u - Download - 4shared
    Application to generate CRC32: CheckCRC - Download - 4shared
    Last edited by aecrimch; 04-01-16 at 01:50 PM. Reason: add new dl link


  2. #2
    MFS Team Owner diablo71 is offline
    MemberRank
    Jan 2007 Join Date
    BulgariaLocation
    876Posts

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

    For older versions:
    Code:
    //CheckSum Filesconst char* PlayerF = "Data/Player/player.bmd";
    const char* ItemF_eng = "Data/Local/item.bmd";
    //const char* TextF = "Data/Local/Text.bmd";
    If you would like you can change the prefix to other doesnt matter

  3. #3
    Apprentice retrok is offline
    MemberRank
    Apr 2012 Join Date
    18Posts

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

    emm, this code works for 97++?(Text.bmd Example):
    Code:
    #include "StdAfx.h"
    #include "Crc32.h"
     //CheckSum Files
    
    const char* TextF = "Data/Local/Text.bmd";
    
    //Checksum Code
    
    unsigned long TextFCRC = 0x370F4288;
    
    void checkCrc32()
    {
    	CCRC32 MyCRC32;
    	MyCRC32.Initialize();
    	unsigned long ulCRC_Text = MyCRC32.FileCRC(TextF);
    
    		if(ulCRC_Text != TextFCRC)
    	{
    		MessageBoxA(0, "Text file modified!", "Error", MB_OK | MB_ICONSTOP);
            ExitProcess(1);
    	}
    		
    	}
    }

  4. #4
    Member DeathArmy is offline
    MemberRank
    Dec 2009 Join Date
    84Posts

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

    This can be bypassed in 5 seconds.

  5. #5
    Demigod UnCleanOne is offline
    MemberRank
    May 2012 Join Date
    438Posts

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

    can you make a tut how to use this?
    i am newbies

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

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

    Quote Originally Posted by UnCleanOne View Post
    can you make a tut how to use this?
    i am newbies
    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)
    unsigned long PlayerFCRC = 0x7D56FCEB;
    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...

  7. #7
    Demigod UnCleanOne is offline
    MemberRank
    May 2012 Join Date
    438Posts

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

    i didnt know how to hook

  8. #8
    Developer nevS is offline
    MemberRank
    Aug 2005 Join Date
    GermanyLocation
    531Posts

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

    It is not hard to get the same crc after editing a file. Instead, use secure hash algorithms like sha256.
    If you want to read more:
    Cyclic redundancy check - Wikipedia, the free encyclopedia

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

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

    Quote Originally Posted by spezi View Post
    It is not hard to get the same crc after editing a file. Instead, use secure hash algorithms like sha256.
    If you want to read more:
    Cyclic redundancy check - Wikipedia, the free encyclopedia
    oo, let me see if u can do that:
    here is my item_spn.bmd:item_spn.rar
    which have crc32: FAEA638A
    please, make Kris damage 200 and send me back with original crc...

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

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

    I see, you are resistant to learn new things and not open-minded to constructive criticism. You obviously didn't read the link i posted. I just wanted to help you to improve.

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

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

    Quote Originally Posted by spezi View Post
    I see, you are resistant to learn new things and not open-minded to constructive criticism. You obviously didn't read the link i posted. I just wanted to help you to improve.
    you are pathetic... there is not about me is about you and your skills... you prove nothing...

  12. #12
    Developer nevS is offline
    MemberRank
    Aug 2005 Join Date
    GermanyLocation
    531Posts

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

    I don't have to prove my skills. I posted you already the proof that CRC is insecure for your purpose.
    Secondly, the linear properties of CRC codes even allow an attacker to modify a message in such a way as to leave the check value unchanged,[4][5]
    Even if I can't prove (I'm not familiar with editting bmd files, so I can't show you my skills), don't you think there are more clever guys than me?

  13. #13
    Apprentice retrok is offline
    MemberRank
    Apr 2012 Join Date
    18Posts

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

    Quote Originally Posted by spezi View Post
    I don't have to prove my skills. I posted you already the proof that CRC is insecure for your purpose.


    Even if I can't prove (I'm not familiar with editting bmd files, so I can't show you my skills), don't you think there are more clever guys than me?
    i understand, then I give you more options, I hope there are no problems:
    Files+ Sha Information:
    choose one of the following 4 files in the next link:

    MyFiles

    Now, choose one of the following 4 files:

    PNG File: Change Text `PNG` to `JPG`

    Exe File: Change www.google.com to `mywebsite.com`

    JPG File: Change the first Letter To `@` (Open with notepad,etc)

    DLL File: Change `This program cannot be run in DOS mode`
    To: `This Program Never run in DOS Mode`
    Last edited by retrok; 22-07-12 at 03:52 PM.

  14. #14
    MFS Team Owner diablo71 is offline
    MemberRank
    Jan 2007 Join Date
    BulgariaLocation
    876Posts

    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...
    very good explanation, also one idea for using hide .dll files is to include them inside the main.exe and pack the file

  15. #15
    Apprentice retrok is offline
    MemberRank
    Apr 2012 Join Date
    18Posts

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

    Quote Originally Posted by diablo71 View Post
    very good explanation, also one idea for using hide .dll files is to include them inside the main.exe and pack the file
    unfortunately CRC32 is simple and very easy to circumvent...

    at least serves as protective anti noobs



Page 1 of 3 123 LastLast

Advertisement