The friendly neighbourhood volcano, and embarking upon a CLR executable metadata jungle expedition Rangi Roots Carrying on from the last post , let’s look at reading the data from a Windows .exe or .dll file that has been compiled by a CLI tool (ilasm, F#, C#, etc). The intention of this reader portion is that it will eventually be called at phase level 1 in the macro expander, so it had…
Flat is a project from way back in 2019. The idea was to build a .NET language in Racket, surfacing the Racket macro system alongside a .NET runtime. (sorry for the rubbish picture, the scaling killed it) Intro Flat, like Hackett , implements a type system in the Racket macro expander . The code it emits does so over the FSharp.Core primitives ( FSharpFastFunc , OptimizedClosures , FSharpList ,…
Today we look at another crackme, SabloomText_v6! The difficulty is rated at level 4.8 of 6 - I think perhaps it was more like a 4. I am not going to say anything about it in this section as it would spoil a cool surprise if you want to try it yourself! Here is the link if you want to try it Sabloom Text 6 Tools used today are x64dbg, PEStudio, F# and C++ (Apologies for the low quality pictures, I…
In this post we’ll look at another crackme, Bakunawa! This one was listed as level 5 (Very Hard) and certainly was not without its difficulties! Featuring a sort-of virtual machine executing real x86 instructions encoded into an odd binary file as a point of obsfucation, this took me quite a long time to figure out. I built some tools in the process and finally a Keygen program once the…
In this post we’ll look at the design of a function generator that outputs slope waveforms with adjustable rise and fall times. This can be used in modular synthesis as an envelope , or control voltage to modulate some other parameter in your synthesiser. This post is purely electronics with no CPUs allowed on the scene. For all the circuits and fragments in this post, I have linked to…
In this article we’ll look at another crackme. This one was pretty difficult and has a bunch of cool stuff in it, including the injection and execution of obfsucated code into another process. Crackme The crackme in question is this one , so stop reading now if you want to give it a go yourself! The crackme asks you to find the serial and / or patch the program. Initial analysis shows a C++…
In a previous article I described the process of reverse-engineering a crackme . These are programs designed to be broken with various counter-mesaures and challenges. As a break from my hardware work, I thought I would have a go at another one. Crackme The crackme in question is this one , the newest available on the site at the time. If you want to give it a go, you should stop reading since…
Multiplexers and demultiplexers are common tools in digital logic design. In Verilog, they are fairly simple to create whilst the amount of signals are small. In this post we’ll look at how Fairylog’s macros can make short work of generating mux/demux of any complexity, greatly reducing the amount of work and scope for hard-to-find bugs MUX A mutliplexer in its most basic form takes in…
Over the last few months I have been working on yet another new language, this time for programming FPGAs. This post will provide a short introduction to Fairylog by way of building some custom hardware to read a pair of Nintendo pads. Realtime 24bit colour rotozoomer controlled by a NES pad. CPU, video hardware and assembler built in my various @racketlang langs. Display from @adafruit . Debugger…
In this post I will describe a small electronics project designed to enable the remote programming of a real Commodore 64 that is switched on and running. To achieve this, several parts are involed, utilising some custom circuitry and communications protocol, a Raspberry Pi, a C program, a 6502 assembler program and a little F# program to finish it off. Introduction Programming the C64 is a lot of…
In this post we will see how asi64’s ( Racket’s ) macro system can massively reduce the amount of 6502 assembly code you have to write, beyond what a typical macro assembler can achieve. State Machines I am currently writing my first little game for the C64. In it, the player’s sprite has fairly complex movement behaviour which is represented by a state machine that has no less…
In this post we will see how asi64 is more than your average macro assembler, by combining arbitrary disk io, functional programming techniques and code generation alongside your typical 6502 assembly code. The aim is to create a very simple sprite animation viewer, that writes the resulting C64 program by interleaving file parsing and machine code generation. Here’s the program displaying…
This post describes a memory allocation strategy I call a “fixed” size memory pool. Recently I decided to re-write my virtual machine Drey almost completely in the C programming language, using no external libraries except for the networking via ZeroMQ. This is mostly for fun, to see if I can remember how to program in C again and write a load of low-level stuff (apologies if my C is…
As an entertaining start to the new year, this post will cover the basics of reverse engineering a program and breaking its password protection. Of course, I do not advocate software piracy in any way, and the program in question is called a crackme which is a program designed to broken, with various measures to make it harder for you. They come in different levels of difficulty, the one under the…
The previous post layed the foundations of creating a language and “compiler” using Racket macros. This is all very nice, but utimately it is just a bunch of macros. The “language” itself doesn’t have any form of enforced semantics. You can introduce whatever syntax and macros you want, and use them however you like, even if it makes no sense at all. Whilst this is…
This post will be about Racket macros . As a delivery mechanism, I will be using bits of my latest project, which is a virtual machine designed for emulating multiplayer networked board games via ZeroMQ . drey-vm executes compiled bytecode files - much like the CLR or JVM - using an instruction set of my design. The design of the computer is out of the scope of this post (maybe another post if…
In my last few posts, I detailed some of my experience learning 6502 assembler for the Commodore 64. I started off using DASM , which seems to be quite a nice assembler, severely lacking in documentation. Then I discovered the very awesome KickAssembler , which includes a full blown scripting language on top of java, lots of other very nice features, and great documentation. This made me realise…
In the last post we discovered how to decode 15-bit symmetric invaders into a chacrater set. This time around we will make them fractal! The invaders from the last post occupy exactly one character each. The aim is to now select an invader at random, and then draw it one size bigger, using other random invaders as its “pixels” like this Then, the process can be repeated again, drawing…
I have recently been getting into programming the Commodore 64. It’s lots of fun to work in such a restricted environment, where you have to use various hardware tricks to achieve your goals. Every machine cycle and byte of memory counts! I have not programmed in 6502 assembler or the C64 before. I am using the popular C64 emulator WinVice and an assembler called DASM . Having messed around…
A LONG TIME AGO, IN A GALAXY FAR AWAY….. Having infiltrated the Empire’s data centre, you are not overly surprised to discover they are using some ancient system from the old republic days. A brief look around reveals a monstrous legacy Empire Enterprise system. It has a ORM you thought had died out millennia ago. You can immediately see no less than 13 layers of inheritance, 6 levels of…