Mercurial > mplayer.hg
comparison loader/qtx/qtxload.c @ 8268:a85040e4b1a0
some new experiments
author | arpi |
---|---|
date | Sun, 24 Nov 2002 21:43:17 +0000 |
parents | 422d65c712a0 |
children | 167342641f0b |
comparison
equal
deleted
inserted
replaced
8267:1ac2523775ad | 8268:a85040e4b1a0 |
---|---|
31 #define __cdecl __attribute__((__cdecl__)) | 31 #define __cdecl __attribute__((__cdecl__)) |
32 #define APIENTRY | 32 #define APIENTRY |
33 | 33 |
34 unsigned int* x_table[0x00001837]; | 34 unsigned int* x_table[0x00001837]; |
35 | 35 |
36 static OSErr (*InitializeQTML)(long flags); | |
37 | |
36 int main(int argc, char *argv[]){ | 38 int main(int argc, char *argv[]){ |
37 void *handler; | 39 void *handler; |
40 void *handler2; | |
41 void* theqtdp=NULL; | |
42 void* compcall=NULL; | |
43 void* compcallws=NULL; | |
38 ComponentResult (* | 44 ComponentResult (* |
39 dispatcher)(ComponentParameters *params, Globals glob); | 45 dispatcher)(ComponentParameters *params, Globals glob); |
40 ComponentResult ret; | 46 ComponentResult ret; |
41 ComponentParameters *params; | 47 ComponentParameters *params; |
42 ComponentDescription desc; | 48 ComponentDescription desc; |
43 void *globals=NULL; | 49 void *globals=NULL; |
44 unsigned int esp=0; | 50 unsigned int esp=0; |
45 int i; | 51 int i; |
46 | 52 |
53 mp_msg_init(); | |
54 mp_msg_set_level(10); | |
55 | |
47 Setup_LDT_Keeper(); | 56 Setup_LDT_Keeper(); |
48 handler = LoadLibraryA("/usr/lib/win32/QuickTime.qts"); | 57 printf("loading qts\n"); |
49 dispatcher = GetProcAddress(handler, "SorensonYUV9Dispatcher"); | 58 // handler = LoadLibraryA("/root/.wine/fake_windows/Windows/System/QuickTime.qts"); |
59 handler = LoadLibraryA("QuickTime.qts"); | |
60 theqtdp = GetProcAddress(handler, "theQuickTimeDispatcher"); | |
61 compcall = GetProcAddress(handler, "_CallComponent"); | |
62 compcallws = GetProcAddress(handler, "_CallComponentFunctionWithStorage"); | |
63 | |
64 InitializeQTML = 0x6299e590;//GetProcAddress(handler, "InitializeQTML"); | |
65 InitializeQTML(6+16); | |
66 | |
67 printf("loading svq3\n"); | |
68 handler2= LoadLibraryA("/root/.wine/fake_windows/Windows/System/QuickTime/QuickTimeEssentials.qtx"); | |
69 printf("done\n"); | |
70 dispatcher = GetProcAddress(handler2, "SMD_ComponentDispatch"); | |
50 // handler = expLoadLibraryA("/usr/lib/win32/On2_VP3.qtx"); | 71 // handler = expLoadLibraryA("/usr/lib/win32/On2_VP3.qtx"); |
51 // dispatcher = GetProcAddress(handler, "CDComponentDispatcher"); | 72 // dispatcher = GetProcAddress(handler, "CDComponentDispatcher"); |
52 printf("handler: %p, dispatcher: %p\n", handler, dispatcher); | 73 printf("handler: %p, dispatcher: %p theqtdp: %p\n", handler, dispatcher, theqtdp); |
53 | 74 |
54 printf("theQuickTimeDispatcher = %p\n",GetProcAddress(handler, "theQuickTimeDispatcher")); | 75 // printf("theQuickTimeDispatcher = %p\n",GetProcAddress(handler, "theQuickTimeDispatcher")); |
76 | |
77 // patch svq3 dll: | |
78 *((void**)0x63214c98) = NULL; | |
79 *((void**)0x63214c9c) = theqtdp; // theQt... | |
80 *((void**)0x63214ca0) = compcall; //0xdeadbeef; //dispatcher; // CallCOmponent_ptr | |
81 *((void**)0x63214ca4) = compcallws; //0xdeadbef2; //dispatcher; // CallComponentWithStorage_ptr | |
55 | 82 |
56 desc.componentType=0; | 83 desc.componentType=0; |
57 desc.componentSubType=0; | 84 desc.componentSubType=0; |
58 desc.componentManufacturer=0; | 85 desc.componentManufacturer=0; |
59 desc.componentFlags=0; | 86 desc.componentFlags=0; |
60 desc.componentFlagsMask=0; | 87 desc.componentFlagsMask=0; |
61 | 88 |
62 params = malloc(sizeof(ComponentParameters)+2048); | 89 params = malloc(sizeof(ComponentParameters)+2048); |
63 | 90 |
64 params->flags = 0; | 91 params->flags = 0; |
65 params->paramSize = 0; | 92 params->paramSize = 4; |
66 params->what = kComponentRegisterSelect; | 93 params->what = kComponentOpenSelect; |
94 params->params[0] = 0x830000; //0x820000|i; //(i<<16)|0x24; //0x820024; | |
67 ret = dispatcher(params, &globals); | 95 ret = dispatcher(params, &globals); |
68 printf("!!! CDComponentDispatch() => 0x%X glob=%p\n",ret,globals); | 96 printf("!!! CDComponentDispatch() => 0x%X glob=%p\n",ret,globals); |
69 | 97 |
70 // memset(x_table,12,4*0x00001837); | 98 // memset(x_table,12,4*0x00001837); |
71 | 99 |
72 //for(i=0;i<=255;i++){ | 100 //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; | |
76 | 101 |
77 // params->what = kComponentVersionSelect; | 102 // params->what = kComponentVersionSelect; |
78 // params->what = kComponentRegisterSelect; | 103 // params->what = kComponentRegisterSelect; |
79 params->what = kComponentOpenSelect; | 104 // params->what = kComponentOpenSelect; |
80 // params->what = kComponentCanDoSelect; | 105 // params->what = kComponentCanDoSelect; |
81 | 106 |
82 printf("params: flags: %d, paramSize: %d, what: %d, params[0] = %x\n", | 107 printf("params: flags: %d, paramSize: %d, what: %d, params[0] = %x\n", |
83 params->flags, params->paramSize, params->what, params->params[0]); | 108 params->flags, params->paramSize, params->what, params->params[0]); |
84 | 109 |