How to prevent cheating with Gamecih?

前端 未结 10 1535
孤独总比滥情好
孤独总比滥情好 2021-01-31 12:07

Background

I\'ve had problems for quite a while now with players cheating in my android game. For a strict single-player game this wouldn\'t be a big is

相关标签:
10条回答
  • 2021-01-31 12:21

    You should store a hash (eg crc32 or md5) of the health etc. everytime you update the value, do a hash check on the currently set value. In this case, the cheaters would have to write a seperate app that handles the hashes. Possible, but this will stop the script-kiddy cheaters soon enough.

    0 讨论(0)
  • 2021-01-31 12:22

    To prevent memory cheating you can do one of the following:

    • Store the most important values in arrays of digits rather than in variables
    • Store the value as string as well and whenever you modify it check to see if it matches the string.
    • Take a look at MochiDigits classes from Mochi (Actionscript 3) and come up with a Java port. https://code.google.com/p/cunitescore/source/browse/trunk/as3/unitescore/mochi/MochiDigits.as?r=92
    0 讨论(0)
  • 2021-01-31 12:25
    try{
        ApplicationInfo info = getPackageManager().
                getApplicationInfo("com.cih.gamecih", 0 );
        return true;
    } catch( PackageManager.NameNotFoundException e ){
        return false;
    }
    

    If this function returns true, don't even let the hacker enter Multiplayer mode, and prompt him to uninstall it.

    0 讨论(0)
  • 2021-01-31 12:25

    I have a thought on this, since I sometimes use GameCIH myself. You could have a rolling 10-entry transaction log that self-checks on every new transaction.

    What you would do (since GameCIH can only deal with one variable at a time) is have two variables that are checked against each other.

    • Original (or 11-ago) value
    • Array of values of changes 1 through 10
    • Summation value, negated. (This totally changes the decimal value you can see, and it'll change differently than the original value when the oldest log entry is rolled into it.)

    If the negative of the summation value doesn't match the original plus the 10 logged transactions, return an error.

    You would just have to change how your stat mods are handled - if even one of them still tries to modify the original value directly, your game would return that it's been incorrectly changed.

    0 讨论(0)
  • 2021-01-31 12:27

    You can store life in X number of variables and the real value will be the sum of them (always calculated dynamically). You randomly choose which one to update. On top of that You can add some consistency check and it becomes extremely hard for cheater to realise what and how to change it.

    The consistency check could be a simple rule that 1st, 2nd and 3rd variables are in growing order for example and the 4th is the smallest. It will take someone good while to figure this out with this tool.

    Yoy can also get more creative and mix in some encryption etc (the way you mentioned) on top of that. Then it becomes second to impossible unless someone has your code.

    EDIT: Add 100 random variables that change all the time with random names (or positions in the array, to make it easier) and then good luck for cheaters looking for the right ones. And make it all dynamic so every time they have to crack it again.

    0 讨论(0)
  • 2021-01-31 12:27

    Could you just check for root access on game launch? Then deny opening app or deny multiplayer mode on rooted devices? Provide a small check at the opening load screen only when app is initialized, maybe have app request super user then if user grants it try to do a harmless function not allowed without superuser then a code to check if said function was successfully then undo change and pop a message box indicating user should leave root mode try again.

    Alternately this check could be applied upon entering multiplayer mode.

    Also you could just run multiplayer mode from a server and single player from device and let single players hex edit freely.

    0 讨论(0)
提交回复
热议问题