Skip to content

Instantly share code, notes, and snippets.

dgelessus / ar_generic.ksy
Last active Feb 28, 2019
Kaitai Struct specs for the Unix ar formats (WIP and a bit of a mess)
View ar_generic.ksy
id: ar_generic
title: Unix ar archive (generic superset)
application: ar
- a # Unix/generic
- lib # Windows
- rlib # Rust
justsolve: AR
dgelessus /
Created Jul 1, 2018
Helper module to log Python strings using NSLog
"""Allows logging Python :class:`str`s to the system log using Foundation's ``NSLog`` function.
This module is meant to help with debugging the loading process of Rubicon on systems like iOS, where sometimes only
NSLog output (but not stdout/stderr) is available to the developer.
import ctypes
import io
import sys
dgelessus / DGPropertyEqualTest.m
Created Feb 14, 2018
Test code to check whether compiler-synthesized property setters actually assign anything if the new object equals the current one
View DGPropertyEqualTest.m
#import <Foundation/Foundation.h>
@interface DGVeryEqual : NSObject
@property(copy) NSString *desc;
-(instancetype)initWithDescription:(NSString *)description;
@implementation DGVeryEqual : NSObject
-(instancetype)initWithDescription:(NSString *)description {
dgelessus / DGMsgSendTest.m
Last active Dec 9, 2016
Test code to figure out which objc_msgSend variants are used in which case on what architecture
View DGMsgSendTest.m
struct char1 {
char x[1];
struct char2 {
char x[2];
struct char3 {
char x[3];
dgelessus /
Created Aug 10, 2016 with enable_faulthandler
# This is an example script.
# The code below is from
from __future__ import absolute_import, division, print_function
def enable_faulthandler():
import ctypes
import datetime
import errno
import io