Inside mShield: Red Teaming and Memory Protection in Zarion2
By: Ondrej Igar, CEO & Lead Developer, Alofok s.r.o.
Category: Cybersecurity, Game Development, Game Security
Zarion2 is an original MMORPG being developed from the ground up. Its client, gameplay systems, and security features are built as part of our own project, with the goal of creating a distinct gaming experience rather than relying on an existing game framework for its core identity.
The game is still in development, and keeping the experience fair takes ongoing work. A client-side anti-cheat can appear to work perfectly during normal gameplay and still fail when someone starts tampering with the running process. That is why we test our own mShield protection in a controlled environment, using scenarios based on techniques associated with cheat software. We look for weaknesses in our own checks so we can address them before they affect players.
Why we test our own client
Our custom C++ client, zarion2.exe, is developed specifically for Zarion2 and must withstand different forms of manipulation. We would rather discover potential weaknesses ourselves than wait for someone outside the team to find them first.
Our testing includes examining how our own client works, running controlled attack simulations, and checking process memory. We test mShield separately from the live game and look for gaps in code protection, memory integrity checks, and unusual-behavior detection. The goal is to identify and fix these issues before they reach players.
What we test
Memory changes and code modification
We simulate attempts to change protected memory in the zarion2.exe process, including unauthorized code injection and changes to important game functions. These tests help us check mShield's client-side protection in Block C. In particular, we verify whether it compares code stored in memory against trusted reference hashes verified using cryptographic methods and maintained by the server.
DLL spoofing and injection
DLL hijacking can interfere with application startup or the loading of individual modules. Our controlled tests include modified libraries, such as version.dll, placed in the game directory. This helps us check how mShield verifies loaded modules and uses salted hashes when recording security events.
Python environment integrity
Zarion2 uses an embedded Python environment for its user interface and parts of its client-side logic. We test whether the PyCode_New execution gateway can be bypassed through unauthorized script injection and whether the signed lists of permitted code in mshield_py.bin can be changed. These tests help us verify that our code-signing and script-checking mechanisms work as intended.
Combat and skill system
We use automated testing agents, including our internal tool ZrTester, to simulate invalid combat actions, rapid changes in game state, and attempts to alter gameplay parameters. Some scenarios involve values such as SKILL_RANGE and FORUM_BOW_FAR. The results help us assess how well the server detects unusual gameplay through the checks implemented in Blocks A and B.
Authorization and scope
All reverse engineering, attack simulations, and memory manipulation described here are authorized internal tests. They take place in a controlled environment and target only software, game clients, and server infrastructure owned and operated by Alofok s.r.o., a company based in the Czech Republic.
The purpose is to find potential weaknesses, check that our security measures work as intended, and improve the overall resilience of Zarion2 as development continues.
A continuing process
Zarion2 is being built from the ground up, and its security evolves alongside the game itself. There is no single test that can guarantee lasting protection, so mShield must be reviewed and tested as new features are added and existing systems change.
By sharing some of this work, we want to give players a clearer picture of how we approach game security and the effort that goes into protecting the integrity of Zarion2.
mShield v praxi: Testování zabezpečení a ochrana paměti v Zarion2
Autor: Ondrej Igar, CEO & Lead Developer, Alofok s.r.o.
Kategorie: Kybernetická bezpečnost, vývoj her, zabezpečení her
Zarion2 je vlastní MMORPG projekt, který vyvíjíme od úplných základů. Herní klient, herní systémy i bezpečnostní prvky vznikají jako součást našeho vlastního řešení. Naším cílem je vytvořit osobitou hru s vlastním technickým zázemím, herními mechanismy a způsobem zabezpečení.
Vývoj stále pokračuje a udržet férové herní prostředí vyžaduje průběžnou práci. Klientský anti-cheat může při běžném hraní fungovat bez problémů, ale selhat ve chvíli, kdy někdo začne zasahovat do běžícího procesu hry. Proto vlastní ochranu mShield testujeme i sami, a to v kontrolovaném prostředí a na scénářích vycházejících z technik používaných cheatovacími programy. Hledáme slabá místa ve vlastních kontrolách, abychom je mohli opravit dříve, než se projeví u hráčů.
Proč testujeme vlastní klient
Náš herní klient v C++ (zarion2.exe) vzniká přímo pro Zarion2 a musí odolat různým pokusům o manipulaci. Potenciální slabiny chceme odhalit sami, místo abychom čekali, až na ně narazí někdo zvenčí.
Testování zahrnuje kontrolu fungování vlastního klienta, řízené simulace útoků a prověřování paměti běžícího procesu. mShield testujeme odděleně od běžného provozu hry a hledáme nedostatky v ochraně kódu, kontrole integrity paměti a rozpoznávání neobvyklého chování. Cílem je tyto problémy odhalit a vyřešit ještě předtím, než se dostanou k hráčům.
Na co se v testech zaměřujeme
Změny paměti a úpravy kódu
Simulujeme pokusy o změnu chráněných oblastí paměti procesu zarion2.exe, včetně neoprávněného vkládání kódu a úprav důležitých herních funkcí. Tím ověřujeme klientskou ochranu mShieldu v Bloku C. Zaměřujeme se především na to, zda dokáže porovnávat kód uložený v paměti s důvěryhodnými referenčními hashi, jejichž správnost je ověřována kryptografickými metodami a které uchovává server.
Podvržení a vkládání DLL knihoven
DLL hijacking může narušit spuštění aplikace nebo načítání jednotlivých modulů. V rámci kontrolovaných testů proto pracujeme i s upravenými knihovnami, například version.dll, umístěnými v adresáři hry. Ověřujeme tak, jak mShield kontroluje načítané moduly a jak využívá solené hashe při zaznamenávání bezpečnostních událostí.
Zabezpečení prostředí Pythonu
Zarion2 využívá integrované prostředí Pythonu pro uživatelské rozhraní a část logiky na straně klienta. V testech prověřujeme, zda lze obejít spouštěcí bránu PyCode_New pomocí neoprávněného vložení skriptu a zda je možné upravit podepsané seznamy povoleného kódu v souboru mshield_py.bin. Díky tomu ověřujeme, zda naše mechanismy pro podepisování a kontrolu skriptů fungují podle očekávání.
Soubojový systém a herní schopnosti
Pomocí automatizovaných testovacích agentů, včetně našeho interního nástroje ZrTester, simulujeme neplatné bojové akce, rychlé změny herního stavu a pokusy o úpravu herních parametrů. Některé scénáře pracují s hodnotami, jako jsou SKILL_RANGE a FORUM_BOW_FAR. Výsledky nám pomáhají vyhodnocovat, jak dobře server rozpoznává neobvyklé herní chování pomocí kontrol zavedených v rámci Bloků A a B.
Autorizace a rozsah testování
Veškeré reverzní inženýrství, simulace útoků a zásahy do paměti popsané v tomto článku představují povolené interní testování. Probíhají v kontrolovaném prostředí a týkají se výhradně softwaru, herních klientů a serverové infrastruktury, které vlastní a provozuje Alofok s.r.o., česká společnost.
Cílem je hledat případné slabiny, ověřovat správnou funkčnost bezpečnostních opatření a průběžně zvyšovat odolnost Zarion2 během jeho vývoje.
Průběžná práce na zabezpečení
Zarion2 vzniká od základů a jeho zabezpečení se vyvíjí společně s celou hrou. Jednorázové testování nemůže zajistit trvalou ochranu, proto mShield průběžně prověřujeme při přidávání nových funkcí i při úpravách stávajících systémů.
Sdílením části této práce chceme hráčům přiblížit, jak k zabezpečení hry přistupujeme a kolik úsilí věnujeme ochraně férového hraní a integrity Zarion2.