<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[SquallyGame - Medium]]></title>
        <description><![CDATA[A Game To Teach Game Hacking https://squallygame.com - Medium]]></description>
        <link>https://medium.com/squallygame?source=rss----f6907284511b---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>SquallyGame - Medium</title>
            <link>https://medium.com/squallygame?source=rss----f6907284511b---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 05:18:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/squallygame" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[We Open Sourced Our Steam Game, and Why It Was a Good Idea]]></title>
            <link>https://medium.com/squallygame/we-open-sourced-our-steam-game-and-why-it-was-a-good-idea-2d5ac72c9802?source=rss----f6907284511b---4</link>
            <guid isPermaLink="false">https://medium.com/p/2d5ac72c9802</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[Zachary Canann]]></dc:creator>
            <pubDate>Mon, 19 Aug 2019 01:48:15 GMT</pubDate>
            <atom:updated>2020-12-30T23:42:25.589Z</atom:updated>
            <content:encoded><![CDATA[<h3>We Open Sourced Our Steam Game</h3><p>The game we’re developing is <a href="https://github.com/Squalr/Squally">Squally, a 2D Platformer RPG that teaches assembly language</a>. This game is cross-platform, and is written entirely in C++ using an engine called cocos2d-x.</p><p>We’ve been working on it for over a year now, and today it’s going open source. This is an extremely rare move in game development — after all, why would you give away years of hard work?</p><p>It’s not as crazy as it sounds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LcI_SBwouX323HWRVIgqUg.png" /><figcaption>Squally — our 2D Platformer RPG</figcaption></figure><p>The open source community seems to be thriving everywhere except video games. This is particularly tragic, because game development would benefit from this more than most fields.</p><p>Are most first-person shooters really so different that they should be written from scratch every time? Sure each game has its own unique feel, but the amount of redundant code written by game developers is staggering. Game engines have eased some of this pain, but still the wheel has been reinvented thousands of times.</p><p>If we could have forked somebody else’s game, it would have been a huge time saver. In fact, if somebody let us build on their game for $20,000, it would have been worth it. That’s how much money it would have saved us— and that’s not even accounting for lost time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Bj5g6Q1iN4w0DuGJteKTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iYC2jWAZOSKl_VaR_ixYaQ.png" /><figcaption>Squally gameplay: writing x64 assembly to attack an opponent</figcaption></figure><h3>Goodbye revenue?</h3><p>On the surface, open sourcing a video game looks like a seppuku ritual in which a company is gutted of all future profits. This does not have to be the case. Open source does not necessarily compromise any revenue streams in a single player game.</p><p>People buy games on Steam, and almost nowhere else. Steam has a firm monopoly on game distribution.</p><p>Will a user really care if the source code is available? The average user probably doesn’t even know what source code is, nor would they care to sift through a readme file in an attempt to compile your game.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YCTPDGvNZPPQQnMYDMbW9Q.png" /></figure><p>There are other things you can do to protect yourself too. Only the code in Squally will be open sourced. To get the art and sound, the user will need to copy it from a legally purchased game. This is for two reasons:</p><ol><li>Some of the art in Squally comes from asset stores (non-exclusive rights), so we couldn’t release the art publicly even if we wanted to.</li><li>This helps mitigate any potential revenue loss.</li></ol><h3>But what about piracy?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kej1CGlnuX73pQwSrbS5ww.png" /><figcaption>Arrrr pirates!</figcaption></figure><p>Squally’s audience is literally hackers. Piracy was destined to happen. But let’s pretend this wasn’t the case. Even for normal games, piracy is common-place. Piraters gonna pirate.</p><p>Piracy rates will probably go up, but my guess is that if anything, sales from the increased community will make up for it.</p><h3>Downsides?</h3><p>The worst that can happen is that the art in your game is swapped out and re-released by someone else, with no code changes. If this is a concern, be sure to pick a repository license that makes sense for your game.</p><p>If for whatever reason open sourcing the game backfires, you can always close-source it later. Sure, whatever you released will always be public forever, but if the game is early enough in development, it’s not a huge deal.</p><h3>Upsides!</h3><p>Looking at other open source games like <a href="https://github.com/miki151/keeperrl">KeeperRL</a>, there can be some amazing upsides. Users creating mods and additional content, or helping fix weird niche bugs that only happen on certain machines.</p><p>Also, if you google around for open source games, the results are pathetic. This is an area where you can really win the SEO game.</p><p>Last but not least, there are the intangible, second order effects. Maybe you inspire somebody to learn how to program, or save them significant time on their journey to making a game. We’re excited to see what people do with Squally!</p><p>Looking for additional learning resources on game hacking? Check out content from our partner <a href="https://guidedhacking.com/">Guided Hacking</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d5ac72c9802" width="1" height="1" alt=""><hr><p><a href="https://medium.com/squallygame/we-open-sourced-our-steam-game-and-why-it-was-a-good-idea-2d5ac72c9802">We Open Sourced Our Steam Game, and Why It Was a Good Idea</a> was originally published in <a href="https://medium.com/squallygame">SquallyGame</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn Binary and Hex with this Gwent-Inspired Card Game]]></title>
            <link>https://medium.com/squallygame/learn-binary-and-hex-with-this-gwent-inspired-card-game-5e2c7a27a507?source=rss----f6907284511b---4</link>
            <guid isPermaLink="false">https://medium.com/p/5e2c7a27a507</guid>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[card-game]]></category>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[education]]></category>
            <dc:creator><![CDATA[Zachary Canann]]></dc:creator>
            <pubDate>Mon, 03 Sep 2018 06:44:21 GMT</pubDate>
            <atom:updated>2018-09-03T07:16:07.948Z</atom:updated>
            <content:encoded><![CDATA[<p>Every year new programmers sign up for their classes hoping to learn how to build the next big mobile app, but instead are forced to re-learn counting numbers. The catch? Instead of counting to 10, they have to count to 2 and 16. And it’s <strong>hard</strong>. For many students, it feels like a nightmare where they are stuck in kindergarten, and somehow they have a failing grade.</p><p>Just like the first time in algebra class when your teacher had to explain that ‘x’ could be any number, eventually it just clicks. My co-founder Matt and I are working on <a href="https://squallygame.com/">Squally, a game to teach hacking</a>, but before you can walk, you have to learn to crawl. This means that we have to also teach binary and hexadecimal. This game follows a strict ‘no lectures’ policy. Instead, we teach these concepts in the coolest way possible: with a trading card game.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DefrkjrixSd_7P4zXcTClw.jpeg" /><figcaption>Hexus, a card game inspired by Gwent to teach binary and hex</figcaption></figure><p>In school, students learn conversion formulas, they memorize charts, and have no reward for their efforts other than a grade on a piece of paper. We want to change this. The great thing about a card game is that you can learn the effect first, and learn the reasoning and math later. Initially, it’s all about winning.</p><p>Your enemy has a lot of strong cards? Play the logical shift right card and cut their attack in half.</p><p>Have a binary card with0111 attack? Play a card to “flip the 4th bit”, and it will become a LOT stronger.</p><p>Learn that a hex card with C attack is the same as a decimal card with12 attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1KotiZpmh3Mdc12GtA_Ymw.png" /><figcaption>A list of some of the special cards in Hexus</figcaption></figure><p>In the context of a classroom, this stuff is mind-numbingly boring. In the context of a card game, it’s awesome. To avoid overwhelming players, cards are introduced gradually. Play through the game and collect cards by beating other NPC players, find them in chests, or get them from defeating deadly opponents in combat. Squally is still a modern game — Hexus is only a tiny piece of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FFpNwJ9JcVAuRqkfb2LNYg.png" /><figcaption>Squally isn’t just for education — it’s entertaining, and has everything you’d expect from a modern game</figcaption></figure><p>Squally is not released quite yet, but it’s in active development. We were accepted to the adviser track of YCombinator’s Startup School of 2018, and we’re doing everything we can to move quickly and make this an amazing game.</p><p>For those who are interested, you can <a href="https://squallygame.com/">sign up for our beta</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jHDl1ZVj4jTEvY7J3RXnIw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e2c7a27a507" width="1" height="1" alt=""><hr><p><a href="https://medium.com/squallygame/learn-binary-and-hex-with-this-gwent-inspired-card-game-5e2c7a27a507">Learn Binary and Hex with this Gwent-Inspired Card Game</a> was originally published in <a href="https://medium.com/squallygame">SquallyGame</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Wrote a Self-Hacking Game in C++]]></title>
            <link>https://medium.com/squallygame/how-we-wrote-a-self-hacking-game-in-c-d8b9f97bfa99?source=rss----f6907284511b---4</link>
            <guid isPermaLink="false">https://medium.com/p/d8b9f97bfa99</guid>
            <category><![CDATA[assembly]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[cplusplus]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Zachary Canann]]></dc:creator>
            <pubDate>Fri, 31 Aug 2018 03:43:05 GMT</pubDate>
            <atom:updated>2020-12-30T23:42:51.520Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve been hard at work on <a href="https://steamcommunity.com/app/770200">Squally, a game in C++ to teach hacking</a>. However, this creates a small problem: If we want to publish the game on Steam, then we can’t force people to download hacking tools first. Our solution? Put the tools inside the game, and let the game hack itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ac12Q8olUSXpwKgUDO31pA.jpeg" /></figure><p>This had another unintended consequence. If the game hacks itself, then we need some low-level control over the game — and for that, we need a low-level language. C# and Unity were no longer an option, so we had to start looking at some C++ options.</p><p>We narrowed it down to two options. The first option we considered was Unreal Engine. Unfortunately, this engine is not very great for 2D games. Also, Unreal takes 5% of game revenues, which does not make sense if it does not add value. For these reasons, we settled on a lesser known engine called Cocos2d-x.</p><p>To emulate real hacking tools, there are only two things that we needed. First, a disassembler for converting the raw machine code into human-readable x86 assembly (or at least hacker-readable). The second thing we need is an assembler to do the opposite.</p><p>With these two tools, we effectively have a game that can read and write its own code. We just have to tell the game exactly where to look, which we will explore later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iYC2jWAZOSKl_VaR_ixYaQ.png" /><figcaption>Reversing a healing spell in Squally, by changing `inc` to `dec`.</figcaption></figure><p>Of course by letting users rewrite the code in assembly, the user can easily crash this game! But as any hacker knows, crashing things is just part of the job.</p><p>However, there are some cool ways to mitigate this. One option is to save the state of the program (registers/stack) before the hackable region of code, and restore it after it executes to prevent silly mistakes.</p><p>For those who like to live a bit more dangerously, there are <a href="https://github.com/phoeagon/libfuckit">libraries for ignoring segfaults and other errors</a>, which is pretty frightening. This is no match for a simple jmp 0x00000000, but it may be good start for easing some of the inevitable frustration of an aspiring assembly programmer.</p><p>Now for the nitty gritty details. A completed sample project is located here: <a href="https://github.com/Squalr/SelfHackingApp">https://github.com/Squalr/SelfHackingApp</a></p><p>To accomplish our goal, we leverage three libraries:<br>AsmTK + AsmJit for assembling: <a href="https://github.com/asmjit/asmtk">https://github.com/asmjit/asmtk</a>+ <a href="https://github.com/asmjit/asmjit">https://github.com/asmjit/asmjit</a><br>UDIS86, a disassembler: <a href="https://github.com/vmt/udis86">https://github.com/vmt/udis86</a></p><p>One might expect the steps are as follows:</p><ol><li>Find instruction(s) we wish to edit</li><li>Disassemble them into x86/x64 assembly instructions, as strings.</li><li>Modify those strings, and assemble them back into raw bytes.</li><li>Write those bytes back to memory, overwriting the original instructions</li></ol><p>This seems reasonable, except when we try it… the program crashes.</p><p>Upon digging deeper, it turns out that the <a href="https://en.wikipedia.org/wiki/Memory_protection">protections for the page of memory</a> that contain the code is marked as Execute only. It needs to be readable and writable. In Windows, this can be done using the VirtualProtect function in windows.h . In Unix, this is done via mprotect.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c15bf20974c01a9b6456f7dd75e7f6fa/href">https://medium.com/media/c15bf20974c01a9b6456f7dd75e7f6fa/href</a></iframe><p>The next problem we need to solve is finding code we want to be able to assemble and disassemble. To solve this, we place markers around sections we want to be hackable, as done below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3973e22b639eb48f9a121b354ec19211/href">https://medium.com/media/3973e22b639eb48f9a121b354ec19211/href</a></iframe><p>The important features here are the HACKABLE_CODE_BEGIN() and HACKABLE_CODE_END() blocks. These emit a small sequence of useless x86 instructions.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fbbf0ca2c7eb7dff59e4d05f53c35537/href">https://medium.com/media/fbbf0ca2c7eb7dff59e4d05f53c35537/href</a></iframe><p>Once we have these markers in place, we can grab a pointer to this function, and search for the markers! Everything in between these markers must be the code we want the user to be able to change.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dbd7908059040d6ae4a0c2f66804baf1/href">https://medium.com/media/dbd7908059040d6ae4a0c2f66804baf1/href</a></iframe><p>For those interested in the implementation details of parsing, see theHackableCode class in the sample project.</p><p>Now that all technical problems are solved, we simply glue it all together! Below, we have created a function called hackableRoutineTakeDamage(). Notice the line health -= damage . This is the instruction we are going to self-modify.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f54f49db07959ee66272c52653280445/href">https://medium.com/media/f54f49db07959ee66272c52653280445/href</a></iframe><p>In the runExampleHealth() function, we extract the hackable segments, and then patch the code with hackableCode-&gt;applyCustomCode(&quot;nop&quot;) .</p><p>As you might be able to guess, the second time we call hackableRoutineTakeDamage() , no health is subtracted! The health -= damage line has been effectively removed by self modifying code!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9bf44e22e9814a77f5d872f4829d65ed/href">https://medium.com/media/9bf44e22e9814a77f5d872f4829d65ed/href</a></iframe><p>For those with a background in assembly, you may have noticed that 1 nop is far less bytes than the original instructions. The remaining bytes are filled with nop instructions automatically behind the scenes.</p><p>Hopefully you learned something, and if you’re interested in following our progress on our game, you can check out <a href="https://steamcommunity.com/app/770200">Squally</a> on Steam!</p><p>Looking for additional learning resources on game hacking? Check out content from our partner <a href="https://guidedhacking.com/">Guided Hacking</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8b9f97bfa99" width="1" height="1" alt=""><hr><p><a href="https://medium.com/squallygame/how-we-wrote-a-self-hacking-game-in-c-d8b9f97bfa99">How We Wrote a Self-Hacking Game in C++</a> was originally published in <a href="https://medium.com/squallygame">SquallyGame</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>