Skip to content

Instantly share code, notes, and snippets.

View jevinskie's full-sized avatar

Jevin Sweval jevinskie

View GitHub Profile
@jevinskie
jevinskie / parti-example-use.console
Created May 14, 2025 17:01
parti MBR/GPT dumper demo
# parti dumps more detailed info than fdisk etc
# https://github.com/wfeldt/parti
# depends on: https://github.com/openSUSE/checkmedia
-> 🌩 % sudo ~/base/util/bin/parti --verbose /dev/sda
/dev/sda: 480103981056 bytes
- - - - - - - - - - - - - - - -
mbr id: 0x00000000
sector size: 512
disk size: 937703088
Firmware Volume: 8c8ce578-8a3d-4f1c-9935-896185c32dd3 attr 0x0003feff, rev 2, cksum 0xe6ae, size 0x20000 (131072 bytes)
Firmware Volume Blocks: (32, 0x1000)
File 0: 86ee84e1-3375-41a1-afba-847bd29663aa type 0x02, attr 0x40, state 0x07, size 0x7e2e (32302 bytes), (freeform)
Section 0: type 0x01, size 0x7e16 (32278 bytes) (Compression section)
Section 0: type 0x18, size 0xaa0c (43532 bytes) (Free-form GUID section)
Section 1: type 0x15, size 0x1a (26 bytes) (User interface name section)
Name: MyOemLogo1
File 1: 86ee84e2-3375-41a1-afba-847bd29663aa type 0x02, attr 0x40, state 0x07, size 0x2c1b (11291 bytes), (freeform)
Section 0: type 0x01, size 0x2c03 (11267 bytes) (Compression section)
Section 0: type 0x18, size 0x501c (20508 bytes) (Free-form GUID section)
@jevinskie
jevinskie / Mac-failure.txt
Last active May 4, 2025 23:04
GraalVM AWT JNI loadLibrary macOS issue
-> % ./helloworldawt -Djava.home=$JAVA_HOME
Exception in thread "main": java.lang.InternalError
java.lang.InternalError: platform encoding not initialized
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.functions.JNIFunctions$NewObjectWithObjectArrayArgFunctionPointer.invoke(JNIFunctions.java)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.functions.JNIFunctions.ThrowNew(JNIFunctions.java:918)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.JNIOnLoadFunctionPointer.invoke(JNILibraryInitializer.java)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.JNILibraryInitializer.initialize(JNILibraryInitializer.java:119)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.NativeLibrarySupport.addLibrary(NativeLibrarySupport.java:128)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.NativeLibrarySupport.addLibrary(NativeLibrarySupport.java:84)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.NativeLibraries.loadLibrary0(NativeLibraries.java:1
@jevinskie
jevinskie / ghidra-dev-run-notes.md
Last active April 28, 2025 17:51
ghidra dev launch (doesn't build zip dist)
gradle --parallel --daemon -I gradle/support/fetchDependencies.gradle

gradle --parallel --daemon prepDev

gradle --parallel --daemon buildGhidra

java -Djava.system.class.loader=ghidra.GhidraClassLoader -Dfile.encoding=UTF8 -Duser.country=US -Duser.language=en -Duser.variant= -Dsun.java2d.opengl=false -Djdk.tls.client.protocols=TLSv1.2,TLSv1.3 -Dcpu.core.limit= -Dcpu.core.override= -Dfont.size.override= -Dpython.console.encoding=UTF-8 -Xshare:off -Declipse.filelock.disable=true -Dapple.laf.useScreenMenuBar=false -Dapple.awt.application.appearance=system -Xdock:name=Ghidra -showversion -cp ./Ghidra/Framework/Utility/build/libs/Utility.jar ghidra.Ghidra ghidra.GhidraRun

java -Djava.system.class.loader=ghidra.GhidraClassLoader -Dfile.encoding=UTF8 -Duser.country=US -Duser.language=en -Duser.variant= -Dsun.java2d.opengl=false -Djdk.tls.client.protocols=TLSv1.2,TLSv1.3 -Dcpu.core.limit= -Dcpu.core.override= -Dfont.size.override= -Dpython.console.encoding=UTF-8 -Xshare:off -Declipse.filelock.disab
@jevinskie
jevinskie / GetMetadataForFile.m
Created April 16, 2025 20:58
Spotlight Importer.xctemplate
//
// ___FILENAME___
// ___PACKAGENAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//
#include <CoreFoundation/CoreFoundation.h>
#import <CoreData/CoreData.h>
@jevinskie
jevinskie / stringlist.py
Created April 9, 2025 19:31
Python StringList for @= line concatenation
from collections.abc import Sequence
from typing import cast, Self
import attrs
@attrs.define
class StringList:
_lines: list[str] = attrs.Factory(list)
@property
@jevinskie
jevinskie / tclshrc.tcl
Last active March 20, 2025 17:23
.tclshrc
# if [[ -d ~/.tcl/brew-tcl-8-6-16 ]]; then
# export MY_TCL_ROOT=~/.tcl/brew-tcl-8-6-16
# export TCLLIBPATH=$MY_TCL_ROOT/lib
# export TCL_EXEC_PREFIX=$MY_TCL_ROOT
# export PATH=$MY_TCL_ROOT/bin:$PATH
# fi
namespace eval TclshLoader {
set tcl_rcFileDir [file join $::env(HOME) .tcl rcfiles]
if {[expr {[file exists $tcl_rcFileDir] && [file isdirectory $tcl_rcFileDir]}]} {
@jevinskie
jevinskie / xnu-image-activation-stack-layout.md
Created March 14, 2025 21:28
XNU image activation stack layout

exec_copyout_strings

In kern_exec.c

Copy out the strings segment to user space. The strings segment is put on a preinitialized stack frame.

Note

The strings segment layout is backward, from the beginning of the top of the stack to consume the minimal amount of space possible;

@jevinskie
jevinskie / z3-symbol-literals.ql
Last active February 17, 2025 19:25
z3-symbol-literals.ql codeql
import cpp
// void params::set_sym(symbol const & k, symbol const & v);
// void params::set_sym(char const * k, symbol const & v);
// void params_ref::set_sym(symbol const & k, symbol const & v);
// void params_ref::set_sym(char const * k, symbol const & v);
// solver_p.set_sym("gc", symbol("dyn_psm"));
class SymbolCstrConstructor extends Constructor {
SymbolCstrConstructor() {
@jevinskie
jevinskie / opensearch-github-jevinskie-stars.xml
Created January 12, 2025 20:35
GitHub star opensearch h4x
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>ghs</ShortName>
<Description>Search jevinskie's GitHub Stars</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">https://github.com/favicon.ico</Image>
<Url type="text/html" method="get" template="https://github.com/jevinskie?submit=Search&amp;q={searchTerms}&amp;tab=stars"/>
<moz:SearchForm>https://github.com/jevinskie?submit=Search&amp;q=sportsball&amp;tab=stars</moz:SearchForm>
</OpenSearchDescription>