Subversion Repositories filter_foundry

Rev

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

Rev 436 Rev 440
Line 36... Line 36...
36
                return false; // we only want the first one
36
                return false; // we only want the first one
37
        }
37
        }
38
        else return true;
38
        else return true;
39
}
39
}
40
 
40
 
41
Boolean readPARMresource(HMODULE hm, char** reason, int readobfusc) {
41
Boolean readPARMresource(HMODULE hm, char** reason) {
42
        HRSRC resinfo;
42
        HRSRC resinfo;
43
        HANDLE h;
43
        HANDLE h;
44
        Ptr pparm;
44
        Ptr pparm;
45
 
45
 
46
        UINT16 parm_id = 1;
46
        UINT16 parm_id = 1;
Line 52... Line 52...
52
                        int res = readPARM(&gdata->parm, pparm);
52
                        int res = readPARM(&gdata->parm, pparm);
53
                        gdata->obfusc = false;
53
                        gdata->obfusc = false;
54
                        return res;
54
                        return res;
55
                }
55
                }
56
        }
56
        }
57
        else if (readobfusc &&
57
        else if (
58
                ((resinfo = FindResource(hm, OBFUSCDATA_ID_NEW, OBFUSCDATA_TYPE_NEW)) ||
58
                ((resinfo = FindResource(hm, OBFUSCDATA_ID_NEW, OBFUSCDATA_TYPE_NEW)) ||
59
                        (resinfo = FindResource(hm, OBFUSCDATA_ID_OLD, OBFUSCDATA_TYPE_OLD)))) {
59
                        (resinfo = FindResource(hm, OBFUSCDATA_ID_OLD, OBFUSCDATA_TYPE_OLD)))) {
60
                if ((h = LoadResource(hm, resinfo)) && (pparm = (Ptr)LockResource(h))) {
60
                if ((h = LoadResource(hm, resinfo)) && (pparm = (Ptr)LockResource(h))) {
61
                        // Fix by DM, 18 Dec 2018:
61
                        // Fix by DM, 18 Dec 2018:
62
                        // We need to copy the information, because the resource data is read-only
62
                        // We need to copy the information, because the resource data is read-only
Line 104... Line 104...
104
 
104
 
105
        // If that didn't work, try to load as Windows image file (Resource API for 8BF/PRM files)
105
        // If that didn't work, try to load as Windows image file (Resource API for 8BF/PRM files)
106
        if (*reason == NULL) {
106
        if (*reason == NULL) {
107
                char name[MAX_PATH + 1];
107
                char name[MAX_PATH + 1];
108
                if (hm = LoadLibraryEx(myp2cstrcpy(name, sfr->sfFile.name), NULL, LOAD_LIBRARY_AS_DATAFILE)) {
108
                if (hm = LoadLibraryEx(myp2cstrcpy(name, sfr->sfFile.name), NULL, LOAD_LIBRARY_AS_DATAFILE)) {
109
                        if (readPARMresource(hm, reason, READ_OBFUSC)) {
109
                        if (readPARMresource(hm, reason)) {
110
                                if (gdata->parm.iProtected) {
110
                                if (gdata->parm.iProtected) {
111
                                        *reason = _strdup("The filter is protected.");
111
                                        *reason = _strdup("The filter is protected.");
112
                                        //gdata->parmloaded = false;
112
                                        //gdata->parmloaded = false;
113
                                }
113
                                }
114
                                else {
114
                                else {