Skip to content

Instantly share code, notes, and snippets.

View mrexodia's full-sized avatar
🍍

Duncan Ogilvie mrexodia

🍍
View GitHub Profile
@HACKE-RC
HACKE-RC / calling_conventions.md
Created June 9, 2023 15:26
Notes on calling convention

Common calling conventions

  • cdecl
  • fastcall
  • stdcall

CDECL calling convention.

cdecl stands for "C declaration", it is used by most c compiler in the x86 architecture.

Arguments passing in cdecl calling convention

@kconner
kconner / macOS Internals.md
Last active August 1, 2025 02:17
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@eth-p
eth-p / README.md
Created March 9, 2023 08:39
Steam Deck: Always Sudo Scripts

A list of scripts for my Steam Deck that I want to always run as root.

This README describes the files necessary to set up always-sudo scripts. Any other file in this gist is one of the scripts.

/etc/sudoers/x99-always-sudo-scripts

Makes /bin/sudo /root/ALWAYS_SUDO_SCRIPTS/run work for the deck user, without a password prompt.

⚠️ Safety Considerations: ⚠️
This allows that specific "executable" file (bash script) to be run as root without a password prompt.

@T00fy
T00fy / ffxiv-patcher.sh
Created February 4, 2023 02:18
Adapted from a powershell script to install FFXIV patches with XIVLauncher
#!/bin/bash
#------------------------------------------------------------------
# FINAL FANTASY XIV - A Realm Reborn Makeshift Patcher
# Applies locally stored patches to the game. Requires you to
# install the base game from a physical disk.
#------------------------------------------------------------------
# --- Configuration -------------------------------------------------
# Directory containing the XIVLauncher.PatchInstaller.exe
@SeanPesce
SeanPesce / ghidra_concat.h
Last active April 24, 2025 02:25
Ghidra CONCAT Implementations
// Author: Sean Pesce
//
// Manual implementations of the CONCAT operations produced by the Ghidra decompiler.
// These definitions are helpful for compiling re-implementations of native code using
// decompiler output (e.g., with gcc).
//
// Note that these implementations would be outperformed by minimal C preprocessor macros
// that replicate the same logic.
@mmozeiko
mmozeiko / !README.md
Last active July 31, 2025 16:15
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for native desktop app development.

Run py.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK - currently v14.40.33807 and v10.0.26100.0.

You can list available versions with py.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe first run setup_TARGET.bat - after that PATH/INCLUDE/LIB env variables will be updated to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

@edygert
edygert / AMSIScriptContentRetrieval.ps1
Created April 21, 2022 19:25 — forked from mattifestation/AMSIScriptContentRetrieval.ps1
PoC code used to demonstrate extracting script contents using the AMSI ETW provider
# Script author: Matt Graeber (@mattifestation)
# logman start AMSITrace -p Microsoft-Antimalware-Scan-Interface Event1 -o AMSITrace.etl -ets
# Do your malicious things here that would be logged by AMSI
# logman stop AMSITrace -ets
$OSArchProperty = Get-CimInstance -ClassName Win32_OperatingSystem -Property OSArchitecture
$OSArch = $OSArchProperty.OSArchitecture
$OSPointerSize = 32
if ($OSArch -eq '64-bit') { $OSPointerSize = 64 }
@alexander-hanel
alexander-hanel / README.md
Last active June 5, 2025 14:55
intro to opaque predicates notes

opaque predicates

In computer programming, an opaque predicate is a predicate—an expression that evaluates to either "true" or "false"—for which the outcome is known by the programmer a priori, but which, for a variety of reasons, still needs to be evaluated at run time

Source

Opaque predicates appears to have been first used by Christian Collberg & Clark Thomborson back in 1997 source. The technique is discussed in their paper A Taxonomy of Obfuscating Transformations.

Notes from A Taxonomy of Obfuscating Transformations

@ek0
ek0 / test_x86.cc
Last active February 1, 2023 22:20
Various functions to test different lifting/disassembly/decompilation from static analysis tools.
// adder.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <cstdint>
#include <intrin.h>
//#include <mmintrin.h>
//#include <emmintrin.h>
uint64_t add(uint64_t a, uint64_t b)
@kensykora
kensykora / FFXIV-Automatic-OTP-Entry.md
Last active May 26, 2025 17:34
How to enable automatic OTP entry in FFXIV

How to enable automatic OTP Entry in FFXIV

Animation

This process will allow you to create a shortcut on your desktop that will enable automatic entry of your OTP code into FFXIV without having to open up the authenticator each time you log in.

It uses FFXIV QuickLauncher for doing its work.

Background