text
stringlengths
92
5.09M
pkgname=vulkan-icd-loader pkgver=1.3.269 desc="vulkan loader" deps="musl" fetch() { curl -L "https://github.com/KhronosGroup/Vulkan-Loader/archive/v$pkgver.tar.gz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz mv Vulkan-Loader-$pkgver $pkgname-$pkgver mkdir $pkgname-$pkgver/build } build() { cd $pkg...
pkgname=libevdev pkgver=1.13.3 mkdeps="samurai:muon:pkgconf:python" fetch() { curl "https://www.freedesktop.org/software/libevdev/libevdev-$pkgver.tar.xz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz mkdir $pkgname-$pkgver/build } build() { cd $pkgname-$pkgver muon setup \ -Dbuildtype=release \ ...
pkgname=vulkan-tools pkgver=1.3.261.1 deps="musl" desc="Vulkan tools" fetch() { curl -L "https://github.com/KhronosGroup/Vulkan-Tools/archive/refs/tags/sdk-$pkgver.tar.gz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz mv Vulkan-Tools-sdk-$pkgver $pkgname-$pkgver mkdir $pkgname-$pkgver/build } build()...
pkgver=2.4.122 pkgname=libdrm # mkdeps="muon:samurai:pkgconf:python" # mkdeps="muon:pkgconf" deps="musl" desc="Userspace interface to kernel DRM services" bad="" fetch() { curl -L "https://dri.freedesktop.org/libdrm/libdrm-$pkgver.tar.xz" -o $pkgname-$pkgver.tar.gz tar -xf $pkgname-$pkgver.tar.gz cd $pkgname-$pkgve...
/* * Copyright © 2014-2018 Broadcom * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish...
pkgname=mesa pkgver=23.0.3 #pkgver=main mkdeps="python:python-mako:samurai" deps="musl:wayland:wayland-protocols:llvm:zlib-ng:expat:libffi:libdrm:glslang" ext=dev fetch() { curl "https://archive.mesa3d.org/$pkgname-$pkgver.tar.xz" -o $pkgname-$pkgver.tar.gz # curl "https://gitlab.freedesktop.org/mesa/mesa/-/archive/m...
pkgname=sway pkgver=1.8 deps="musl:pkgconf:wayland:json-c:pcre2:wlroots:pango:xkeyboard-config" fetch() { curl -L "https://github.com/swaywm/sway/releases/download/$pkgver/sway-$pkgver.tar.gz" -o $pkgname-$pkgver.tar.gz # curl -L "https://github.com/swaywm/sway/archive/refs/heads/master.tar.gz" -o $pkgname-$pkgver.t...
pkgname=foot pkgver=1.13.1 fetch() { curl -L "https://codeberg.org/dnkl/foot/archive/$pkgver.tar.gz" -o $pkgname-$pkgver.tar.gz curl -L "https://codeberg.org/dnkl/fcft/archive/3.1.4.tar.gz" -o fcft.tar.gz curl -L "https://codeberg.org/dnkl/tllist/archive/1.1.0.tar.gz" -o tllist.tar.gz tar -xf $pkgname-$pkgver.tar....
pkgname=libxkbcommon pkgver=1.5.0 deps="libdrm:libxkbcommon" fetch() { curl -L "https://github.com/xkbcommon/libxkbcommon/archive/xkbcommon-1.0.3.tar.gz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz mv $pkgname-xkbcommon-$pkgver $pkgname-$pkgver mkdir $pkgname-$pkgver/build } build() { cd $pkgname-...
pkgname=ribidi pkgver=main fetch() { curl -L "https://github.com/iglunix/ribidi/archive/refs/heads/main.tar.gz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz } build() { cd $pkgname-$pkgver cargo build --release --all-features } package() { cd $pkgname-$pkgver install -Dm755 target/release/lib$pkg...
pkgname=wayland pkgver=1.22.0 mkdeps=muon:samurai:pkgconf:python deps=libffi:expat fetch() { curl -L "https://gitlab.freedesktop.org/wayland/wayland/-/releases/$pkgver/downloads/wayland-$pkgver.tar.xz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz mkdir $pkgname-$pkgver/build } build() { cd $pkgname-...
pkgname=glslang pkgver=master fetch() { curl -L "https://github.com/KhronosGroup/glslang/archive/refs/heads/master.tar.gz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz mkdir $pkgname-$pkgver/build } build() { cd $pkgname-$pkgver cd build cmake -G Ninja ../ \ -DCMAKE_BUILD_TYPE=Release \ -DCMAK...
pkgname=firefox pkgver=116.0 mkdeps="cbindgen:rust" _clear_vendor_checksums() { sed -i 's/\("files":{\)[^}]*/\1/' third_party/rust/$1/.cargo-checksum.json } fetch() { #curl "https://ftp.mozilla.org/pub/firefox/releases/${pkgver}esr/source/firefox-${pkgver}esr.source.tar.xz" -o $pkgname-$pkgver.tar.xz #curl "https:...
pkgname=wlroots pkgver=0.16.1 deps="libdrm:libxkbcommon:libudev-zero:pixman:mesa:libglvnd:vulkan-headers:vulkan-icd-loader:hwdata:libinput:seatd" fetch() { curl -L "https://gitlab.freedesktop.org/wlroots/wlroots/-/archive/$pkgver/wlroots-$pkgver.tar.gz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz mkd...
pkgname=cairo pkgver=master deps="glib" fetch() { curl "https://gitlab.freedesktop.org/cairo/cairo/-/archive/master/cairo-master.tar.gz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz mkdir $pkgname-$pkgver/build } build() { cd $pkgname-$pkgver cd build meson .. \ --buildtype=release \ --prefix=...
pkgname=pixman pkgver=master fetch() { curl "https://gitlab.freedesktop.org/pixman/pixman/-/archive/master/pixman-master.tar.gz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz mkdir $pkgname-$pkgver/build } build() { cd $pkgname-$pkgver cd build meson .. \ --prefix=/usr \ --buildty...
pkgname=libepoxy pkgver=1.5.10 fetch() { #curl -L "https://github.com/anholt/libepoxy/releases/download/$pkgver/libepoxy-$pkgver.tar.xz" -o $pkgname-$pkgver.tar.xz curl -L "https://github.com/anholt/libepoxy/archive/refs/tags/1.5.10.tar.gz" -o $pkgname-$pkgver.tar.gz tar -xf $pkgname-$pkgver.tar.gz mkdir $pkgname-...
pkgname=hwdata pkgver=0.366 fetch() { curl -L "https://github.com/vcrhonek/hwdata/archive/refs/tags/v$pkgver.tar.gz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz } build() { cd $pkgname-$pkgver ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --build=$TRIPLE \ ...
pkgname=vulkan-validation-layers pkgver=1.3.261.1 deps="musl" desc="Vulkan validation layers" fetch() { curl -L "https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/sdk-$pkgver.tar.gz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz mv Vulkan-ValidationLayers-sdk-$pkgver $pkgname-$p...
pkgname=pango _pkgver=1.50 pkgver=$_pkgver.0 deps="harfbuzz" fetch() { curl -L "https://download.gnome.org/sources/pango/$_pkgver/pango-$pkgver.tar.xz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz mkdir $pkgname-$pkgver/build cd $pkgname-$pkgver rm -rf subprojects : > tests/meson.build : > example...
pkgname=ffmpeg pkgver=4.4 fetch() { curl "https://ffmpeg.org/releases/ffmpeg-$pkgver.tar.xz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz } build() { cd $pkgname-$pkgver ./configure \ --prefix=/usr \ --enable-openssl \ --cc=cc bad --gmake gmake } package() { cd $pkgname-$pkgver bad --gmak...
pkgname=libudev-zero pkgver=1.0.3 mkdeps=bmake fetch() { curl -L "https://github.com/illiliti/libudev-zero/archive/$pkgver.tar.gz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz } build() { cd $pkgname-$pkgver make cd contrib cc helper.c -o libudev-zero-hotplug-helper } package() { cd $pkgname-$pk...
pkgname=shaderc pkgver=main fetch() { curl -L "https://github.com/google/shaderc/archive/refs/heads/main.tar.gz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz cp ../third-party.patch . mkdir $pkgname-$pkgver/build cd $pkgname-$pkgver patch -p1 < ../third-party.patch echo \"$pkgver\" > glslc/src/bui...
pkgname=freetype pkgver=2.12.0 fetch() { curl "https://download-mirror.savannah.gnu.org/releases/freetype/freetype-$pkgver.tar.xz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz mkdir $pkgname-$pkgver/build } build() { cd $pkgname-$pkgver cd build meson .. \ --buildtype=release \ --prefix=/usr \...
pkgname=wayland-protocols pkgver=1.37 mkdeps="muon:samurai:pkgconf" deps="musl:wayland" fetch() { curl -L "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/$pkgver/downloads/wayland-protocols-$pkgver.tar.xz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz mkdir $pkgname-$pkgver/build }...
pkgname=spirv-tools pkgver=1.3.261.1 desc="spirv tools" deps="musl" fetch() { curl -L "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/sdk-$pkgver.tar.gz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz mv SPIRV-Tools-sdk-$pkgver spirv-tools-$pkgver mkdir $pkgname-$pkgver/build } build() ...
pkgname=autotiling-rs pkgver=0.1.3 _clear_vendor_checksums() { sed -i 's/\("files":{\)[^}]*/\1/' vendor/$1/.cargo-checksum.json } fetch() { curl -L "https://github.com/ammgws/autotiling-rs/archive/refs/tags/v$pkgver.tar.gz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz cd $pkgname-$pkgver mkdir -p ....
pkgname=smartdns pkgver=46.1 fetch() { curl -L "https://github.com/pymumu/smartdns/archive/refs/tags/Release$pkgver.tar.gz" -o $pkgname-$pkgver.tar.xz tar -xf $pkgname-$pkgver.tar.xz mv $pkgname-Release$pkgver $pkgname-$pkgver } build() { cd $pkgname-$pkgver bad --gmake gmake } package() { cd $pkgname-$pkgver ...
pkgver=4.3 pkgname=gmake pkgrel=1 deps="musl" bad="gmake" ext="doc:dev" auto_cross fetch() { curl "https://ftp.gnu.org/gnu/make/make-$pkgver.tar.gz" -o $pkgname-$pkgver.tar.gz tar -xf $pkgname-$pkgver.tar.gz mv make-$pkgver $pkgname-$pkgver } build() { cd $pkgname-$pkgver ./configure \ --prefix=/usr/bad/gmake ...
pkgname=autoconf pkgver=2.13 fetch() { curl "https://ftp.gnu.org/gnu/autoconf/autoconf-$pkgver.tar.gz" -o $pkgname-$pkgver.tar.gz tar -xf $pkgname-$pkgver.tar.gz cd $pkgname-$pkgver sed -i '/^M4FROZEN/d' Makefile.in patch -p1 < ../../makefile.patch # patch -p1 < ../../autoconf.sh.patch # patch -p1 < ../../autoh...
pkgname=bad pkgver=0.0.1 fetch() { curl -L "https://github.com/iglunix/bad/archive/refs/tags/v$pkgver.tar.gz" -o $pkgname-$pkgver.tar.gz tar -xf $pkgname-$pkgver.tar.gz } build() { cd $pkgname-$pkgver [ -z "$WITH_CROSS" ] || export CFLAGS="$CFLAGS --target=$TRIPLE --sysroot=$WITH_CROSS_DIR" make } package() { ...
pkgname=rust pkgver=1.71.0 fetch() { curl "https://static.rust-lang.org/dist/rust-$pkgver-$ARCH-unknown-linux-musl.tar.gz" -o rust.tar.gz tar -xf rust.tar.gz } build() { [ -f libgcc_s.so ] \ || clang -shared -o libgcc_s.so \ -Wl,--allow-multiple-definition -Wl,--whole-archive \ $(clang -print-libgcc-file-name) ...
#!/system/bin/sh # Notes: ## resetprop (without -n) = deletes a property then modifies it, this forces property_service to update that property immediately. ## Avoid changing props that can be important to a niche group of users, such as "persist.traced.enable". # 'dun' persistently tells the telecom that tethering w...
#!/bin/sh apk update apk upgrade apk add openssl stunnel mkdir -p /run/stunnel openssl genrsa -out ~/RootCAKey.pem 2048 openssl req -x509 -sha256 -new -nodes -key ~/RootCAKey.pem -days 3650 -out RootCACert.pem chmod 600 ~/RootCAKey.pem chmod 600 ~/RootCACert.pem PSK=$(base64 < /dev/urandom | tr -d 'O0Il1+/' | head -...
#!/bin/bash SYSCTL="$(whereis sysctl | awk '{print $2}')" # Set TCP buffers and TCP window scaling to an iPhone 16 Pro Max running iOS 26. ${SYSCTL} -w net.inet.tcp.sendspace=65536 # macOS default: typically 131072 ${SYSCTL} -w net.inet.tcp.recvspace=65536 # macOS default: typically 131072 ${SYSCTL} -w kern.ip...
#!/system/bin/sh resetprop --delete tether_dun_required resetprop --delete net.tethering.noprovisioning resetprop --delete tether_entitlement_check_state resetprop -p --delete persist.ro.config.hw_quickpoweron resetprop -p --delete persist.ro.warmboot.capability # Specific to changes Unlimited Hotspot v5 did: resetpr...
import pcbnew import os from .pcbnew2boardview import convert_brd, convert_bvr, convert_obdata class Pcbnew2Boardview_BRD(pcbnew.ActionPlugin): def defaults(self): self.name = "Pcbnew to Boardview (BRD)" self.category = "Read PCB" self.description = "Generate Boardview file from KiCad PC...
#!/usr/bin/env python import sys import re import argparse import pcbnew def skip_module(module, tp=False): if module.GetPadCount() == 0: return True refdes = module.Reference().GetText() if tp and not refdes.startswith("TP"): return True if not tp and refdes.startswith("TP"): ...
/* zelect-0.0.9 opts: throttle: ms: delay to throttle filtering of results when search term updated, 0 means synchronous loader: function(term, page, callback): load more items callback expects an array of items renderItem: function(item, term): render the conten...
describe('zelect', function() { var keys = { tab:9, enter:13, esc:27, left:37, up:38, right:39, down:40 } describe('The basics', function() { beforeEach(function() { setup('with-two-options') $('#select').zelect({ throttle:0 }) }) it('renders', function() { defaultInitialState() ...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Diagnostics; [StackTraceHidden] internal static class Assert { public static void Always( [DoesNotReturnIf(false)] bool condition, [CallerArgumentExpression(nameof(condition))] string expression = "") { if (!condition) ...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Diagnostics; [StackTraceHidden] internal static class Check { [InterpolatedStringHandler] public ref struct CheckInterpolatedStringHandler { private DefaultInterpolatedStringHandler _handler; public CheckInterpolatedStringHandler( ...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Diagnostics; [SuppressMessage("", "CA1032")] [SuppressMessage("", "CA1064")] internal sealed class AssertionException : Exception { public AssertionException(string expression) : base($"Assertion '{expression}' failed.") { } }
// SPDX-License-Identifier: 0BSD using Windows.Win32.System.Threading; namespace Vezel.Ruptura.System; public enum PriorityLevel : int { Idle = THREAD_PRIORITY.THREAD_PRIORITY_IDLE, Lowest = THREAD_PRIORITY.THREAD_PRIORITY_LOWEST, BelowNormal = THREAD_PRIORITY.THREAD_PRIORITY_BELOW_NORMAL, Normal = T...
// SPDX-License-Identifier: 0BSD using Vezel.Ruptura.System.SafeHandles; using Windows.Win32.Foundation; using static Windows.Win32.WindowsPInvoke; namespace Vezel.Ruptura.System; public abstract class SynchronizationObject : KernelObject { private protected SynchronizationObject(nint handle) : base(hand...
// SPDX-License-Identifier: 0BSD using Windows.Win32.Foundation; using Windows.Win32.System.Diagnostics.ToolHelp; using static Windows.Win32.WindowsPInvoke; namespace Vezel.Ruptura.System; public sealed class SnapshotObject : KernelObject { private SnapshotObject(nint handle) : base(handle) { } ...
// SPDX-License-Identifier: 0BSD using Windows.Win32.System.Diagnostics.ToolHelp; namespace Vezel.Ruptura.System; [Flags] [SuppressMessage("", "CA1711")] public enum HeapBlockSnapshotFlags : uint { Fixed = HEAPENTRY32_FLAGS.LF32_FIXED, Free = HEAPENTRY32_FLAGS.LF32_FREE, Movable = HEAPENTRY32_FLAGS.LF32_...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.System; [SuppressMessage("", "CA1815")] public readonly struct ProcessSnapshot { public int ParentId { get; } public int Id { get; } internal ProcessSnapshot(int parentId, int id) { ParentId = parentId; Id = id; } }
// SPDX-License-Identifier: 0BSD using static Windows.Win32.WindowsPInvoke; namespace Vezel.Ruptura.System; [Flags] [SuppressMessage("", "CA1711")] public enum HeapSnapshotFlags : uint { Default = HF32_DEFAULT, Shared = HF32_SHARED, }
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.System; [SuppressMessage("", "CA1815")] public readonly unsafe struct ModuleSnapshot { public int ProcessId { get; } public string Name { get; } public nint Handle { get; } public void* Address { get; } public int Length { get; } in...
// SPDX-License-Identifier: 0BSD using Windows.Win32.System.Threading; namespace Vezel.Ruptura.System; [SuppressMessage("", "CA1008")] [SuppressMessage("", "CA1027")] public enum PriorityClass : uint { Normal = PROCESS_CREATION_FLAGS.NORMAL_PRIORITY_CLASS, Idle = PROCESS_CREATION_FLAGS.IDLE_PRIORITY_CLASS, ...
// SPDX-License-Identifier: 0BSD using Windows.Win32.System.Threading; namespace Vezel.Ruptura.System; [Flags] public enum ThreadAccess : uint { Terminate = THREAD_ACCESS_RIGHTS.THREAD_TERMINATE, SuspendResume = THREAD_ACCESS_RIGHTS.THREAD_SUSPEND_RESUME, GetContext = THREAD_ACCESS_RIGHTS.THREAD_GET_CONT...
// SPDX-License-Identifier: 0BSD using Windows.Win32.System.Memory; namespace Vezel.Ruptura.System; [SuppressMessage("", "CA1027")] public enum MemoryAccess : uint { None = 0x0, Read = PAGE_PROTECTION_FLAGS.PAGE_READONLY, ReadWrite = PAGE_PROTECTION_FLAGS.PAGE_READWRITE, ReadCopyOnWrite = PAGE_PROTEC...
// SPDX-License-Identifier: 0BSD using Windows.Win32.Foundation; using Windows.Win32.System.Diagnostics.ToolHelp; using static Windows.Win32.WindowsPInvoke; namespace Vezel.Ruptura.System; [SuppressMessage("", "CA1815")] public readonly struct HeapSnapshot { public int ProcessId { get; } public nint Id { ge...
// SPDX-License-Identifier: 0BSD using Vezel.Ruptura.System.SafeHandles; using Windows.Win32.Foundation; using static Windows.Win32.WindowsPInvoke; namespace Vezel.Ruptura.System; [SuppressMessage("", "CA1063")] public abstract class KernelObject : CriticalFinalizerObject, IDisposable, IEquatable<KernelObject>, ...
// SPDX-License-Identifier: 0BSD using Windows.Win32.System.Diagnostics.ToolHelp; namespace Vezel.Ruptura.System; [Flags] [SuppressMessage("", "CA1711")] public enum SnapshotFlags : uint { Heaps = CREATE_TOOLHELP_SNAPSHOT_FLAGS.TH32CS_SNAPHEAPLIST, Processes = CREATE_TOOLHELP_SNAPSHOT_FLAGS.TH32CS_SNAPPROCES...
// SPDX-License-Identifier: 0BSD using Windows.Win32.System.SystemInformation; namespace Vezel.Ruptura.System; public enum ImageMachine : ushort { Unknown = IMAGE_FILE_MACHINE.IMAGE_FILE_MACHINE_UNKNOWN, X86 = IMAGE_FILE_MACHINE.IMAGE_FILE_MACHINE_I386, X64 = IMAGE_FILE_MACHINE.IMAGE_FILE_MACHINE_AMD64, ...
// SPDX-License-Identifier: 0BSD using Windows.Win32; using Windows.Win32.Foundation; using Windows.Win32.System.Memory; using Windows.Win32.System.SystemInformation; using Windows.Win32.System.Threading; using static Windows.Win32.WindowsPInvoke; namespace Vezel.Ruptura.System; public sealed unsafe class ProcessObj...
// SPDX-License-Identifier: 0BSD using Windows.Win32.System.Threading; namespace Vezel.Ruptura.System; [Flags] public enum ProcessAccess : uint { Terminate = PROCESS_ACCESS_RIGHTS.PROCESS_TERMINATE, CreateThread = PROCESS_ACCESS_RIGHTS.PROCESS_CREATE_THREAD, OperateMemory = PROCESS_ACCESS_RIGHTS.PROCESS_...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.System; [SuppressMessage("", "CA1815")] public readonly unsafe struct HeapBlockSnapshot { public int ProcessId { get; } public nint HeapId { get; } public nint Handle { get; } public void* Address { get; } public nint Length { get; } ...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.System; [SuppressMessage("", "CA1815")] public readonly struct ThreadSnapshot { public int ProcessId { get; } public int Id { get; } internal ThreadSnapshot(int processId, int id) { ProcessId = processId; Id = id; } }
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.System; public enum WaitResult { Signaled, Abandoned, TimedOut, Alerted, }
// SPDX-License-Identifier: 0BSD using Windows.Win32.Foundation; using static Windows.Win32.WindowsPInvoke; namespace Vezel.Ruptura.System.SafeHandles; public sealed class SafeKernelHandle : SafeHandleZeroOrMinusOneIsInvalid { public SafeKernelHandle(bool ownsHandle) : base(ownsHandle) { } p...
// SPDX-License-Identifier: 0BSD using Windows.Win32.Foundation; using Windows.Win32.System.Threading; using static Windows.Win32.WindowsPInvoke; namespace Vezel.Ruptura.System; public sealed unsafe class ThreadObject : SynchronizationObject { public static int CurrentId => (int)GetCurrentThreadId(); [Suppr...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Analyzers.Hosting; [Generator] public sealed class EntryPointGenerator : IIncrementalGenerator { public void Initialize(IncrementalGeneratorInitializationContext context) { context.RegisterSourceOutput( context.CompilationProvider ...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Analyzers; internal static class DiagnosticDescriptors { [AttributeUsage(AttributeTargets.Property, Inherited = false)] private sealed class DiagnosticAttribute : Attribute { public string Title { get; } public string Message { get;...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Hosting; [EditorBrowsable(EditorBrowsableState.Never)] public static class InjectedProgramHost { // This class is only meant to be used by generated code. public static Task<int> RunAsync<TProgram>(ReadOnlyMemory<string> args) where TProgram : ...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Hosting; public sealed class InjectedProgramContext { [StructLayout(LayoutKind.Sequential)] private struct RupturaState { // Keep in sync with src/module/main.c. public nuint Size; public uint InjectorProcessId; pu...
// SPDX-License-Identifier: 0BSD #include <windows.h> #include <nethost.h> #include <hostfxr.h> #include <coreclr_delegates.h> #include "host.h" struct ruptura_host_ { HMODULE hostfxr; hostfxr_handle handle; hostfxr_initialize_for_dotnet_command_line_fn initialize_fn; hostfxr_get_runtime_delegate_fn...
// SPDX-License-Identifier: 0BSD #include <windows.h> #include "host.h" #include "main.h" typedef struct { // Keep in sync with src/hosting/InjectedProgramContext.cs. size_t size; uint32_t injector_process_id; uint32_t main_thread_id; HMODULE module_handle; } ruptura_state; static volatile atom...
// SPDX-License-Identifier: 0BSD [SuppressMessage("", "CA1812")] // TODO: https://github.com/dotnet/roslyn-analyzers/issues/6218 internal sealed class InjectedProgram : IInjectedProgram { private static readonly TimeSpan _timeout = TimeSpan.FromMinutes(1); private static int _counter; [SuppressMessage(""...
// SPDX-License-Identifier: 0BSD internal static unsafe class Program { private static CallTrace? _trace; private static string? _result; public static int Main() { var lib = NativeLibrary.Load("kernel32.dll"); try { using var manager = new PageCodeManager(); ...
// SPDX-License-Identifier: 0BSD [SuppressMessage("", "CA1812")] // TODO: https://github.com/dotnet/roslyn-analyzers/issues/6218 internal sealed class InjectedProgram : IInjectedProgram { private static readonly TimeSpan _timeout = TimeSpan.FromMinutes(1); public static async Task<int> RunAsync(InjectedProgra...
// SPDX-License-Identifier: 0BSD [SuppressMessage("", "CA1812")] // TODO: https://github.com/dotnet/roslyn-analyzers/issues/6218 internal sealed class InjectedProgram : IInjectedProgram { private static readonly TimeSpan _timeout = TimeSpan.FromMinutes(1); public static async Task<int> RunAsync(InjectedProgra...
// SPDX-License-Identifier: 0BSD [SuppressMessage("", "CA1812")] // TODO: https://github.com/dotnet/roslyn-analyzers/issues/6218 internal sealed class InjectedProgram : IInjectedProgram { private static readonly TimeSpan _timeout = TimeSpan.FromMinutes(1); public static async Task<int> RunAsync(InjectedProgra...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Injection.Threading; internal sealed class ThreadWaitHandle : WaitHandle { public ThreadWaitHandle(SafeWaitHandle handle) { this.SetSafeWaitHandle(handle); } }
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Injection.IO; internal sealed unsafe class ProcessMemoryStream : Stream { // TODO: Review some of the casts here. public override bool CanRead => true; public override bool CanWrite => true; public override bool CanSeek => true; public o...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Injection.IO; internal sealed class InjectionBinaryWriter : BinaryWriter { private readonly bool _is64Bit; public InjectionBinaryWriter(Stream stream, bool is64Bit) : base(stream) { _is64Bit = is64Bit; } public void WritePo...
// SPDX-License-Identifier: 0BSD using Vezel.Ruptura.Injection.IO; using Windows.Win32.Foundation; using Windows.Win32.System.Threading; using static Windows.Win32.WindowsPInvoke; namespace Vezel.Ruptura.Injection; public sealed unsafe class TargetProcess : IDisposable { // TODO: Move more of the code here to Ve...
// SPDX-License-Identifier: 0BSD using Vezel.Ruptura.Injection.IO; using Vezel.Ruptura.Injection.Threading; using static Iced.Intel.AssemblerRegisters; using static Windows.Win32.WindowsPInvoke; namespace Vezel.Ruptura.Injection; public sealed class AssemblyInjector : IDisposable { [StructLayout(LayoutKind.Seque...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Injection; public class InjectionException : Exception { public InjectionException() : this("An unknown injection error occurred.") { } public InjectionException(string? message) : base(message) { } public Injection...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Injection; public sealed class AssemblyInjectorOptions { public string FileName { get; private set; } = null!; public ImmutableArray<string> Arguments { get; private set; } = []; public string ModuleDirectory { get; private set; } = AppContext.Bas...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Memory.Code; internal sealed class NullCodeWriter : CodeWriter { public nint Length { get; private set; } public override void WriteByte(byte value) { Length++; } }
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Memory.Code; [SuppressMessage("", "CA1063")] public abstract unsafe class CodeManager : IDisposable { public abstract void Dispose(); public abstract CodeAllocation Allocate(nint length, CodePlacement placement); }
// SPDX-License-Identifier: 0BSD using static Iced.Intel.AssemblerRegisters; namespace Vezel.Ruptura.Memory.Code; public sealed unsafe class FunctionHook : IDisposable { // Hijacks the prologue of a target function by replacing it with a relative jump to a trampoline. The trampoline // consists of two parts:...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Memory.Code; internal static unsafe class FunctionHookGate { private sealed class GateContext { public readonly ref struct HookGuard : IDisposable { public bool IsOwned => _context != null; private readonly GateC...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Memory.Code; public readonly unsafe struct CodePlacement : IEquatable<CodePlacement>, IEqualityOperators<CodePlacement, CodePlacement, bool> { // Specifies a range of memory that a code allocation must start within. Both values are inclusive. Notably, t...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Memory.Code; public sealed unsafe class DynamicFunction : IDisposable { public void* Code { get { Check.Usable(_allocation != null, this); return _allocation.Code; } } private CodeAllocation? _al...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Memory.Code; internal sealed class CodeDisassembler { private readonly Iced.Intel.Decoder _decoder; public CodeDisassembler(CodeReader reader, nuint ip) { _decoder = Iced.Intel.Decoder.Create(Environment.Is64BitProcess ? 64 : 32, reader, ip...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Memory.Code; [SuppressMessage("", "CA1063")] public abstract unsafe class CodeAllocation : IDisposable { public CodeManager Manager { get; } public abstract void* Code { get; } public abstract nint Length { get; } protected CodeAllocation(Cod...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Memory.Code; internal sealed unsafe class RawCodeWriter : CodeWriter { private byte* _address; public RawCodeWriter(byte* address) { _address = address; } public override void WriteByte(byte value) { *_address++ = value...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Memory.Code; internal sealed class CodeAssembler : Assembler { public bool Is64Bit => Bitness == 64; public CodeAssembler() : base(Environment.Is64BitProcess ? 64 : 32) { } public void Assemble(CodeWriter writer, ulong rip) { ...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Memory.Code; internal sealed unsafe class RawCodeReader : CodeReader { private byte* _address; public RawCodeReader(byte* address) { _address = address; } public override int ReadByte() { return *_address++; } }
// SPDX-License-Identifier: 0BSD using Windows.Win32.System.SystemInformation; using static Windows.Win32.WindowsPInvoke; namespace Vezel.Ruptura.Memory.Code; public sealed unsafe class PageCodeManager : CodeManager { private readonly struct AllocationInfo { public void* Address { get; } pub...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Memory.Diagnostics; public sealed class ManagedCallFrameSymbolicator : CallFrameSymbolicator { public static ManagedCallFrameSymbolicator Instance { get; } = new(); // These are internal APIs that we are exploiting. They may or may not be present. ...
// SPDX-License-Identifier: 0BSD using Windows.Win32.Foundation; using Windows.Win32.System.Diagnostics.Debug; using static Windows.Win32.WindowsPInvoke; namespace Vezel.Ruptura.Memory.Diagnostics; public sealed class NativeCallFrameSymbolicator : CallFrameSymbolicator { public static NativeCallFrameSymbolicator...
// SPDX-License-Identifier: 0BSD namespace Vezel.Ruptura.Memory.Diagnostics; public sealed unsafe class CallFrameSymbol { public void* Address { get; } public string Name { get; } public string? FileName { get; } public int Line { get; } public int Column { get; } public CallFrameSymbol(v...
// SPDX-License-Identifier: 0BSD using Windows.Win32.Foundation; using Windows.Win32.System.Diagnostics.Debug; using static Windows.Win32.WindowsPInvoke; namespace Vezel.Ruptura.Memory.Diagnostics; public sealed unsafe class CallFrame { public void* IP => (void*)_frame.AddrPC.Offset; public void* SP => (voi...
// SPDX-License-Identifier: 0BSD using Vezel.Ruptura.Memory.Code; using Windows.Win32.Foundation; using Windows.Win32.System.Diagnostics.Debug; using static Windows.Win32.WindowsPInvoke; namespace Vezel.Ruptura.Memory.Diagnostics; public sealed unsafe class CallTrace { public IReadOnlyList<CallFrame> Frames { ge...
#!/usr/bin/env bash # -*- tab-width: 4; encoding: utf-8; -*- # ######### # License: # # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE # Version 2, December 2004 # # Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> # # Everyone is permitted to copy and distribute verbatim or modified # copie...