-
-
Save tettoffensive/f59448d9f6d889a72fb3 to your computer and use it in GitHub Desktop.
A recent disassembly of IOMobileFramebuffer framework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* You may have to include your IOSurface header to compile, because of the GetLayerDefaultSurface function. If you do not have it, you may just uncomment the typedef to an IOSurface below. */ | |
#include <stdio.h> | |
#include <sys/mman.h> | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
#define kIOMobileFramebufferError 0xE0000000 | |
typedef kern_return_t IOMobileFramebufferReturn; | |
typedef struct __IOMobileFramebuffer *IOMobileFramebufferConnection; | |
/* typedef struct __IOSurface *IOSurfaceRef */ | |
typedef NS_ENUM(int, IOMobileFramebufferColorRemapMode) { | |
IOMobileFramebufferColorRemapModeNormal = 0, | |
IOMobileFramebufferColorRemapModeInverted = 1, | |
IOMobileFramebufferColorRemapModeGrayscale = 2, | |
IOMobileFramebufferColorRemapModeGrayscaleIncreaseContrast = 3, | |
IOMobileFramebufferColorRemapModeInvertedGrayscale = 4 | |
}; | |
IOMobileFramebufferReturn IOMobileFramebufferOpen(mach_port_t service, mach_port_t owningTask, unsigned int type, IOMobileFramebufferConnection *connection); | |
IOMobileFramebufferReturn IOMobileFramebufferGetLayerDefaultSurface(IOMobileFramebufferConnection connection, int surface, IOSurfaceRef *buffer); | |
/* Use this instead of IOMobileFramebufferOpen, it is much more efficient and requires only this one function, rather getting the "AppleCLCD" and opening this service */ | |
IOMobileFramebufferReturn IOMobileFramebufferGetMainDisplay(IOMobileFramebufferConnection *connection); | |
IOMobileFramebufferReturn IOMobileFramebufferSwapBegin(IOMobileFramebufferConnection connection, int *token); | |
IOMobileFramebufferReturn IOMobileFramebufferSwapEnd(IOMobileFramebufferConnection connection); | |
IOMobileFramebufferReturn IOMobileFramebufferSwapSetLayer(IOMobileFramebufferConnection connection, int layerid, IOSurfaceRef buffer); | |
IOMobileFramebufferReturn IOMobileFramebufferSwapWait(IOMobileFramebufferConnection connection, int token, int something); | |
IOMobileFramebufferReturn IOMobileFramebufferGetDisplayArea(IOMobileFramebufferConnection connection, CGFloat *displayArea); | |
IOMobileFramebufferReturn IOMobileFramebufferGetDisplaySize(IOMobileFramebufferConnection connection, CGSize *size); | |
IOMobileFramebufferReturn IOMobileFramebufferGetGammaTable(IOMobileFramebufferConnection connection, void *data); | |
IOMobileFramebufferReturn IOMobileFramebufferSetGammaTable(IOMobileFramebufferConnection connection, void *data); | |
IOMobileFramebufferReturn IOMobileFramebufferSetContrast(IOMobileFramebufferConnection connection, int level); | |
IOMobileFramebufferReturn IOMobileFramebufferGetColorRemapMode(IOMobileFramebufferConnection connection, IOMobileFramebufferColorRemapMode *mode); | |
IOMobileFramebufferReturn IOMobileFramebufferSetColorRemapMode(IOMobileFramebufferConnection connection, IOMobileFramebufferColorRemapMode mode); | |
IOMobileFramebufferReturn IOMobileFramebufferSetWhiteOnBlackMode(IOMobileFramebufferConnection connection, BOOL enabled); | |
/* This will make your display look broken. To fix, simply perform a reboot on the device. So feel free to experiment! */ | |
IOMobileFramebufferReturn IOMobileFramebufferSetBrightnessCorrection(IOMobileFramebufferConnection connection, int level); | |
#ifdef __cplusplus | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment