From 7168fe8ba3c950474fc2bbf4f4ae1726a463b326 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 6 Feb 2015 20:24:05 -0500 Subject: [PATCH] Bypass resource flipping --- toolbox/rm.cpp | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/toolbox/rm.cpp b/toolbox/rm.cpp index be896ee..402207f 100644 --- a/toolbox/rm.cpp +++ b/toolbox/rm.cpp @@ -28,10 +28,10 @@ //#include #include #include -#include #include + #include "rm.h" #include "toolbox.h" #include "mm.h" @@ -61,32 +61,6 @@ namespace bool ResLoad = true; - - // https://developer.apple.com/library/mac/documentation/Carbon/Reference/CoreEndianReference/ - - OSStatus FlipperNoFlipping(OSType dataDomain, OSType dataType, SInt16 id, void *dataPtr, ByteCount dataSize, Boolean currentlyNative, void *refCon) - { - return 0; - } - - void BypassResourceFlipper(OSType dataType) - { - static std::unordered_set Types; - - if (Types.find(dataType) != Types.end()) return; - - CoreEndianFlipProc proc; - void *refCon; - - if (::CoreEndianGetFlipper(kCoreEndianResourceManagerDomain, dataType, &proc, &refCon) == 0) - { - ::CoreEndianInstallFlipper(kCoreEndianResourceManagerDomain, dataType, FlipperNoFlipping, nullptr); - //fprintf(stderr, "Endian Flipper was installed for resource '%s'\n", TypeToString(dataType).c_str()); - } - - Types.insert(dataType); - } - #if 0 struct ResEntry { @@ -169,13 +143,9 @@ namespace RM uint32_t size; theHandle = 0; - - if (!LoadResType(type)) return SetResError(resNotFound); - BypassResourceFlipper(type); - nativeHandle = fx(); if (!nativeHandle) return SetResError(resNotFound);