mirror of
https://github.com/ksherlock/mpw.git
synced 2025-02-16 12:30:53 +00:00
Bypass resource flipping
This commit is contained in:
parent
ce3b1ca11d
commit
7168fe8ba3
@ -28,10 +28,10 @@
|
|||||||
//#include <unordered_map>
|
//#include <unordered_map>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <unordered_set>
|
|
||||||
|
|
||||||
#include <CoreServices/CoreServices.h>
|
#include <CoreServices/CoreServices.h>
|
||||||
|
|
||||||
|
|
||||||
#include "rm.h"
|
#include "rm.h"
|
||||||
#include "toolbox.h"
|
#include "toolbox.h"
|
||||||
#include "mm.h"
|
#include "mm.h"
|
||||||
@ -61,32 +61,6 @@ namespace
|
|||||||
|
|
||||||
bool ResLoad = true;
|
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<OSType> 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
|
#if 0
|
||||||
struct ResEntry
|
struct ResEntry
|
||||||
{
|
{
|
||||||
@ -169,13 +143,9 @@ namespace RM
|
|||||||
uint32_t size;
|
uint32_t size;
|
||||||
|
|
||||||
theHandle = 0;
|
theHandle = 0;
|
||||||
|
|
||||||
|
|
||||||
if (!LoadResType(type))
|
if (!LoadResType(type))
|
||||||
return SetResError(resNotFound);
|
return SetResError(resNotFound);
|
||||||
|
|
||||||
BypassResourceFlipper(type);
|
|
||||||
|
|
||||||
nativeHandle = fx();
|
nativeHandle = fx();
|
||||||
|
|
||||||
if (!nativeHandle) return SetResError(resNotFound);
|
if (!nativeHandle) return SetResError(resNotFound);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user