comparison loader/qtx/qtxload.c @ 3935:422d65c712a0

more mess
author arpi
date Tue, 01 Jan 2002 23:18:17 +0000
parents 8671d43c1078
children a85040e4b1a0
comparison
equal deleted inserted replaced
3934:e8e7ca8995a1 3935:422d65c712a0
22 return(0); 22 return(0);
23 } 23 }
24 24
25 char *get_path(char* x){ return strdup(x);} 25 char *get_path(char* x){ return strdup(x);}
26 26
27 void* expLoadLibraryA(char* name); 27 void* LoadLibraryA(char* name);
28 void* GetProcAddress(void* handle,char* func); 28 void* GetProcAddress(void* handle,char* func);
29 29
30 #define __stdcall __attribute__((__stdcall__)) 30 #define __stdcall __attribute__((__stdcall__))
31 #define __cdecl __attribute__((__cdecl__)) 31 #define __cdecl __attribute__((__cdecl__))
32 #define APIENTRY 32 #define APIENTRY
33 33
34 unsigned int* x_table[0x00001837];
35
34 int main(int argc, char *argv[]){ 36 int main(int argc, char *argv[]){
35 void *handler; 37 void *handler;
36 ComponentResult (APIENTRY * 38 ComponentResult (*
37 dispatcher)(ComponentParameters *params, Globals glob); 39 dispatcher)(ComponentParameters *params, Globals glob);
38 ComponentResult ret; 40 ComponentResult ret;
39 ComponentParameters *params; 41 ComponentParameters *params;
40 ComponentDescription desc; 42 ComponentDescription desc;
41 void *globals=NULL; 43 void *globals=NULL;
42 unsigned int esp=0; 44 unsigned int esp=0;
45 int i;
43 46
44 Setup_LDT_Keeper(); 47 Setup_LDT_Keeper();
45 handler = expLoadLibraryA("/usr/lib/win32/QuickTime.qts"); 48 handler = LoadLibraryA("/usr/lib/win32/QuickTime.qts");
46 dispatcher = GetProcAddress(handler, "SorensonYUV9Dispatcher"); 49 dispatcher = GetProcAddress(handler, "SorensonYUV9Dispatcher");
47 // handler = expLoadLibraryA("/usr/lib/win32/On2_VP3.qtx"); 50 // handler = expLoadLibraryA("/usr/lib/win32/On2_VP3.qtx");
48 // dispatcher = GetProcAddress(handler, "CDComponentDispatcher"); 51 // dispatcher = GetProcAddress(handler, "CDComponentDispatcher");
49 printf("handler: %p, dispatcher: %p\n", handler, dispatcher); 52 printf("handler: %p, dispatcher: %p\n", handler, dispatcher);
53
54 printf("theQuickTimeDispatcher = %p\n",GetProcAddress(handler, "theQuickTimeDispatcher"));
50 55
51 desc.componentType=0; 56 desc.componentType=0;
52 desc.componentSubType=0; 57 desc.componentSubType=0;
53 desc.componentManufacturer=0; 58 desc.componentManufacturer=0;
54 desc.componentFlags=0; 59 desc.componentFlags=0;
55 desc.componentFlagsMask=0; 60 desc.componentFlagsMask=0;
56 61
57 params = malloc(sizeof(ComponentParameters)+2048); 62 params = malloc(sizeof(ComponentParameters)+2048);
58 63
59 params->flags = 0; 64 params->flags = 0;
60 params->paramSize = sizeof(params->params[0]); 65 params->paramSize = 0;
61 params->params[0] = 0x12345678; 66 params->what = kComponentRegisterSelect;
67 ret = dispatcher(params, &globals);
68 printf("!!! CDComponentDispatch() => 0x%X glob=%p\n",ret,globals);
69
70 // memset(x_table,12,4*0x00001837);
71
72 //for(i=0;i<=255;i++){
73 params->flags = 0;
74 params->paramSize = 4; //sizeof(params->params[0]);
75 params->params[0] = 0x820000; //0x820000|i; //(i<<16)|0x24; //0x820024;
62 76
63 // params->what = kComponentVersionSelect; 77 // params->what = kComponentVersionSelect;
64 // params->what = kComponentRegisterSelect; 78 // params->what = kComponentRegisterSelect;
65 params->what = kComponentOpenSelect; 79 params->what = kComponentOpenSelect;
66 // params->what = kComponentCanDoSelect; 80 // params->what = kComponentCanDoSelect;
67 81
68 printf("params: flags: %d, paramSize: %d, what: %d, params[0] = %x\n", 82 printf("params: flags: %d, paramSize: %d, what: %d, params[0] = %x\n",
69 params->flags, params->paramSize, params->what, params->params[0]); 83 params->flags, params->paramSize, params->what, params->params[0]);
70 84
71 __asm__ __volatile__ ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" ); 85 // __asm__ __volatile__ ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" );
72 printf("ESP=%p\n",esp); 86 // printf("ESP=%p\n",esp);
87
88 *((void**)0x62b7d640) = &x_table[0]; //malloc(0x00001837 * 4); // ugly hack?
89
90 printf("params=%p &glob=%p x_table=%p\n",params,&globals, &x_table[0]);
73 91
74 ret = dispatcher(params, &globals); 92 ret = dispatcher(params, &globals);
75 93
76 __asm__ __volatile__ ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" ); 94 // __asm__ __volatile__ ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" );
77 printf("ESP=%p\n",esp); 95 // printf("ESP=%p\n",esp);
78 96
79 printf("!!! CDComponentDispatch() => 0x%X glob=%p\n",ret,globals); 97 printf("!!! CDComponentDispatch() => %d glob=%p\n",ret,globals);
98 // if(ret!=-3000) break;
99 //}
100
101 // for(i=0;i<0x00001837;i++)
102 // if(x_table[i]) printf("x_table[0x%X] = %p\n",i,x_table[i]);
80 103
81 Restore_LDT_Keeper(); 104 Restore_LDT_Keeper();
82 exit(0); 105 exit(0);
83 //return 0; 106 //return 0;
84 } 107 }