Skip to content

Instantly share code, notes, and snippets.

View anthonya1999's full-sized avatar

Anthony Agatiello anthonya1999

View GitHub Profile
@anthonya1999
anthonya1999 / UIDevice+Extensions.h
Last active June 15, 2018 06:54
Just some cool extensions that can tell you some more stuff about a device (all work on latest iOS version)
#import <UIKit/UIKit.h>
#include <dlfcn.h>
static const CFStringRef kMGDieID = CFSTR("DieId");
typedef NS_ENUM(NSInteger, BKSInterfaceOrientation) {
BKSInterfaceOrientationPortrait = 1,
BKSInterfaceOrientationPortraitUpsideDown = 2,
BKSInterfaceOrientationLandscapeRight = 3,
BKSInterfaceOrientationLandscapeLeft = 4
@anthonya1999
anthonya1999 / IOMobileFramebuffer.h
Last active March 23, 2024 23:25
A recent disassembly of IOMobileFramebuffer framework
/* It is recommended to use dlopen & dlsym to call these functions, and use this header as a reference.
Example:
void *IOMobileFramebuffer = dlopen("/System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/IOMobileFramebuffer", RTLD_LAZY);
IOMobileFramebufferReturn (*IOMobileFramebufferGetMainDisplay)(IOMobileFramebufferRef *pointer) = dlsym(IOMobileFramebuffer, "IOMobileFramebufferGetMainDisplay");
dlclose(IOMobileFramebuffer); */
/* You may have to include your IOSurface header to compile, because of the IOMobileFramebufferGetLayerDefaultSurface function. If you do not have it, you may just uncomment the typedef to an IOSurface below. */
#include <stdio.h>
#include <sys/mman.h>
#include <mach/mach.h>