michal-z
Beacon Object File (BOF) library and command line tool written in Zig
bof-launcher is an open-source library for loading, relocating and launching BOFs on Windows and UNIX/Linux systems. It's an alternative to Trustedsec's COFFLoader and ELFLoader with some very interesting features:
* Fully compatibile with Cobalt Strike's Beacon. Can compile and run every BOF available at Cobalt Strike Community Kit and every other open-source BOF that adheres to generic BOF template.
* Distributed as a fully standalone library with zero dependency (it does not even use libc).
* Fully integrable with programs written in C/C++ and/or Zig progamming languages.
* Adds capability to write BOFs in Zig programming language - which is a low-level langauge with a goal of being a "better C". All the features of the language and rich standard library can be used in BOFs (hash maps and other data structures, cross-platform OS layer, http, networking, threading, crypto and more).
* Asynchronous BOF execution - capability to launch more time-consuming BOFs in a separate thread.
* BOF process injection - capability to launch more risky BOFs (i.e. privilege escalation exploits) by injecting it to a new process.
* Seamless support for both Windows COFF and UNIX/Linux ELF formats.
* ARM and AARCH64 support on Linux.
* Used in our cli4bofs tool that allows for running BOF files directly from a filesystem.
* Very flexible and efficient API allowing for so called BOF chaining.
zig-gamedev project provides Win32/D3D12 API bindings that can be used on Windows and Linux.
Wine with VKD3D-Proton provides robust solution for emulating Windows runtime.
Above components combined together gives very nice development environment for building DirectX 12 applications on Windows and Linux.
Project homepage: https://github.com/michal-z/zig-gamedev
Minimal DirectX 12 application that can be developed on Windows and Linux: https://github.com/michal-z/zig-gamedev/tree/main/samples/mi...
This works by capturing render output to a transient buffer and then playing it back at human-discernable speed.
Fast, multi-platform, SIMD math library in Zig
Zig-gamedev project: DirectX 12 Mesh Shader benchmark
Mesh Shader emulating VS (no culling): ~26.8 ms
VS with manual vertex fetching (no HW index buffer): ~50.2 ms
VS with fixed function vertex fetching: ~24.8 ms
When drawing 200M triangles on RX 6800: Mesh Shader emulating VS (no culling): ~23.6 ms
VS with manual vertex fetching (no HW index buffer): ~13.5 ms
VS with fixed function vertex fetching: ~12.4 msZig-gamedev project – alternative env for low-level game programmers
Zig gamedev project home: https://github.com/michal-z/zig-gamedev
New physics demo: https://github.com/michal-z/zig-gamedev/tree/main/samples/bu...
Prebuilt binaries for all demos: https://github.com/michal-z/zig-gamedev/releases/download/v0...
Zig gamedev project v0.2.0 – physics support
In my case, simplicity is the key for productivity.
Before making my decision to go with Zig I've built small game in UE5 (https://michalziulek.itch.io/upacman). I've also used UE5 and Unity at AMD. I simply don't like those engines.
Different people have different approaches and mindsets. I'm much faster building my small, minimal codebase that does only what I need. Also, I'm improving my low-level programming skills and experimenting, doing things differently than most people (not using Unity) might lead to very original game.
WebGPU is just 3D rendering. I will also need vector graphics, machine learning stuff, video playback, etc. Windows gives me that for "free" (DirectML, Direct3D 12 Video, Direct2D, DirectWrite).
My main goal is to ship a game and build interesting demos/mini-games as part of zig-gamedev project. I don't want to spend my time supporting and maintaining code for several platforms.
Also, using wrappers like WebGPU adds another layer of abstractions. I want to write my shaders in HLSL using dxc.exe, I want to directly see messages from DX debug layer and have full control over my code. WebGPU would just slow me down.
My game will run only on Windows 10+ and I'm fine with that.
> Why not Unity or UE5? Why Zig?
I'm building relatively small game, I don't really need full game engine. I try to write simple code that does only what I really need. I want to push Zig forward, I want to promote it. I was working with UE5 and Unity at AMD - those engines are really huge, bloated and they are changing very fast. I want to keep control over my code. Again, I don't need 90% of their features. I like low-level stuff and I want to master my skill.
> Why zig-gamedev project?
I want to help others learning Zig. I want to create demos, audio-visual experiments and even some art stuff. I'm interested in intersection of art and science. I want to prototype and experiment with ideas that potentially will be used in game (tech, algorithms, etc.).
> Why Windows and DX12?
DX12 is really well supported by Microsoft. They have great tools. They have interop with Direct2D and DirectWrite. They have DirectML (built on top of DX12). Windows itself has builtin decoders for most video formats (I will need this and I don't want to include entire ffmpeg).
I'm most familiar with DX12. DX12 is a bit less verbose than Vulkan.
I don't have a bandwidth to care about other platforms. Focusing only on Windows lets me write simpler and often more optimized code.
Also, drivers are really mature and stable.
> Why to take risk?
I was working for big corporations for ~12 years now. Money is good but you don't really realize your ideas there. You don't own what you build. Now, I want to create my own stuff, my way, using my ideas. Money will come later.