Downloading from git hub

Just got my arduboy and freakin love this micro game system :slight_smile: but I’m to this open source game creation coding community #noob :frowning: . anyway is it safe to download from github and does github scan the game files for viruses? Sorry lol I just wanted to know because when anything is free on the internet there is always a risk of getting hacked.

No, it doesn’t scan for viruses. GitHub is designed to host code for all different kinds of games and systems. To scan for viruses would be incredibly hard because of what people use GitHub for.

With that being said, GitHub is actually very safe.

The reason I say that is because the code for games are hosted to it and not the actual compiled game files. This means that before you download and install anything, you can actually see all the code that’s in it. If a virus was hiding in there, people would be able to spot it fairly quickly.

Not only that, but the way that sharing code works from GitHub, you’re not actually downloading any files other than text and maybe some images from time to time. You can copy/paste right from their website into the Arduino IDE. Doing that, you’ll never have to worry about downloading anything other than the actual games’ code. :slight_smile:

1 Like

Well, that would require that someone actually read the code. Of course some of us do that, but often people just download and compile without looking at the code. Not that it’s a real problem though.

However, it is possible to include code in an Arduboy sketch that could permanently damage an Arduboy. This could be by mistake or maliciously.

For example:

Each EEPROM location is specified to accept a minimum of 100000 writes but after that it may not save the correct value. The actual maximum times that a given location can be written before it will start failing is unspecified, but it’s likely no more than twice the specified value, so lets say it’s 200000 times.

If I add
EEPROM.write(10, 0);
somewhere in the main loop of a sketch that runs at 60 frames per second, it will only take about an hour of running the sketch to write to EEPROM address 10 over 200000 times, likely permanently damaging that location.

P.S. A hint for programmers:
Using EEPROM.update() instead of EEPROM.write() can help prevent this kind of mistake from causing damage, if it turns out the same value is always being written. In general, I doubt there would ever be a case in an Arduboy sketch where EEPROM.write() should be used instead of EEPROM.update().

How slow that would be? Just curious.

How slow would what be?

Right, missed that you really didn’t say how it would be done. I meant killing the flash on purpose. Writing like 200 000 times to a cell. Even if it was just one cell. I think a write to EEPROM takes some time.

According the the Arduino documentation “An EEPROM write takes 3.3 ms to complete”. If we generously make that 5ms to allow for executing a loop, you could do 200000 EEPROM writes to a single location in about 17 minutes.

1 Like