Subversion Repositories filter_foundry

Rev

Rev 255 | Rev 259 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 255 Rev 256
Line 31... Line 31...
31
        if( !(h = Get1Resource(PARM_TYPE,PARM_ID))
31
        if( !(h = Get1Resource(PARM_TYPE,PARM_ID))
32
          && readobfusc
32
          && readobfusc
33
          && (h = Get1Resource('DATA',OBFUSCDATA_ID)) ){
33
          && (h = Get1Resource('DATA',OBFUSCDATA_ID)) ){
34
                HLock(h);
34
                HLock(h);
35
                deobfusc((unsigned char*)*h,GetHandleSize(h),OBFUSC_SEED_POS);
35
                deobfusc((unsigned char*)*h,GetHandleSize(h),OBFUSC_SEED_POS);
-
 
36
                gdata->obfusc = true;
36
        }
37
        }
37
        if(h){
38
        if(h){
38
                HLock(h);
39
                HLock(h);
39
                res = readPARM(*h, &gdata->parm, reason, 0 /*Mac format resource*/);
40
                res = readPARM(*h, &gdata->parm, reason, 0 /*Mac format resource*/);
40
                ReleaseResource(h);
41
                ReleaseResource(h);
-
 
42
                gdata->obfusc = false;
-
 
43
        }
-
 
44
        if (!res) {
-
 
45
                gdata->obfusc = false;
41
        }
46
        }
42
        return res;
47
        return res;
43
}
48
}
44
 
49
 
45
static Boolean readmacplugin(StandardFileReply *sfr,char **reason){
50
static Boolean readmacplugin(StandardFileReply *sfr,char **reason){
Line 59... Line 64...
59
        Boolean readok = false;
64
        Boolean readok = false;
60
        FInfo fndrInfo;
65
        FInfo fndrInfo;
61
 
66
 
62
        if(FSpGetFInfo(&sfr->sfFile,&fndrInfo) == noErr){
67
        if(FSpGetFInfo(&sfr->sfFile,&fndrInfo) == noErr){
63
                // first try to read text parameters (AFS, TXT, PFF)
68
                // first try to read text parameters (AFS, TXT, PFF)
64
                if( (readok = readfile(sfr,reason)) )
69
                if( (readok = readfile(sfr,reason)) ) {
65
                        gdata->parmloaded = false;
70
                        gdata->parmloaded = false;
-
 
71
                        gdata->obfusc = false;
66
                        // then try plugin formats (Mac first, then Windows .8bf or .prm DLL)
72
                        // then try plugin formats (Mac first, then Windows .8bf or .prm DLL)
67
                else if( (readok = readmacplugin(sfr,reason) || read8bfplugin(sfr,reason)) ){
73
                }else if( (readok = readmacplugin(sfr,reason) || read8bfplugin(sfr,reason)) ){
-
 
74
                        if ((gdata->parm.cbSize != PARM_SIZE) && (gdata->parm.cbSize != PARM_SIZE_PREMIERE) && (gdata->parm.cbSize != PARM_SIG_MAC)) {
-
 
75
                                *reason = "Incompatible obfuscation.";
-
 
76
                                return false; // Stop! We know the issue now.
68
                        if(gdata->parm.iProtected){
77
                        }else if(gdata->parm.iProtected){
69
                                *reason = "The filter is protected.";
78
                                *reason = "The filter is protected.";
70
                                return false;
79
                                return false;
71
                        }else
80
                        }else
72
                                gdata->parmloaded = true;
81
                                gdata->parmloaded = true;
73
                }else
82
                }else