mirror of
https://github.com/mpv-player/mpv
synced 2025-02-03 13:41:49 +00:00
still sig11
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2797 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
34dcb46be7
commit
67ebcf2aaf
@ -1,6 +1,9 @@
|
|||||||
/* to compile: gcc -o qtxload qtxload.c ../libloader.a -lpthread -ldl -ggdb ../../cpudetect.o */
|
/* to compile: gcc -o qtxload qtxload.c ../libloader.a -lpthread -ldl -ggdb ../../cpudetect.o */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "qtxsdk/components.h"
|
#include "qtxsdk/components.h"
|
||||||
#include "qtxsdk/select.h"
|
#include "qtxsdk/select.h"
|
||||||
|
|
||||||
@ -19,55 +22,63 @@ ComponentResult ComponentDummy(
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *get_path()
|
char *get_path(char* x){ return strdup(x);}
|
||||||
{
|
|
||||||
return(".");
|
|
||||||
}
|
|
||||||
|
|
||||||
main(int argc, char *argv[])
|
void* expLoadLibraryA(char* name);
|
||||||
{
|
void* GetProcAddress(void* handle,char* func);
|
||||||
|
|
||||||
|
#define __stdcall __attribute__((__stdcall__))
|
||||||
|
#define __cdecl __attribute__((__cdecl__))
|
||||||
|
#define APIENTRY
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]){
|
||||||
void *handler;
|
void *handler;
|
||||||
ComponentResult (*
|
ComponentResult (APIENTRY *
|
||||||
dispatcher)(ComponentParameters *params, void* glob);
|
dispatcher)(ComponentParameters *params, Globals glob);
|
||||||
|
ComponentResult ret;
|
||||||
|
ComponentParameters *params;
|
||||||
|
ComponentDescription desc;
|
||||||
|
void *globals=NULL;
|
||||||
|
unsigned int esp=0;
|
||||||
|
|
||||||
Setup_LDT_Keeper();
|
Setup_LDT_Keeper();
|
||||||
|
|
||||||
handler = expLoadLibraryA("/usr/lib/win32/QuickTime.qts");
|
handler = expLoadLibraryA("/usr/lib/win32/QuickTime.qts");
|
||||||
dispatcher = GetProcAddress(handler, "SorensonYUV9Dispatcher");
|
dispatcher = GetProcAddress(handler, "SorensonYUV9Dispatcher");
|
||||||
|
// handler = expLoadLibraryA("/usr/lib/win32/On2_VP3.qtx");
|
||||||
|
// dispatcher = GetProcAddress(handler, "CDComponentDispatcher");
|
||||||
printf("handler: %p, dispatcher: %p\n", handler, dispatcher);
|
printf("handler: %p, dispatcher: %p\n", handler, dispatcher);
|
||||||
|
|
||||||
{
|
desc.componentType=0;
|
||||||
ComponentResult ret;
|
desc.componentSubType=0;
|
||||||
ComponentParameters *params;
|
desc.componentManufacturer=0;
|
||||||
void *globals;
|
desc.componentFlags=0;
|
||||||
|
desc.componentFlagsMask=0;
|
||||||
|
|
||||||
globals = malloc(sizeof(long));
|
params = malloc(sizeof(ComponentParameters)+2048);
|
||||||
(long)*(void **)globals = 0x2001;
|
|
||||||
|
|
||||||
params = malloc(sizeof(ComponentParameters));
|
params->flags = 0;
|
||||||
|
params->paramSize = sizeof(params->params[0]);
|
||||||
|
params->params[0] = 0x12345678;
|
||||||
|
|
||||||
params->flags = 0;
|
// params->what = kComponentVersionSelect;
|
||||||
params->paramSize = sizeof(params);
|
// params->what = kComponentRegisterSelect;
|
||||||
params->what = kComponentVersionSelect;
|
params->what = kComponentOpenSelect;
|
||||||
// params->what = kComponentRegisterSelect;
|
// params->what = kComponentCanDoSelect;
|
||||||
// params->what = kComponentOpenSelect;
|
|
||||||
// params->what = -5; //atoi(argv[1]);
|
|
||||||
|
|
||||||
params->params[0] = 0x1984;
|
printf("params: flags: %d, paramSize: %d, what: %d, params[0] = %x\n",
|
||||||
|
params->flags, params->paramSize, params->what, params->params[0]);
|
||||||
|
|
||||||
printf("params: flags: %d, paramSize: %d, what: %d\n",
|
__asm__ __volatile__ ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" );
|
||||||
params->flags, params->paramSize, params->what);
|
printf("ESP=%p\n",esp);
|
||||||
printf("params[0] = %x\n", params->params[0]);
|
|
||||||
|
|
||||||
ret = dispatcher(params, globals);
|
ret = dispatcher(params, &globals);
|
||||||
|
|
||||||
printf("!!! CDComponentDispatch() => %x\n",ret);
|
__asm__ __volatile__ ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" );
|
||||||
|
printf("ESP=%p\n",esp);
|
||||||
|
|
||||||
// printf("!!! CDComponentDispatch(%p, %p) => %x\n",
|
printf("!!! CDComponentDispatch() => 0x%X glob=%p\n",ret,globals);
|
||||||
// ¶ms, globals, ret);
|
|
||||||
// free(globals);
|
|
||||||
// free(params);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Restore_LDT_Keeper();
|
Restore_LDT_Keeper();
|
||||||
|
exit(0);
|
||||||
|
//return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user