5 #include "qtxsdk/components.h"
6 #include "qtxsdk/select.h"
7 #include "ldt_keeper.h"
10 /* this is what a plain component looks like */
11 ComponentResult
ComponentDummy(
12 ComponentParameters
*params
,
14 ComponentResult (*ComponentDispatch
)(ComponentParameters
*, void **))
16 printf("ComponentDummy(params: %p, globals: %p, dispatcher: %p) called!\n",
17 params
, globals
, ComponentDispatch
);
18 printf(" Dummy: global datas: %p\n", *globals
);
19 printf(" Dummy: returning 0\n");
23 char *get_path(const char* x
){ return strdup(x
);}
25 void* LoadLibraryA(char* name
);
26 void* GetProcAddress(void* handle
,char* func
);
28 #define __stdcall __attribute__((__stdcall__))
29 #define __cdecl __attribute__((__cdecl__))
32 unsigned int* x_table
[0x00001837];
34 static OSErr (*InitializeQTML
)(long flags
);
41 void* compcallws
=NULL
;
42 ComponentResult (*dispatcher
)(ComponentParameters
*params
, Globals glob
);
44 ComponentParameters
*params
;
45 ComponentDescription desc
;
51 //mp_msg_set_level(10);
54 printf("loading qts\n");
55 // handler = LoadLibraryA("/root/.wine/fake_windows/Windows/System/QuickTime.qts");
56 handler
= LoadLibraryA("QuickTime.qts");
57 theqtdp
= GetProcAddress(handler
, "theQuickTimeDispatcher");
58 compcall
= GetProcAddress(handler
, "CallComponent");
59 compcallws
= GetProcAddress(handler
, "CallComponentFunctionWithStorage");
61 InitializeQTML
= 0x6299e590;//GetProcAddress(handler, "InitializeQTML");
64 printf("loading svq3\n");
65 handler2
= LoadLibraryA("/root/.wine/fake_windows/Windows/System/QuickTime/QuickTimeEssentials.qtx");
67 dispatcher
= GetProcAddress(handler2
, "SMD_ComponentDispatch");
68 // handler = expLoadLibraryA("/usr/local/lib/codecs/On2_VP3.qtx");
69 // dispatcher = GetProcAddress(handler, "CDComponentDispatcher");
70 printf("handler: %p, dispatcher: %p theqtdp: %p\n", handler
, dispatcher
, theqtdp
);
72 // printf("theQuickTimeDispatcher = %p\n",GetProcAddress(handler, "theQuickTimeDispatcher"));
75 *((void**)0x63214c98) = NULL
;
76 *((void**)0x63214c9c) = theqtdp
; // theQt...
77 *((void**)0x63214ca0) = compcall
; //0xdeadbeef; //dispatcher; // CallCOmponent_ptr
78 *((void**)0x63214ca4) = compcallws
; //0xdeadbef2; //dispatcher; // CallComponentWithStorage_ptr
81 desc
.componentSubType
=0;
82 desc
.componentManufacturer
=0;
83 desc
.componentFlags
=0;
84 desc
.componentFlagsMask
=0;
86 params
= malloc(sizeof(ComponentParameters
)+2048);
89 params
->paramSize
= 4;
90 params
->what
= kComponentOpenSelect
;
91 params
->params
[0] = 0x830000; //0x820000|i; //(i<<16)|0x24; //0x820024;
92 ret
= dispatcher(params
, &globals
);
93 printf("!!! CDComponentDispatch() => 0x%X glob=%p\n",ret
,globals
);
95 // memset(x_table,12,4*0x00001837);
97 //for(i=0;i<=255;i++){
99 // params->what = kComponentVersionSelect;
100 // params->what = kComponentRegisterSelect;
101 // params->what = kComponentOpenSelect;
102 // params->what = kComponentCanDoSelect;
104 printf("params: flags: %d, paramSize: %d, what: %d, params[0] = %x\n",
105 params
->flags
, params
->paramSize
, params
->what
, params
->params
[0]);
107 // __asm__ volatile ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" );
108 // printf("ESP=%p\n",esp);
110 *((void**)0x62b7d640) = &x_table
[0]; //malloc(0x00001837 * 4); // ugly hack?
112 printf("params=%p &glob=%p x_table=%p\n",params
,&globals
, &x_table
[0]);
114 ret
= dispatcher(params
, &globals
);
116 // __asm__ volatile ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" );
117 // printf("ESP=%p\n",esp);
119 printf("!!! CDComponentDispatch() => %d glob=%p\n",ret
,globals
);
120 // if(ret!=-3000) break;
123 // for(i=0;i<0x00001837;i++)
124 // if(x_table[i]) printf("x_table[0x%X] = %p\n",i,x_table[i]);