<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>OpenPunk</title><link>https://openpunk.com/</link><description>Recent content on OpenPunk</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><atom:link href="https://openpunk.com/index.xml" rel="self" type="application/rss+xml"/><item><title>Calculating the size of a subroutine is magic</title><link>https://openpunk.com/pages/subroutine-magic/</link><pubDate>Sat, 06 Jan 2024 00:00:00 +0000</pubDate><guid>https://openpunk.com/pages/subroutine-magic/</guid><description>If you&amp;rsquo;ve ever been involved in cheat development or reverse engineering you may have come across the problem of calculating the size of a subroutine dynamically; that is: while inside the target process&amp;rsquo;s address space, can we calculate the size of a given subroutine at address X? This is a problem that has plagued me for years and I&amp;rsquo;ve never been able to find a good solution to it, until now :D</description></item><item><title>Go's Regex Repetition limit is a little sad</title><link>https://openpunk.com/journal/go-detect-that-hash/</link><pubDate>Mon, 16 Oct 2023 00:00:00 +0000</pubDate><guid>https://openpunk.com/journal/go-detect-that-hash/</guid><description>Recently I&amp;rsquo;ve been working on a passion project with a friend, a simple hash detector but written in Go. We were porting a large list of regular expressions from a python-based project since redoing work is annoying and a fool&amp;rsquo;s errand. The project we were stealing regular expressions from was this one. We ran into a strange issue where the Go regex engine would panic when we tried to compile a regex with a repetition limit of 2048 with this ominous error message:</description></item><item><title>Star Wars Jedi Knight II: Jedi Outcast - Bypassing CD Checks for Fun with multiple approaches</title><link>https://openpunk.com/pages/sw-jk2-jo/</link><pubDate>Sat, 22 Jul 2023 00:00:00 +0000</pubDate><guid>https://openpunk.com/pages/sw-jk2-jo/</guid><description>Recently a friend of mine, dongresource, was struggling to get Star Wars Jedi Knight II: Jedi Outcast (this specific version) working over Wine/Linux. While chatting about this, we ended up collaboratively exploring all the different ways of getting the game to run that we could think of, for fun. Now I thought it&amp;rsquo;d be cool to document the resources we used and the (approximate) workflow we went through to have multiple different approaches to get the game working over Wine.</description></item><item><title>FusionFall Packet Protocol implementation in Go: Deserializing C# Structures</title><link>https://openpunk.com/journal/gopenfusion/</link><pubDate>Thu, 09 Mar 2023 00:00:00 +0000</pubDate><guid>https://openpunk.com/journal/gopenfusion/</guid><description>A couple weeks ago I got stuck on an idea. &amp;lsquo;What if FusionFall Packet Protocol, but in Go?&amp;rsquo; I naively thought this was an easy thing. Just define the structures in Go and copy the bytes to the structure, no biggie! Oh boy was I wrong. Not only is there no way to specify the pack alignment for structure members, it was also just downright wrong to assume that Go would let you write directly to structures without jumping through some hoops.</description></item><item><title>Insomnia Lake Views</title><link>https://openpunk.com/journal/insomnia-sunrise/</link><pubDate>Sun, 19 Feb 2023 00:00:00 +0000</pubDate><guid>https://openpunk.com/journal/insomnia-sunrise/</guid><description>I found myself up at 6am, unable to sleep, poking around google maps until I realized I lived quite close to a lake. Being 6am, I knew the sun would be rising in about an hour or so. Eager to get out of my apartment for a mini-adventure, I brewed myself some coffee and set out to Lake Ray Roberts to watch the sunrise.
This was my view:
The wind was fairly strong this morning, leading to some nice waves :)</description></item><item><title>Using pulseaudio to play sound effects over Discord voice chat</title><link>https://openpunk.com/journal/minimal-soundboard/</link><pubDate>Mon, 09 Jan 2023 00:00:00 +0000</pubDate><guid>https://openpunk.com/journal/minimal-soundboard/</guid><description>Title really says it all. I wanted something that &amp;lsquo;just works&amp;rsquo; and takes minimal setup and ideally uses packages and software I already had installed. I ended up writing a tiny bash script that takes one argument, a sound file to play. The script looks like:
#!/bin/bash AUDIO_SOURCE=$1 VIRTUAL_MIC=~/virtmic # sanity check the argument lol if test -z &amp;#34;$AUDIO_SOURCE&amp;#34; then echo &amp;#34;Usage: `basename &amp;#34;$0&amp;#34;` [audio file]&amp;#34; exit 1 fi # create and set the virtual audio device pactl load-module module-pipe-source source_name=virtmic file=$VIRTUAL_MIC format=s16le rate=16000 channels=1 pactl set-default-source virtmic # we sleep here to give discord a chance to switch over to the new audio device (this should be done automatically) echo &amp;#34;piping audio from $AUDIO_SOURCE&amp;#34; sleep 5 # pipe the audio ffmpeg -re -i $AUDIO_SOURCE -f s16le -ar 16000 -ac 1 - &amp;gt; $VIRTUAL_MIC # unload the audio device, pulseaudio will switch back over to the previous audio device (your mic :D) pactl unload-module module-pipe-source I moved the script to /usr/local/bin/virtual-mic</description></item><item><title>Productivity: lessons learned &amp; a 'how to be'</title><link>https://openpunk.com/journal/product/</link><pubDate>Wed, 21 Dec 2022 00:00:00 +0000</pubDate><guid>https://openpunk.com/journal/product/</guid><description>I wanted to start this off by saying that you&amp;rsquo;re worth more than your productivity. In today&amp;rsquo;s world, it&amp;rsquo;s easy to fall into the trap of thinking that your worth is directly tied to what you produce. After all, if you don&amp;rsquo;t produce and create, what value are you bringing into this world? You&amp;rsquo;re worth more than your work. I do believe that the way our social structures are setup really tends to reinforce this braindead idea that &amp;ldquo;productivity = value.</description></item><item><title>In-The-Wild: 'it's always a crypto miner!'</title><link>https://openpunk.com/pages/in-the-wild/</link><pubDate>Fri, 21 Oct 2022 00:00:00 +0000</pubDate><guid>https://openpunk.com/pages/in-the-wild/</guid><description>A couple months back I was watching a vinesauce stream (very funny btw) where Joel was searching the bowels of youtube for not-so-nice software to install. After watching, I thought it&amp;rsquo;d be fun to try and find some shitware of my own to take apart.
&amp;lsquo;The gutter&amp;rsquo; Seeing as I used to poke fun at roblox I thought I&amp;rsquo;d start by searching &amp;ldquo;roblox hack 2022 working&amp;rdquo; and -as per Joel&amp;rsquo;s instructions- sorted by Upload Date.</description></item><item><title>Stripping Lua 5.1 dumps</title><link>https://openpunk.com/journal/stripping-lua-protos/</link><pubDate>Sun, 04 Sep 2022 00:00:00 +0000</pubDate><guid>https://openpunk.com/journal/stripping-lua-protos/</guid><description>In my last blog post I talked about a simple Lua decompiler I made using my updated Lua 5.1 (de)serializer. I recently added support to re-serialize chunks back into Lua dumps (the equivalent of ldump.c). Using this, I wrote a tiny python script to strip debugging info from Lua 5.1 dumps automagically.
It looks like:
#!/usr/bin/env python3 &amp;#39;&amp;#39;&amp;#39; usage: lstrip [-h] -i FILE [-o FILE] Strips local and debugging information from Lua 5.</description></item><item><title>Uncomfortable growth</title><link>https://openpunk.com/journal/uncomfortable/</link><pubDate>Thu, 01 Sep 2022 00:00:00 +0000</pubDate><guid>https://openpunk.com/journal/uncomfortable/</guid><description>Over the past years I&amp;rsquo;ve grown. A little bit at a time, sometimes painstakingly, but I&amp;rsquo;ve grown nonetheless. This is my official disclaimer that I am just some nerd in your computer that writes a blog about software I think is cool. I am just a CompSci student and nothing on this site should be taken as fact. Do your own exploration! Correct me when I&amp;rsquo;m wrong!
Be uncomfortable If you ever find yourself in a comfortable spot in your journey, immediately stop what you&amp;rsquo;re doing.</description></item><item><title>LuaDecompy: Lua 5.1 Decompiler</title><link>https://openpunk.com/pages/luadecompy/</link><pubDate>Sat, 27 Aug 2022 00:00:00 +0000</pubDate><guid>https://openpunk.com/pages/luadecompy/</guid><description>Recently I struck an interest in decompilers because of a small passion project a friend of mine showed me. Gent&amp;rsquo;s project dealt with turning compiled DirectX shaders back into HLSL (High level shader language). His project (also written in python!) inspired me to write a decompiler of my own. I settled on writing a Lua 5.1 decompiler since I had already written a Lua 5.1 dump disassembler a couple years back (which needed some cleanup, but worked none-the-less).</description></item><item><title>Injecting DLLs at the start of a Windows process</title><link>https://openpunk.com/journal/preinject-dlls/</link><pubDate>Sat, 30 Jul 2022 00:00:00 +0000</pubDate><guid>https://openpunk.com/journal/preinject-dlls/</guid><description>Recently I faced a rather intimidating problem while working on a project. The problem was fairly simple from an objective point of view: &amp;ldquo;How do I load a DLL into a process on startup?&amp;rdquo; Now you might be wondering, &amp;ldquo;Why not just patch the IAT (import address table) on the executable and force it to load your payload DLL??&amp;rdquo; Yes! That was my exact thoughts too, however for reasons I&amp;rsquo;ll explain it wasn&amp;rsquo;t that simple.</description></item><item><title>Analytics without Big Brother</title><link>https://openpunk.com/journal/goaccess/</link><pubDate>Thu, 16 Jun 2022 00:00:00 +0000</pubDate><guid>https://openpunk.com/journal/goaccess/</guid><description>In an effort to be more transparent on the very little information I collect from my readers, I&amp;rsquo;ve written this post to share the info I do use (literally the default log files from Nginx.)
Recently I shared my &amp;ldquo;Cracking 22 year-old DRM&amp;rdquo; post on Reddit. I don&amp;rsquo;t use Reddit very often but every now and then I&amp;rsquo;ll lurk r/ReverseEngineering since it&amp;rsquo;s usually full of pretty interesting posts. Anyways, after noticing a couple people had responded to the post, I was curious how many people actually read that post.</description></item><item><title>Cracking 22 year old DRM: Pac-Man Adventures in Time</title><link>https://openpunk.com/pages/cracking-22-yr-old-drm/</link><pubDate>Mon, 06 Jun 2022 00:00:00 +0000</pubDate><guid>https://openpunk.com/pages/cracking-22-yr-old-drm/</guid><description>EDIT: Others have pointed out that the term &amp;ldquo;DRM&amp;rdquo; isn&amp;rsquo;t exactly period accurate to this software. While what the game does is arguably a less sophisticated DRM implementation, it would have been called &amp;lsquo;CD Check&amp;rsquo; or something similar at the time. The difference is negligable and both approaches accomplish the same goal, prevent pirated copies for the duration of sale.
Pac-Man: Adventures in Time is a game from the year 2000.</description></item><item><title>Switching to Ansible &amp; minor workflow changes</title><link>https://openpunk.com/journal/switch-to-ansible/</link><pubDate>Wed, 01 Jun 2022 00:00:00 +0000</pubDate><guid>https://openpunk.com/journal/switch-to-ansible/</guid><description>Ansible if you hadn&amp;rsquo;t heard, is IaC&amp;rsquo;s (Infrastructure as Code) most loved obsession. Supported by RedHat, it allows deployment and management of servers in a sustainable and easy package through things called &amp;lsquo;Playbooks.&amp;rsquo; These playbooks are written in YAML and specify actions to setup/maintain a server. Of course I didn&amp;rsquo;t need to use Ansible, but after writing one for the OpenPunk VPS I can confidently say that yes, you don&amp;rsquo;t need it.</description></item><item><title>Self-Critique: How to improve through positive criticism</title><link>https://openpunk.com/journal/self-critique/</link><pubDate>Wed, 25 May 2022 00:00:00 +0000</pubDate><guid>https://openpunk.com/journal/self-critique/</guid><description>I burn through a lot of projects. Some last for several months to half a year, and others for a couple days. I can say confidently that after each project (most of them left unfinished) I&amp;rsquo;ve improved as a developer. Each project I&amp;rsquo;ve done has taught me something. Either I learned a better way of designing something, or I learned how not to do something. Yes, this can seem pretty obvious and self-congratulatory, but the alternative is to feel that you&amp;rsquo;ve wasted days to months of your life working on something that had no value.</description></item><item><title>Laika: Obfuscation in Modern C</title><link>https://openpunk.com/pages/obfuscation-in-c/</link><pubDate>Sat, 21 May 2022 00:00:00 +0000</pubDate><guid>https://openpunk.com/pages/obfuscation-in-c/</guid><description>Recently I&amp;rsquo;ve been working on a small passion project I&amp;rsquo;ve been wanting to do for a while. Laika is a malware written in modern C. I recently added some cool obfuscation features to the LaikaBot target. Let&amp;rsquo;s take a look at how it works.
Rough Idea I&amp;rsquo;m sure you&amp;rsquo;ve seen this before, malware authors love to obfuscate strings using various techniques, among those are the classic xor obfuscation. I hesitate to call it &amp;rsquo;encryption&amp;rsquo; given it&amp;rsquo;s numerous pitfalls, however it&amp;rsquo;s extremely simple to implement so I&amp;rsquo;ll be focusing on this one technique.</description></item><item><title>Try/Catch in Modern C</title><link>https://openpunk.com/journal/error-handling/</link><pubDate>Thu, 05 May 2022 00:00:00 +0000</pubDate><guid>https://openpunk.com/journal/error-handling/</guid><description>Error handling in C has always been a pain. Most small projects have a simple return based error handling solution. For example,
#include &amp;lt;stdlib.h&amp;gt; #include &amp;lt;stdio.h&amp;gt; #include &amp;lt;stdbool.h&amp;gt; bool isEven(int i) { return i % 2 == 0; } int main() { int x = 3; if (!isEven(x)) { printf(&amp;#34;[ERROR]: %d is not even!\n&amp;#34;, x); return EXIT_FAILURE; } return EXIT_SUCCESS; } Our &amp;rsquo;error&amp;rsquo; in this case is that our variable x is odd.</description></item><item><title>Self-love and Self-discipline</title><link>https://openpunk.com/journal/selflove/</link><pubDate>Thu, 31 Mar 2022 00:00:00 +0000</pubDate><guid>https://openpunk.com/journal/selflove/</guid><description>This journal entry is my way of being more open and honest with myself. I&amp;rsquo;ve recently been focusing more on my mental health and trying to improve myself through honest self reflection. This is me being honest.
Self-love If you&amp;rsquo;re like me at all somedays you really cannot tell a difference between self-love and self-hate. An interesting thought exercise is to make a list of honest thoughts about yourself. This can seem a bit cringy at first but hey, no one is looking.</description></item><item><title>Burnout, self-care and being productive</title><link>https://openpunk.com/journal/burnout/</link><pubDate>Mon, 10 Jan 2022 00:00:00 +0000</pubDate><guid>https://openpunk.com/journal/burnout/</guid><description>While I will be talking specifically about software development, the methods and self-care from my experiences should be fairly universal especially if you&amp;rsquo;re working for yourself. I&amp;rsquo;ve been programming since I was 11 years old, my first language was Lua. Since I started at a relatively young age it was never &amp;lsquo;work&amp;rsquo; for me, It was more like a fun hobby with which I could express myself and create things (mostly games).</description></item><item><title>Why journal?</title><link>https://openpunk.com/journal/why-journal/</link><pubDate>Sun, 09 Jan 2022 00:00:00 +0000</pubDate><guid>https://openpunk.com/journal/why-journal/</guid><description>I&amp;rsquo;ve come to the conclusion that I enjoy writing. Sad part is that I don&amp;rsquo;t always have a clean presentable project to write a roughly 1000 word essay over. Thats where this journal comes in! Think of these as &amp;lsquo;mini-blog&amp;rsquo; posts, short and sweet. I&amp;rsquo;m not going to try to make these as presentable as my blog posts, aka &amp;ldquo;I&amp;rsquo;m lazy and would like to write about small projects or opinions that wouldn&amp;rsquo;t fit into a whole post.</description></item><item><title>Dead Man's Hugo Post</title><link>https://openpunk.com/pages/dead-mans-hugo/</link><pubDate>Sat, 04 Sep 2021 00:00:00 +0000</pubDate><guid>https://openpunk.com/pages/dead-mans-hugo/</guid><description>You&amp;rsquo;re going to die Okay&amp;hellip; maybe not right now but who knows? It&amp;rsquo;s unavoidable. No matter what diet you try or whether you know Rust™ or not, eventually the curtains will close and your show will end. Preparing for one&amp;rsquo;s death might seem like a jinx, but the truth is anything could happen. It&amp;rsquo;s sure gonna suck when you die getting mugged tomorrow, so let&amp;rsquo;s make it suck less. In honor of this Halloween season I would like to cheat death and create a dead man&amp;rsquo;s hugo post; specifically a hugo post that would be posted 2 weeks or so after my death.</description></item><item><title>Cosmo: Adding the '__equal' metamethod and profiling the results</title><link>https://openpunk.com/pages/cosmo-workflow/</link><pubDate>Thu, 18 Feb 2021 00:00:00 +0000</pubDate><guid>https://openpunk.com/pages/cosmo-workflow/</guid><description>I&amp;rsquo;ve been spending a lot of time recently on my own scripting language called &amp;ldquo;Cosmo.&amp;rdquo; Cosmo is an easily embeddable scripting language loosely based off of Lua. It&amp;rsquo;s definitely a student project though so don&amp;rsquo;t get your hopes up. While this does smash python in benchmarks its not quite as fast as Lua, let alone Lua-JIT. Anyways, in this post I wanted to walk through my rough workflow for working on Cosmo.</description></item><item><title>Screaming Bridge</title><link>https://openpunk.com/journal/screaming-bridge/</link><pubDate>Mon, 18 Jan 2021 00:00:00 +0000</pubDate><guid>https://openpunk.com/journal/screaming-bridge/</guid><description>I&amp;rsquo;ve heard stories about the haunted &amp;lsquo;Screaming Bridge&amp;rsquo; since I was an elementary kid from the older kids in my neighborhood. Always some embellished story about encounters with the paranormal, which of course I innocently believed. Wanting to experience the supernatural myself, I poked around reddit and other places looking for directions on how to get there. Learning of a simple 20ish minute hiking trail that leads directly up to the old bridge, I was determined to get there and asked my sister to come with.</description></item><item><title>Reversing a packet protocol: The FusionFall protocol</title><link>https://openpunk.com/pages/fusionfall-openfusion/</link><pubDate>Tue, 27 Oct 2020 00:00:00 +0000</pubDate><guid>https://openpunk.com/pages/fusionfall-openfusion/</guid><description>If you remember my old site before I switched to a static site, I wrote a couple of posts about FusionFall Retro. Unfortunately, that project has since been shutdown. A couple of months ago in the spirit of FFR (and because it got brought up in conversation) I started to become curious about how they actually made the server. This kick started my journey into the depths of the FusionFall client.</description></item><item><title>Buffer Overflow: Favorite Color CTF</title><link>https://openpunk.com/pages/bufferoverflow-fav-color-ctf/</link><pubDate>Mon, 09 Dec 2019 00:00:00 +0000</pubDate><guid>https://openpunk.com/pages/bufferoverflow-fav-color-ctf/</guid><description>Hey! So I recently made an account on ctflearn.com which is this great site that teaches you how to do CTFs and gives you practice ones you can use to learn! I&amp;rsquo;ve always wanted to try out a CTF, so I quickly found a fairly simple one in the binary section and tried it out. I picked one with a lot of solves because I am a complete noob haha. Let&amp;rsquo;s take a look!</description></item><item><title>Making a Lua Bytecode parser in Python</title><link>https://openpunk.com/pages/lua-bytecode-parser/</link><pubDate>Sun, 15 Sep 2019 00:00:00 +0000</pubDate><guid>https://openpunk.com/pages/lua-bytecode-parser/</guid><description>So recently I&amp;rsquo;ve been getting back into Lua, my first scripting language. I&amp;rsquo;ve already done a series about manipulating the LuaVM, (which you can read here) but this time I was interested in the LuaVM bytecode, specifically the Lua 5.1 bytecode. If you don&amp;rsquo;t know what bytecode is or even how Lua works, here&amp;rsquo;s a basic rundown:
LuaC is the Lua Compiler. Its job is to turn our human readable script into Lua Bytecode ready to be executed by the LVM (LuaVM) This bytecode is everything the LVM needs to run!</description></item><item><title>Manipulating Embedded Lua VMs: Executing Scripts</title><link>https://openpunk.com/pages/manipulating-lua-vms-3/</link><pubDate>Sat, 24 Aug 2019 00:00:00 +0000</pubDate><guid>https://openpunk.com/pages/manipulating-lua-vms-3/</guid><description>Now that we know how to find addresses of the lua C API in our client and how to capture a valid lua state, we can write our &amp;ldquo;exploit&amp;rdquo;. Let&amp;rsquo;s start with recapping what our end-goal is: We want to be able to run scripts that weren&amp;rsquo;t originally in our game. To do this, we&amp;rsquo;ve found where the Lua VM C API is, and even hooked lua_gettop to capture a valid lua state.</description></item><item><title>Manipulating Embedded Lua VMs: Hooking lua_gettop</title><link>https://openpunk.com/pages/manipulating-lua-vms-2/</link><pubDate>Fri, 23 Aug 2019 00:00:00 +0000</pubDate><guid>https://openpunk.com/pages/manipulating-lua-vms-2/</guid><description>Last post we talked about why games use the Lua VM and how to find some key functions. The Lua VM runs everything based on a state. This state is basically the key to the kingdom, without a valid state with their custom API and environment on it, we really can’t do anything. Well that&amp;rsquo;s great and all, but how exactly are we going to get a valid Lua State??? How convenient of a question!</description></item><item><title>Manipulating Embedded Lua VMs: The ROBLOX Client</title><link>https://openpunk.com/pages/manipulating-lua-vms-1/</link><pubDate>Thu, 22 Aug 2019 00:00:00 +0000</pubDate><guid>https://openpunk.com/pages/manipulating-lua-vms-1/</guid><description>NOTE: 2022 Dec 1st &amp;ndash; Roblox has changed a LOT even since I wrote this article. For example they&amp;rsquo;ve completely rewritten their lua implementation, not to mention I haven&amp;rsquo;t touched the current client in a while. Take the info in this with a grain of salt.
Many games today rely on scripting languages and an internal API to interface with the game engine itself. One of the popular scripting languages used is the Lua language.</description></item></channel></rss>