1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 07:12:39 +00:00

more mess

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3936 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-01-01 23:18:17 +00:00
parent 0cce2a7b35
commit 7691e1a8b4

View File

@ -24,30 +24,35 @@ ComponentResult ComponentDummy(
char *get_path(char* x){ return strdup(x);} char *get_path(char* x){ return strdup(x);}
void* expLoadLibraryA(char* name); void* LoadLibraryA(char* name);
void* GetProcAddress(void* handle,char* func); void* GetProcAddress(void* handle,char* func);
#define __stdcall __attribute__((__stdcall__)) #define __stdcall __attribute__((__stdcall__))
#define __cdecl __attribute__((__cdecl__)) #define __cdecl __attribute__((__cdecl__))
#define APIENTRY #define APIENTRY
unsigned int* x_table[0x00001837];
int main(int argc, char *argv[]){ int main(int argc, char *argv[]){
void *handler; void *handler;
ComponentResult (APIENTRY * ComponentResult (*
dispatcher)(ComponentParameters *params, Globals glob); dispatcher)(ComponentParameters *params, Globals glob);
ComponentResult ret; ComponentResult ret;
ComponentParameters *params; ComponentParameters *params;
ComponentDescription desc; ComponentDescription desc;
void *globals=NULL; void *globals=NULL;
unsigned int esp=0; unsigned int esp=0;
int i;
Setup_LDT_Keeper(); Setup_LDT_Keeper();
handler = expLoadLibraryA("/usr/lib/win32/QuickTime.qts"); handler = LoadLibraryA("/usr/lib/win32/QuickTime.qts");
dispatcher = GetProcAddress(handler, "SorensonYUV9Dispatcher"); dispatcher = GetProcAddress(handler, "SorensonYUV9Dispatcher");
// handler = expLoadLibraryA("/usr/lib/win32/On2_VP3.qtx"); // handler = expLoadLibraryA("/usr/lib/win32/On2_VP3.qtx");
// dispatcher = GetProcAddress(handler, "CDComponentDispatcher"); // dispatcher = GetProcAddress(handler, "CDComponentDispatcher");
printf("handler: %p, dispatcher: %p\n", handler, dispatcher); printf("handler: %p, dispatcher: %p\n", handler, dispatcher);
printf("theQuickTimeDispatcher = %p\n",GetProcAddress(handler, "theQuickTimeDispatcher"));
desc.componentType=0; desc.componentType=0;
desc.componentSubType=0; desc.componentSubType=0;
desc.componentManufacturer=0; desc.componentManufacturer=0;
@ -57,8 +62,17 @@ dispatcher)(ComponentParameters *params, Globals glob);
params = malloc(sizeof(ComponentParameters)+2048); params = malloc(sizeof(ComponentParameters)+2048);
params->flags = 0; params->flags = 0;
params->paramSize = sizeof(params->params[0]); params->paramSize = 0;
params->params[0] = 0x12345678; params->what = kComponentRegisterSelect;
ret = dispatcher(params, &globals);
printf("!!! CDComponentDispatch() => 0x%X glob=%p\n",ret,globals);
// memset(x_table,12,4*0x00001837);
//for(i=0;i<=255;i++){
params->flags = 0;
params->paramSize = 4; //sizeof(params->params[0]);
params->params[0] = 0x820000; //0x820000|i; //(i<<16)|0x24; //0x820024;
// params->what = kComponentVersionSelect; // params->what = kComponentVersionSelect;
// params->what = kComponentRegisterSelect; // params->what = kComponentRegisterSelect;
@ -68,15 +82,24 @@ dispatcher)(ComponentParameters *params, Globals glob);
printf("params: flags: %d, paramSize: %d, what: %d, params[0] = %x\n", printf("params: flags: %d, paramSize: %d, what: %d, params[0] = %x\n",
params->flags, params->paramSize, params->what, params->params[0]); params->flags, params->paramSize, params->what, params->params[0]);
__asm__ __volatile__ ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" ); // __asm__ __volatile__ ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" );
printf("ESP=%p\n",esp); // printf("ESP=%p\n",esp);
*((void**)0x62b7d640) = &x_table[0]; //malloc(0x00001837 * 4); // ugly hack?
printf("params=%p &glob=%p x_table=%p\n",params,&globals, &x_table[0]);
ret = dispatcher(params, &globals); ret = dispatcher(params, &globals);
__asm__ __volatile__ ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" ); // __asm__ __volatile__ ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" );
printf("ESP=%p\n",esp); // printf("ESP=%p\n",esp);
printf("!!! CDComponentDispatch() => 0x%X glob=%p\n",ret,globals); printf("!!! CDComponentDispatch() => %d glob=%p\n",ret,globals);
// if(ret!=-3000) break;
//}
// for(i=0;i<0x00001837;i++)
// if(x_table[i]) printf("x_table[0x%X] = %p\n",i,x_table[i]);
Restore_LDT_Keeper(); Restore_LDT_Keeper();
exit(0); exit(0);