Subversion Repositories filter_foundry

Rev

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

Rev 444 Rev 456
Line 47... Line 47...
47
        EnumResourceNames(hm, PARM_TYPE, enum_find_resname, (LONG_PTR)&parm_id); // callback function enum_find_resname() will find the actual found parm_id
47
        EnumResourceNames(hm, PARM_TYPE, enum_find_resname, (LONG_PTR)&parm_id); // callback function enum_find_resname() will find the actual found parm_id
48
 
48
 
49
        // load first PARM resource
49
        // load first PARM resource
50
        if ((resinfo = FindResource(hm, MAKEINTRESOURCE(parm_id), PARM_TYPE))) {
50
        if ((resinfo = FindResource(hm, MAKEINTRESOURCE(parm_id), PARM_TYPE))) {
51
                if ((h = LoadResource(hm, resinfo)) && (pparm = (Ptr)LockResource(h))) {
51
                if ((h = LoadResource(hm, resinfo)) && (pparm = (Ptr)LockResource(h))) {
52
                        int res = readPARM(&gdata->parm, pparm);
52
                        Boolean 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 (
57
        else if (
Line 60... Line 60...
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
63
                        DWORD resSize = SizeofResource(hm, resinfo);
63
                        DWORD resSize = SizeofResource(hm, resinfo);
64
                        if (resSize == sizeof(PARM_T)) {
64
                        if (resSize == sizeof(PARM_T)) {
65
                                int res;
65
                                Boolean res;
66
                                PARM_T* copy = (PARM_T*)malloc(resSize);
66
                                PARM_T* copy = (PARM_T*)malloc(resSize);
67
                                if (!copy) return false;
67
                                if (!copy) return false;
68
                                memcpy(copy, pparm, resSize);
68
                                memcpy(copy, pparm, resSize);
69
                                deobfusc(copy);
69
                                deobfusc(copy);
70
                                res = readPARM(&gdata->parm, (Ptr)copy);
70
                                res = readPARM(&gdata->parm, (Ptr)copy);