Skip to content

Instantly share code, notes, and snippets.

View krayfaus's full-sized avatar
🌼
Overthinking modular design

Italo Oliveira krayfaus

🌼
Overthinking modular design
View GitHub Profile
@topherPedersen
topherPedersen / nestenum.ts
Created June 7, 2021 15:37
Nested "Enums" in TypeScript
enum Foo {
A = "ActivityCode.Foo.A",
B = "ActivityCode.Foo.B",
C = "ActivityCode.Foo.C",
}
enum Bar {
A = "ActivityCode.Bar.A",
B = "ActivityCode.Bar.B",
C = "ActivityCode.Bar.C",
@crosstyan
crosstyan / komorebic.ahk
Last active May 23, 2025 14:48
komorebic.ahk for AutoHotkey v2
#SingleInstance Force
WorkspaceNumber := 9
ArrayFromZero(Length){
temp := []
Loop Length {
temp.Push(A_Index-1)
}
return temp
@HimDek
HimDek / Install Android apps or apk files in Windows using Windows Subsystem for Android (No Emulator).md
Last active November 2, 2025 16:51
This Guide will show you how to install and run apk files or Android apps in any Edition of Windows 11 using Windows Subsystem for Android. WSA or Windows Subsystem for Android is a Tool that allows Windows to run Android Apps directly without using any emulator.

Install Android apps or apk files in Windows using Windows Subsystem for Android

WSA or Windows Subsystem for Android is a Tool that allows Windows to run Android Apps directly without using any emulator. The problem is Windows Subsystem for Android is currently only available through preview via the Beta Channel of the Windows Insider Program. But if you follow my guide, you don't have to be in Windows Insider Program to try it out. The only thing you need is Windows 11 installed and some patience.

Prerequisites:

  • Windows Subsystem for Android or WSA must be Installed.

Click here to view the guide that shows how to install Windows Subsystem for Android in any Edition of Windows 11 (including Windows 11 Home) non Inider or stable release.

How to Install Android Apps or apk files in Windows Subsystem for Android:

@sebfisch
sebfisch / exploring-function-calls-in-roc.md
Last active July 12, 2024 17:55
Exploring function calls in Roc

Exploring function calls in Roc

This is a systematic in-depth exploration of different ways of calling functions in Roc.

Lambda expressions and function calls

In Roc, functions are values that are defined using lambda-expressions. Here are two single-argument functions on integers, one that increments a given number and another that doubles it.

inc : I64 -> I64
@krzys-h
krzys-h / Hyper-V GPU-PV with Linux guest.md
Last active November 3, 2025 01:10
Ubuntu 21.04 VM with GPU acceleration under Hyper-V...?

Ubuntu 21.04 VM with GPU acceleration under Hyper-V...?

Modern versions of Windows support GPU paravirtualization in Hyper-V with normal consumer graphics cards. This is used e.g. for graphics acceleration in Windows Sandbox, as well as WSLg. In some cases, it may be useful to create a normal VM with GPU acceleration using this feature, but this is not officially supported. People already figured out how to do it with Windows guests though, so why not do the same with Linux? It should be easy given that WSLg is open source and reasonably well documented, right?

Well... not quite. I managed to get it to run... but not well.

How to do it?

  1. Verify driver support
@gingerBill
gingerBill / d3d11_in_odin.odin
Last active July 28, 2025 05:35
D3D11 in Odin
package d3d11_main
import D3D11 "vendor:directx/d3d11"
import DXGI "vendor:directx/dxgi"
import D3D "vendor:directx/d3d_compiler"
import SDL "vendor:sdl2"
import glm "core:math/linalg/glsl"
// Based off https://gist.github.com/d7samurai/261c69490cce0620d0bfc93003cd1052
@typeswitch-dev
typeswitch-dev / minimal.asm
Created September 2, 2022 17:07
Minimal win64 executable in NASM assembly.
org 0 ; We use "org 0" so Relative Virtual Addresses (RVAs) are easy.
; This means that when we want an absolute Virtual Address we have
; to add IMAGE_BASE to the RVA (or whatever the base of that section is)
IMAGE_BASE equ 0x400000
SECT_ALIGN equ 0x200
FILE_ALIGN equ 0x200
msdos_header:
.magic db 'MZ'
@typeswitch-dev
typeswitch-dev / minimal-elf64.asm
Created September 3, 2022 00:24
Minimal Linux x86-64 program written in NASM assembly
bits 64
org 0x4000000
elf_header:
.size equ .end - $
.e_ident db 0x7F, 'E', 'L', 'F' ; EI_MAG0 ... EI_MAG3
db 2 ; EI_CLASS: 1 => 32 bits, 2 => 64 bits
db 1 ; EI_DATA: 1 => lil endian, 2 => big "
db 1 ; EI_VERSION: original version
db 0 ; EI_OSABI: 0 => System V ABI
@edhebi
edhebi / rust_modules.md
Created September 28, 2022 10:01
Rust modules guide

Rust modules and how to use them

So, how tf do rust modules work? and why tf are they not doing what I want right now???

Note: A bunch of things in here are defined by cargo and a few others by rust. I won't generally care about that distinction because two languages without standard build system is more than enough for my sanity.

➡️ Feel free to ask me on twitter if you have questions or remarks.

Core concepts

On offsets

After the recent release of ps5-kstuff with support for PS4 fpkg files, there is a lot of questions about porting this to other firmwares (4.50 and 4.51 are important in particular, because users of those firmwares can't update to 4.03, but they are still vulnerable to all of the used exploits). The main problem with these ports it the bespoke XOM, which prevents finding the offsets by simply examining the dumps. So in this document I'm going to go over what offsets are important for ps5-kstuff, and how I found them for 4.03.

These are the main categories of offsets:

  1. Kernel data offsets, those can be found from data dumps that are not XOM-protected
  2. Kernel text offsets pointed to by kernel data
  3. doreti_iret offset (that's one offset, but it deserves its own word)
  4. Offsets found from single-stepping of kernel functions