[MPlayer-cvslog] r33950 - trunk/loader/module.c

reimar subversion at mplayerhq.hu
Sat Jul 30 22:44:37 CEST 2011


Author: reimar
Date: Sat Jul 30 22:44:37 2011
New Revision: 33950

Log:
Add some runtime patching magic required for latest Cineform decoder.

Modified:
   trunk/loader/module.c

Modified: trunk/loader/module.c
==============================================================================
--- trunk/loader/module.c	Sat Jul 30 22:26:29 2011	(r33949)
+++ trunk/loader/module.c	Sat Jul 30 22:44:37 2011	(r33950)
@@ -435,6 +435,25 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR lib
 	    printf("Win32 LoadLibrary failed to load: %s\n", checked);
 
 #define RVA(x) ((char *)wm->module+(unsigned int)(x))
+	if (strstr(libname, "CFDecode2.ax") && wm)
+	{
+	    if (PE_FindExportedFunction(wm, "DllGetClassObject", TRUE) == RVA(0xd00e0))
+	    {
+	        // Patch some movdqa to movdqu
+	        // It is currently unclear why this is necessary, it seems
+	        // to be some output frame, but our frame seems correctly
+	        // aligned
+	        int offsets[] = {0x7318c, 0x731ba, 0x731e0, 0x731fe, 0};
+	        int i;
+	        for (i = 0; offsets[i]; i++)
+	        {
+	            int ofs = offsets[i];
+	            if (RVA(ofs)[0] == 0x66 && RVA(ofs)[1] == 0x0f &&
+	                RVA(ofs)[2] == 0x7f)
+	                RVA(ofs)[0] = 0xf3;
+	        }
+	    }
+	}
 	if (strstr(libname,"vp31vfw.dll") && wm)
 	{
 	    int i;


More information about the MPlayer-cvslog mailing list