Skip to content

Instantly share code, notes, and snippets.

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

Krayfaus krayfaus

🌼
Overthinking modular design
View GitHub Profile
@cshenton
cshenton / d3d11_speedtest.c
Last active March 25, 2024 01:04
Seeing how fast a d3d11 swapchain can go.
#include <assert.h>
#include <stdio.h>
#include <time.h>
#define COBJMACROS
#include <windows.h>
#include <d3d11_1.h>
#include <d3dcompiler.h>
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
@kamilogorek
kamilogorek / _screenshot.md
Last active April 9, 2024 21:18
Clutter-free VS Code Setup
image

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
@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

@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
@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'
@gingerBill
gingerBill / d3d11_in_odin.odin
Last active March 22, 2024 22:53
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
@HimDek
HimDek / Install Android apps or apk files in Windows using Windows Subsystem for Android (No Emulator).md
Last active April 24, 2024 06:15
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:

@juanbrujo
juanbrujo / PlayStationBIOSFilesNAEUJP.md
Last active April 25, 2024 05:07
Files for PlayStation BIOS Files NA-EU-JP
// Simple example code to load a Wav file and play it with WASAPI
// This is NOT complete Wav loading code. It is a barebones example
// that makes a lot of assumptions, see the assert() calls for details
//
// References:
// http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html
// Handmade Hero Day 138: Loading WAV Files
#include <windows.h>