6 ms·
Snake in a QR Code
- bovermyer 6y agoMight be interesting to print this on business cards and distribute at conventions or something like that.
- fyfy18 6y ago"Please run this binary from my business card". I guess it's easier than leaving USB drives in the parking lot...
- z3t4 6y agoYou could run it in a VM.
- pugworthy 6y agoYOU could perhaps, but your average target hasn't much of a clue what a VM is, let alone how to set one up. And keep in mind, malicious software is going to be challenging, and there are much more clever ways to use QR codes. E.g., imagine some store that has QR codes on the product aisles to access information on a product via a URL. I make a fake website that spoofs the legit product page, but offers the user a special "Buy online and save 25%" offer, which of course they are very tempted by due to the steep discount.
- jamesrascal 6y agoQR code’s support vCards as well. I use QR code that will pop up and ask you to add me to your contacts. All the data is stored in the QR code.
- zeepzeep 6y agoBoo, use NFC.
- orthecreedence 6y agoAnd we're back to punch cards. Full circle =]
- outadoc 6y agoToo bad virtually no one will flash it using a Windows device.
- brassattax 6y agoI was looking for the snake in the QR code itself (and found it!) before reading the article
- Antip0dean 6y agoI nearly started looking for it - thinking of the SIRDS images that were popular year ago - until I noticed the position markers. It's almost like we're trained in memes...
- codetrotter 6y agoWait, you found a snake? I am confused. Anyways, I too looked for it at first because I expected the game to be visually embedded in the QR code as well. I was a little disappointed that it was not the case. Imagine a game embedded in the QR code that when you load it, either directly is able to reconstruct the QR visual itself, so like some sort of quine https://en.m.wikipedia.org/wiki/Quine_(computing) https://en.m.wikipedia.org/wiki/Quine_(computing) but with the visual QR being considered the “source” kind of in this case and the thing bring output. Or weaker but still cool if the game uses the camera to load a QR and then you play on it.
- codetrotter 6y agoThinking about it a bit more it could be like the PICO-8 mentioned elsewhere ITT but instead of a PNG the QR fantasy console would work by loading programs from QR and initializing the display with the QR visual itself and then the code from the QR is exectuted and is able to access the “video memory” to read in the starting state and then you can play a game where you consume the QR visuals for example with snake. Probably needs to make the snake colored so that you can tell eatable QR visuals apart from your snake. Other games include Breakout and perhaps Pong. Frogger. Etc etc
- taylorconor 6y agoCould be a really fun variation on quinesnake: https://github.com/taylorconor/quinesnake https://github.com/taylorconor/quinesnake
- MStrehovsky 6y agoHere's another Snake game that can fit in a QR code, this one written in C#: https://twitter.com/MStrehovsky/status/1214955696556515331 https://twitter.com/MStrehovsky/status/1214955696556515331 (It doesn't need a .NET runtime; it's fully self-contained and runs on Windows as a native app.)
- rob74 6y agoCool, so all the 1k demos/intros from Assembly (https://archive.assembly.org/2019/1k-intro https://archive.assembly.org/2019/1k-intro) could also be distributed via QR code... the 4k intros unfortunately not. Maybe it's time for a new category ;)
- antihero 6y agoCould you plausibly make it a URL where the code in the URL is assembled and run using webassembly?
- codetrotter 6y agoThe point is to not rely on a server to host anything though. That the QR contains the data itself, not just a URL pointing to the data. Otherwise it is no different from any other QR code that has a URL in it.
- geofft 6y agoThe suggestion, I think, is to put the code in the URL itself, not use the URL as a pointer. You could probably use a data: URL to avoid needing a server at all, but if not, the server would just provide a launcher and not host the application code.
- codetrotter 6y agoIf the binary data is too big to fit in QR, then URL encoding is only going to require more bytes, and it will not fit either.
- boogies 6y ago> https://archive.assembly.org/2019/1k-intro https://archive.assembly.org/2019/1k-intro Had to add a security exception only to receive 404 Not Found nginx/1.18.0 :/
- 6y ago
- skrebbel 6y agoIf you want to see a variation of this concept in the wild, in active use by lots of people, check out PICO-8 cartidges. PICO-8 is a virtual game console. I.e. it's an emulator for an oldschool game console that doesn't exist in reality. It's designed to be easy to code for while maintaining the limits and aesthetics of old game computers PICO-8 games are, of course, distributed on cartridges. However because it's a virtual console, the cartridges are virtual too: they're PNG files. Try browsing PICO-8 games here: https://www.lexaloffle.com/bbs/?sub=2&cat=7 https://www.lexaloffle.com/bbs/?sub=2&cat=7 Press the play button the play a game right inside the web browser, but be sure to click the little "Cart" link right below the playing area to see what's going on. You'll see it open a little PNG file. That PNG file is the cartridge. It contains the entire game. The file format is explained here: https://pico-8.fandom.com/wiki/P8PNGFileFormat https://pico-8.fandom.com/wiki/P8PNGFileFormat. Obviously, because PICO-8 carts are purely digital, the format doesn't need any of the contrast, the error correction features or the orientation markers that QR-codes have. You can't take a picture of a cart with your phone and play it. You need the exact same, byte-for-byte PNG file. But it's still super cool.
- muxator 6y agoThis is the coolest thing in ages. The game's code is steganographically embedded in a PNG image containing the screenshot of the game! Wow
- read_if_gay_ 6y agoSteganography is cooler for sure, but can't PNGs already store arbitrary data in the header? IIRC, the game Spore did that so you can exchange creatures by sending images.
- nacs 6y agoI think the issue with that is that many image hosting sites optimize their images or at the least strip unnecessary data and EXIFs. So at any point while being copied from person to person, that game data could be lost.
- 6y ago
- inlined 6y agoAm I the only one unwilling to run a non-sandboxed process I found on a tech demo?
- athorax 6y agoespecially with the included disclaimer ...slightly larger than the executable shown in the video because I decided to add a little more functionality
- userbinator 6y agoAs the demoscene would say, "your loss". It's unfortunate that security hysteria has put such a damper on creativity. Besides, that binary is small enough that it would be far easier to analyse than the piles of other software you use every day.
- captn3m0 6y agoAm I the only one who thought this would be a game with the roaming around inside a QR code?
- strikelaserclaw 6y agonah, i also thought the same
- kevincox 6y agoI wish more QR-scanners supported data URLs. I think it would be very cool to distribute tiny web-apps via QR code.
- toyg 6y agoYeah, let’s make it even easier for people to run random executables that cannot be vetted, preferably on devices tightly coupled to their identities. What could go wrong?
- read_if_gay_ 6y agoSmartphones are locked down pretty tightly, so I'm not sure how much could actually go wrong compared to what can go wrong with regular apps anway.
- ant6n 6y agoWell regular apps are vetted.
- kevincox 6y agoIt's not "another way" it's just existing web technology but skipping the download step.
- saagarjha 6y agoSounds like https://developer.apple.com/documentation/app_clips https://developer.apple.com/documentation/app_clips except less proprietary, and smaller…
- fiatjaf 6y agoI'm still waiting for someone to make an app that encodes and decodes large data into multiple QR codes that are displayed in a moving sequence. That would be the best way to transfer files in physical locations.
- memco 6y agoApple has something like this for their new iOS device setup. I don’t think it’s to encode larger amounts of data, but for security they have this circle that constantly changes shape (see around 0:50 in this video for a demo: https://youtu.be/iE03ypWD5xs https://youtu.be/iE03ypWD5xs). I don’t know for sure how it works, but my first thought was a constantly changing QR-like code.
- xav0989 6y agoSomeone asked a very similar question on the apple stack exchange[1]. Apple also filed (at least) two patents on the technology[2][3]. [1]: https://apple.stackexchange.com/questions/301563/what-is-the-technology-used-in-ios-11-settings-migration-moving-blue-dots-par https://apple.stackexchange.com/questions/301563/what-is-the... [2]: http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=%2Fnetahtml%2FPTO%2Fsearch-adv.htm&r=2&p=1&f=G&l=50&d=PTXT&S1=(235%2F469.CCLS.%20AND%2020150505.PD.)&OS=ccl/235/469%20and%20isd/5/5/2015&RS=(CCL/235/469%20AND%20ISD/20150505) http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=H... [3]: http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=%2Fnetahtml%2FPTO%2Fsearch-adv.htm&r=1&p=1&f=G&l=50&d=PTXT&S1=(235%2F469.CCLS.%20AND%2020150505.PD.)&OS=ccl/235/469%20and%20isd/5/5/2015&RS=(CCL/235/469%20AND%20ISD/20150505) http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=H...
- rahimnathwani 6y agoThis would look similar to images produced by the Danmere Backer, a device which let you back up your files to a VHS tape.
- agumonkey 6y agoa new vector emerges
- jimkleiber 6y agoYou mean for viruses? Because that's what I was thinking
- devy 6y agoI was thinking about the same thing! Although the original QR code spec did allow binary payloads[1], smartphones and cameras weren't ubiquitous in mid 90s. But they are now. Transmitting computer virus or malware within the QR code binary payload might just be as easy as pointing your camera lens to the QR code. Since the QR code image is only machine readable not human readable, it would be indistinguishable, neither any digital signature to prevent it from being altered. [1]: https://en.wikipedia.org/wiki/QR_code#Storage https://en.wikipedia.org/wiki/QR_code#Storage
- gitgud 6y agoI wonder if snake could fit in a data uri, like this: https://bytex64.net/code/datasnake/ https://bytex64.net/code/datasnake/
- paulpauper 6y agothat is amazing
- squid_demon 6y agoDon't worry. There is no malicious code contained within this QR code!
- Shared404 6y agoThat's what I thought about as soon as I read this. Seems like a great malware installation vector. Just print out stickers and put them up at restaurants, stores...
- avree 6y agoFor which 99.99999% of users will be using mobile clients to scan the QR code that have no capability of executing the code...
- pugworthy 6y agoYes, embedding a Windows app is essentially pointless for mobile users, but there are many other delivery vectors available from QR codes. There are some interesting approaches listed at https://news.sophos.com/en-us/2019/10/17/beware-the-square-how-to-spot-malicious-qr-codes/ https://news.sophos.com/en-us/2019/10/17/beware-the-square-h...
- johnisgood 6y agoYet. :D
- 7373737373 6y agoI've been working on a virtual machine where this wouldn't be a problem: https://esolangs.org/wiki/RarVM#Jumping_processes https://esolangs.org/wiki/RarVM#Jumping_processes (small process snapshot sizes and sandboxing capabilities) Using the WebAssembly VM would be a good alternative for real applications.
- dheera 6y agoYeah I'd much prefer it be a javascript: URL that did all the magic in the browser. Much safer, cross platform, and it would probably work out of the box in existing QR reader apps.
- tgsovlerkhgsel 6y agoThe HTML5 version converted to a data URL would be a more accessible demo than a windows executable I think, especially if it supported mobile input. Unfortunately, scanning large QR codes doesn't seem to work too well in practice :(
- qwertox 6y agoInitially I was looking at the QR-code and thinking about punchcards, code golf and javascript, but reading that it contains a Windows executable was a surprise.
- aarondf 6y agoIf you want to play snake in Excel, you can do that too! https://aaronfrancis.com/2013/remaking-cellphone-snake-in-microsoft-excel https://aaronfrancis.com/2013/remaking-cellphone-snake-in-mi...
- ariasemi 6y agoReally cool! He also made a video about it: https://www.youtube.com/watch?v=ExwqNreocpg https://www.youtube.com/watch?v=ExwqNreocpg
- Taniwha 6y agoI crossed my eyes and stared for ages, still could not see the snake, I hate these magic eye things
- pxi 6y agoIt's a cool idea. Here's another one; a Mira fractal generator in SmallBASIC: https://smallbasic.github.io/images/screenshots/mira.bas.png https://smallbasic.github.io/images/screenshots/mira.bas.png