Skip to content

Instantly share code, notes, and snippets.

View macmade's full-sized avatar
🦄
I may be slow to respond.

JD Gadina macmade

🦄
I may be slow to respond.
View GitHub Profile
/*******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2023 DigiDNA - www.imazing.com
*
* 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, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
PDF_set_gstate: Access Violation - Attempt to read inaccessible data at address 0x0
----------
Process: iMazing.exe [5176]
Path: C:\Program Files\DigiDNA\iMazing\iMazing.exe
Code Type: X86-64 (Native)
Responsible: pdflib.dll
Date/Time: 2019-10-05 22:03:10
@macmade
macmade / gist:92745acd97fc6e53189d83b1728d688b
Last active November 2, 2017 22:39
ISOBMFF-Dump Build
clang++ -std=c++11 -Wall -o Build/Release/Products/x86_64/ISOBMFF-Dump ISOBMFF-Dump/main.cpp Build/Release/Products/x86_64/libISOBMFF.a -I ISOBMFF/include -I Submodules/PIMPL/PIMPL/include
/*******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2017 Jean-David Gadina - www.xs-labs.com
*
* 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, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@macmade
macmade / CocoaUberAlles.m
Last active June 29, 2017 00:16
Cocoa Uber Alles
typedef Class Klasse;
typedef BOOL Wahrheit;
typedef SEL Wahler;
typedef NSZone NSBereich;
typedef void leer;
typedef id kennung;
#define NSObjekt NSObject
#define NSBereich NSZone
@macmade
macmade / Xcode-DTDeviceKitBase-MonotonicCopy.c
Created March 7, 2017 22:27
Xcode - DTDeviceKitBase - MonotonicCopy
int __ZL34DTDKCircularBufferGetMonotonicCopyP18DTDKCircularBuffer(void * arg0) {
rbx = arg0;
rcx = *(rbx + 0x10);
if (rcx == 0x0) goto loc_3a18d;
loc_3a16b:
if (rcx >= *rbx) goto loc_3a1ae;
loc_3a170:
rax = [NSData dataWithBytes:rbx + 0x18 length:rcx];
@macmade
macmade / objc_msg_lambda.cpp
Last active March 15, 2023 10:33
objc_msgSend - C++ Lambda
#include <functional>
#include <iostream>
#include <objc/runtime.h>
#include <objc/message.h>
template< typename _R_, typename ... _T_ >
_R_ CXX_IMP( id self, SEL _cmd, _T_ ... args )
{
Class cls;
id assoc;
@macmade
macmade / cpp-fibs.cpp
Created June 11, 2015 22:20
C++ Fibonacci
#include <iostream>
template< int N >
struct Fibonacci
{
static constexpr int value = Fibonacci< N - 1 >::value + Fibonacci< N - 2 >::value;
};
template<>
struct Fibonacci< 1 >
@macmade
macmade / libgit2-coveralls.c
Last active August 29, 2015 14:16
libgit2 - coveralls.io infos
/*!
* @author Jean-David Gadina
* @copyright (c) 2015, Jean-David Gadina - www.xs-labs.com
*/
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include "git2.h"
@macmade
macmade / strict-aliasing-bug.c
Created April 2, 2014 21:38
An example of C99 strict aliasing issue...
#include <stdio.h>
struct s1
{
int i;
};
struct s2
{
int i;