[Mplayer-cvslog] CVS: main/loader module.c,1.17,1.18

Alex Beregszaszi alex at mplayerhq.hu
Thu Jan 29 09:26:17 CET 2004


Update of /cvsroot/mplayer/main/loader
In directory mail:/var2/tmp/cvs-serv30626

Modified Files:
	module.c 
Log Message:
switch to inttypes.h (u_int32_t vs uint32_t) in favour of Solaris9/x86 support

Index: module.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/module.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- module.c	2 Sep 2003 14:40:16 -0000	1.17
+++ module.c	29 Jan 2004 08:26:14 -0000	1.18
@@ -20,7 +20,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/mman.h>
-#include <sys/types.h>
+#include <inttypes.h>
 
 #include "wine/windef.h"
 #include "wine/winerror.h"
@@ -40,8 +40,8 @@
 
 #ifdef EMU_QTX_API
 #include "wrapper.h"
-static int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags);
-static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags);
+static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t *flags);
+static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, uint32_t *flags);
 #endif
 
 //#undef TRACE
@@ -493,6 +493,28 @@
 #endif
 	}
 
+	if (strstr(libname,"vp31vfw.dll") && wm)
+	{
+	    int i;
+
+	    fprintf(stderr, "VP3 DLL found\n");
+	    fprintf(stderr, "patched at: %x - %x\n",
+//		wm->module+0x4bd7, wm->module+0x4bd7+18);
+		wm->module+0x34993-0x1000, wm->module+0x34993-0x1000+18);
+//	    for (i=0;i<18;i++) ((char*)0x10004bd7)[i]=0x90;
+	    for (i=0;i<18;i++) ((char*)(wm->module+/*0x4bd7*/0x34993-0x1000))[i]=0x90;
+	}
+
+	if (strstr(libname,"vp6vfw.dll") && wm)
+	{
+	    int i;
+
+	    fprintf(stderr, "VP6 DLL found\n");
+	    for (i=0;i<6;i++) ((char*)0x10007268)[i]=0x90;
+	    for (i=0;i<6;i++) ((char*)0x10007e83)[i]=0x90;
+	    for (i=0;i<6;i++) ((char*)0x1000806a)[i]=0x90;
+	}
+
 	return wm ? wm->module : 0;
 }
 
@@ -647,10 +669,10 @@
 
 #ifdef EMU_QTX_API
 
-static u_int32_t ret_array[4096];
+static uint32_t ret_array[4096];
 static int ret_i=0;
 
-static int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags)
+static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t *flags)
 {
 #ifdef DEBUG_QTX_API
   int i;
@@ -706,14 +728,14 @@
   printf("FUNC[%X/%s]: wrapper=%p  func=%p  len=%d\n",reg->eax,
       pname?pname:"???",pwrapper,pptr,plen);
 
-  printf("FUNC: caller=%p  ebx=%p\n",((u_int32_t *)stack_base)[0],reg->ebx);
+  printf("FUNC: caller=%p  ebx=%p\n",((uint32_t *)stack_base)[0],reg->ebx);
 
   if(pname)
       printf("%*sENTER(%d): %s(",ret_i*2,"",ret_i,pname);
   else
       printf("%*sENTER(%d): %X(",ret_i*2,"",ret_i,reg->eax);
   for (i=0;i<plen/4;i++){
-    unsigned int val=((u_int32_t *)stack_base)[1+i];
+    unsigned int val=((uint32_t *)stack_base)[1+i];
     unsigned char* fcc=&val;
     printf("%s0x%X", i?", ":"",val);
     if(fcc[0]>=0x20 && fcc[0]<128 &&
@@ -733,24 +755,24 @@
   // memory management:
   case 0x150011: //NewPtrClear
   case 0x150012: //NewPtrSysClear
-      reg->eax=(u_int32_t)malloc(((u_int32_t *)stack_base)[1]);
-      memset((void *)reg->eax,0,((u_int32_t *)stack_base)[1]);
+      reg->eax=(uint32_t)malloc(((uint32_t *)stack_base)[1]);
+      memset((void *)reg->eax,0,((uint32_t *)stack_base)[1]);
 #ifdef DEBUG_QTX_API
       printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
 #endif
       return 1;
   case 0x15000F: //NewPtr
   case 0x150010: //NewPtrSys
-      reg->eax=(u_int32_t)malloc(((u_int32_t *)stack_base)[1]);
+      reg->eax=(uint32_t)malloc(((uint32_t *)stack_base)[1]);
 #ifdef DEBUG_QTX_API
       printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
 #endif
       return 1;
   case 0x15002f: //DisposePtr
-      if(((u_int32_t *)stack_base)[1]>=0x60000000)
+      if(((uint32_t *)stack_base)[1]>=0x60000000)
           printf("WARNING! Invalid Ptr handle!\n");
       else
-          free((void *)((u_int32_t *)stack_base)[1]);
+          free((void *)((uint32_t *)stack_base)[1]);
       reg->eax=0;
 #ifdef DEBUG_QTX_API
       printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
@@ -778,33 +800,33 @@
 #if 0
   switch(reg->eax){
 //  case 0x00010000:
-//      printf("FUNC: ImageCodecInitialize/ImageCodecGetCodecInfo(ci=%p,&icap=%p)\n",((u_int32_t *)stack_base)[1],((u_int32_t *)stack_base)[4]);
+//      printf("FUNC: ImageCodecInitialize/ImageCodecGetCodecInfo(ci=%p,&icap=%p)\n",((uint32_t *)stack_base)[1],((uint32_t *)stack_base)[4]);
 //      break;
   case 0x00010003:
-      printf("FUNC: CountComponents(&desc=%p)\n",((u_int32_t *)stack_base)[1]);
+      printf("FUNC: CountComponents(&desc=%p)\n",((uint32_t *)stack_base)[1]);
       break;
   case 0x00010004:
-      printf("FUNC: FindNextComponent(prev=%p,&desc=%p)\n",((u_int32_t *)stack_base)[1],((u_int32_t *)stack_base)[2]);
+      printf("FUNC: FindNextComponent(prev=%p,&desc=%p)\n",((uint32_t *)stack_base)[1],((uint32_t *)stack_base)[2]);
       break;
   case 0x00010007:
-      printf("FUNC: OpenComponent(prev=%p)\n",((u_int32_t *)stack_base)[1]);
+      printf("FUNC: OpenComponent(prev=%p)\n",((uint32_t *)stack_base)[1]);
       break;
   case 0x0003008b:
       printf("FUNC: QTNewGWorldFromPtr(&pts=%p,fourcc=%.4s,&rect=%p,x1=%p,x2=%p,x3=%p,plane=%p,stride=%d)\n",
-          ((u_int32_t *)stack_base)[1],
-          &(((u_int32_t *)stack_base)[2]),
-          ((u_int32_t *)stack_base)[3],
-          ((u_int32_t *)stack_base)[4],
-          ((u_int32_t *)stack_base)[5],
-          ((u_int32_t *)stack_base)[6],
-          ((u_int32_t *)stack_base)[7],
-          ((u_int32_t *)stack_base)[8]);
+          ((uint32_t *)stack_base)[1],
+          &(((uint32_t *)stack_base)[2]),
+          ((uint32_t *)stack_base)[3],
+          ((uint32_t *)stack_base)[4],
+          ((uint32_t *)stack_base)[5],
+          ((uint32_t *)stack_base)[6],
+          ((uint32_t *)stack_base)[7],
+          ((uint32_t *)stack_base)[8]);
       break;
   case 0x001c0018:
-      printf("FUNC: GetGWorldPixMap(gworld=%p)\n",((u_int32_t *)stack_base)[1]);
+      printf("FUNC: GetGWorldPixMap(gworld=%p)\n",((uint32_t *)stack_base)[1]);
       break;
   case 0x00110001:
-      printf("FUNC: Gestalt(fourcc=%.4s, &ret=%p)\n",&(((u_int32_t *)stack_base)[1]),((u_int32_t *)stack_base)[2]);
+      printf("FUNC: Gestalt(fourcc=%.4s, &ret=%p)\n",&(((uint32_t *)stack_base)[1]),((uint32_t *)stack_base)[2]);
       break;
   default: {
       int i;
@@ -829,34 +851,34 @@
 #endif
 
   // save ret addr:
-  ret_array[ret_i]=((u_int32_t *)stack_base)[0];
+  ret_array[ret_i]=((uint32_t *)stack_base)[0];
   ++ret_i;
 
 #if 0
   // print first 7 longs in the stack (return address, arg[1], arg[2] ... ) 
   printf("stack[] = { ");
   for (i=0;i<7;i++) {
-    printf("%08x ", ((u_int32_t *)stack_base)[i]);
+    printf("%08x ", ((uint32_t *)stack_base)[i]);
   }
   printf("}\n\n");
 #endif
   
 //  // mess with function parameters 
-//  ((u_int32_t *)stack_base)[1] = 0x66554433;
+//  ((uint32_t *)stack_base)[1] = 0x66554433;
 
 //  // mess with return address...
 //  reg->eax = 0x11223344;
     return 0;
 }
 
-static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags)
+static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, uint32_t *flags)
 {
   int i;
   short err;
 
   // restore ret addr:
   --ret_i;
-  ((u_int32_t *)stack_base)[0]=ret_array[ret_i];
+  ((uint32_t *)stack_base)[0]=ret_array[ret_i];
 
 #ifdef DEBUG_QTX_API
 
@@ -882,7 +904,7 @@
   // print first 7 longs in the stack (return address, arg[1], arg[2] ... ) 
   printf("stack[] = { ");
   for (i=0;i<7;i++) {
-    printf("%08x ", ((u_int32_t *)stack_base)[i]);
+    printf("%08x ", ((uint32_t *)stack_base)[i]);
   }
   printf("}\n\n");
 #endif
@@ -890,7 +912,7 @@
 #endif
   
 //  // mess with function parameters 
-//  ((u_int32_t *)stack_base)[1] = 0x66554433;
+//  ((uint32_t *)stack_base)[1] = 0x66554433;
 
 //  // mess with return address...
 //  reg->eax = 0x11223344;




More information about the MPlayer-cvslog mailing list