How can i prevent Cheat engine for my single player flash games? - actionscript-3

I have some small flash games in facebook. How can i prevent cheating with cheat engine? My swf file sends the score to my database by php. I just dont want people to hack highscores in my flash games by using cheat engine. What is the best way to avoid these issues?
Thanks in advance..

2 methods I use are as follows
SpeedHack Watch Dog
http://www.bjoernacker.de/flash/detecting-the-cheat-engines-speedhack-in-as3/
Use this class to determine if the user is using CheatEngine to lower the frame rate
another method would to create a vault class for storing variables ina proxy, this vault will store variables within a different namespace (one that cheat engine cannot alter);
http://troyworks.com/blog/2007/08/05/introspection-in-as3-use-of-namespace/

Yes you can:
this is a really good and easy way to do it.
http://www.riawolf.com/?p=20

Short answer; you can't.
Long answer; It's a lot of work. One option is to make a server-side port of your game, make sure everything is deterministic, and send over all player actions and validate them on the server-side port (and discard any failing validations).

It depends on game , because some of them You can verify on server , checking user steps , but You can also record game and save it with scores , than replay highscores to check if games are valid .

I just add some random number to the scores ( let's say 100 ) and then substract it when I show it somewhere. After this I obfusticate the SWF file. So I would have something like : myScores = 100;. If he have 15 scores, the memory will have that 115 number and he will be looking for 15, not 115. Then I substract 100 from 115 and get the real points to be displayed. It is important to protect your swf from decompiling ( there is plenty soft that will obfusticate it ). I also run my own encrypt/decrypt function when sending to the PHP ;)

Related

Corona SDK: Saving Scores

I am making a game in Corona SDK in which I want to be able to save the player's high score to the device that they are using's disk, just so that it will stay saved even if the user restarts the app.
Problem is, everywhere I go online for help on this sort of thing I am told I should be using JSON, but I am not sure if there is a simpler way of doing things or even if JSON is the right approach.
Maybe try Introducing new preference storage features.
heres a neat thought that may work. make a new scene that contains the high score variable but dont erase the variable when exiting. then everytime they want to check their high score they just have to go to the scene.
option 2 - this one is a bit more tricky and im not exactly sure if you need permissions aka administrator rights (and if you are submitting your app on googleplay you may need to ask for permission. so review the rules before doing it), write a batch file that copies the highscore into a new file.
option 1 is better because you are not necessarily adding anything.

Automatically Generated rhythm game Flash Action Script 3

Is it possible to create an automatically generated Rhythm game for Flash Action Script 3 ?
But not just randomly generated, generated from the notes of a song. Or is that something I have to do manually?
How would I go about doing either of these?
I am currently following this tutorial: http://www.flashgametuts.com/tutorials/as3/how-to-make-a-rhythm-game-in-as3-part-4/ so perhaps it can be made to fit around this? (Go to the final part and View Source to see the full thing)
Thanks!
Depending on what you mean by rhythm game, check out the computeSpectrum() function of the SoundMixer class: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/SoundMixer.html#computeSpectrum()
There's an example of it working in the link, but basically what it does is take a snapshot of the current sound wave and puts normalised (-1 to 1) values in a ByteArray. What you do with those values is up to you - e.g. you might use them as a height field to generate terrain for example.
Repeat this every frame, and you get the gist
Welcome to SO!
First off, there is nothing already built in, to my knowledge. There may be something lurking around Google that someone else wrote, but you'd need to dig around for that (though I assume you already did.)
Generated from the notes of a song. Hmm, this will take some serious ingenuity and coding on your part. I'll point you in the right direction, but it is up to you to write the code. No one here will do it for you, but we'll happily help with specific problems in your code.
The crazy (yet potentially more fun) approach MAY BE to derive the data in a similar manner that an audio visualizer does...but I can't guarantee that will work. This would work best with MIDI-generated, single instrument songs. Here is a tutorial on visualizers.
A second approach may be to actually convert MIDI files directly. Again, I can't guarantee it will work, but it would theoretically be possible, seeing how MIDI files store data to begin with. Here's an answer on playing MIDI files, to get you started. Consider looking through their class.
However, the "easiest" approach would be to come up with some sort of system by which you store the note values for a song. You can manually enter the values in an array, or in a data file (such as XML) that you can load.
I put "easiest" in quotes because you'd have to account for a LOT of information - not just note values, but note duration, rhythm, and rests.
Anyway, those are just a few ideas to get you started. Good luck!

How to secure Flash Games from Cheat Engine?

Other questions didn't really have an answer. I'm making a singleplayer game that saves to a leaderboard, and I can't have the scores be 999999999999999999999999 from Cheat Engine. How do I secure my AS3 Flash Game so that Cheat Engine does nothing?
You can't. It's unavoidable. Abandon all hope. Your game is client-side and can be tampered with. The score is sent from the client which can be intercepted and changed before it is sent to the server. Anything you do to try encode the score will fail because your SWF can be decompiled and the algorithm reverse-engineered. Even if you put yourself through hell to obfuscate your SWF and the logic used to encode a decode a score, you will not prevail. All you can do is make it not worthwhile to cheat by maximising the difficulty of sending faux scores; make the criteria of a valid score strict and hard to determine e.g. a multiple of a given number minus x.
There are ways to make it very difficult, although as others have mentioned, it will never be completely secure.
Neopets, a popular site with flash games, combats this problem by sending extra information to the server. For example, in a game you might send to the server:
Time to complete level
Number of enemies killed
Number of items collected
Score
Then on the server, check if the values make sense. If they did not kill enough enemies, reject their score. If they completed the level too quickly, reject their score.
Bind your data to something dynamically changing like time. Because cheat engine does not have such option to trace time in data. Additionally if the trainer is programmed so professionally you can combine this method and other distraction methods together like multiplying the number into another dynamic data.

Analyze sound by channels in flash player 11

referring to my old question AS3: Analyzing sound spectrums one by one, one channel at once , with flash player 11 and using Sound.extract,is it possible to extract a single channel and manipulate/visualize it's spectrum?
I mean, if i mix 2 sounds into one file, can i control them separately, acting on thing like their soundwaves or volume?
With Sound.extract you get raw sound data at 44100 Hz Stereo, which actually means two "channels".
If you merge two sounds into one file and you want to process them individually you'll have to keep each one in its own channel, then you can programatically do anything you want with them in isolation.
Note that you cannot use SoundMixer.computeSpectrum() to create visualizations as it's not currently allowed to do so dynamically (see API docs), you'll have to process the raw sound data yourself.

html 5 games: can i secure the code somehow so the game itself won't be changed while playing?

As far as I know, it's really not possible, but I just want to be sure before I'm moving to flash.
can I make an html5 game secure enough so people won't be able to change their score and other variables while playing?
thanks!
There is no "depends", the straight answer to your question is "no" and I think my fellow answerers simply muddied the waters.
You cannot trust the client. With any language, whether you're writing assembly or HTML or Flash, you cannot trust the client. No matter how much you wrap your code in obfuscation and such, it can and will be figured out (and often quicker than you might think).
This is stressed everywhere and yet people keep getting bit by it. Online games get "speedhacked" because they don't check the velocity of players, or they get item duplication because they don't verify that a player actually has an item that they're trying to do something with, or the lame little flash games get hiscore entries of 9999999 because a simple tool like Tamper Data (a Firefox add-on) is all it takes to change the score as it's sent to the server.
You can't trust the client, whether HTML5 or Flash.
If it's a single-player game, let the player cheat. That is their decision. If it's a multiplayer game, the server verifies every step of the game and anything outside of the rules is thrown out. If it's hiscores, send a replay of the game to the server and analyze it for any cheating rather than sending just a numeric score.
since your users can see all the source code this is a rather complex problem.
they can easily change any function or variable at runtime without your script ever knowing.
even if use a complicated signing function to validate the results.
and i am sorry but i don't think colins way would work either. i could just change any input to make the server do whatever i want.
maybe a constant monitoring of the score thru the server would be able to detect any impossible changes. still someone cheating in the realms of "possible" results would be uncaught.
in the end i would say u can only make it rather difficult to cheat but not impossible for someone with a little bit of skill.
don't use it for any games where u can win something by scoring the highest.
since the matter seems rather puzzling to people:
flash delivers compiled swf files, that cannot (since flash 9) be decompiled to useful.smth
so u can put a secret in there which you use to sign the score.
i.e. send the score and the md5 of score+secretkey. so the server (which also knows the key, can check it).
furthermore flash variables are not so easy to temper with (you would have to find them in ram and alter them there, which is a very complex task), while javascript vars can be easily edited using, for example, webkit developer tools
update
actually i correct myself => all swfs can be decompiled
this just leaves us with code obfuscating and "encrypting"
i guess the world is a bad place after all ;)
Depends on the way your game is coded, but if all the logic is sent to the client and only the score returned then you have no hope. Only by returning the inputs and calulating the score on the server side can you try to prevent the users submitting any score they wish.
Don't forget, by definition the user must change their score or it could never be more than 0...
One Thought!!
You may use Knockout.js to modify your score and other variables as observable properties.
The steps are:
Create ViewModal for your game
Create observable properties for all the variables (i.e score)
You need to store the score in cache so that you can access it when new score arrives.
Attach custom subscriber to these properties and write logic to check the score should be updated by a "UNIT" at a time ( by unit I mean, how you suppose to update user's score at a time). The difference between the last score and current score should not go beyond the "UNIT"
update scroe as ViewModal.Score(newScore); //this would fire an event to the subscriber of observable property.!