mirror of
https://github.com/mpv-player/mpv
synced 2025-01-08 16:10:29 +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 */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "qtxsdk/components.h"
|
||||
#include "qtxsdk/select.h"
|
||||
|
||||
@ -19,55 +22,63 @@ ComponentResult ComponentDummy(
|
||||
return(0);
|
||||
}
|
||||
|
||||
char *get_path()
|
||||
{
|
||||
return(".");
|
||||
}
|
||||
char *get_path(char* x){ return strdup(x);}
|
||||
|
||||
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;
|
||||
ComponentResult (*
|
||||
dispatcher)(ComponentParameters *params, void* glob);
|
||||
ComponentResult (APIENTRY *
|
||||
dispatcher)(ComponentParameters *params, Globals glob);
|
||||
ComponentResult ret;
|
||||
ComponentParameters *params;
|
||||
ComponentDescription desc;
|
||||
void *globals=NULL;
|
||||
unsigned int esp=0;
|
||||
|
||||
Setup_LDT_Keeper();
|
||||
|
||||
handler = expLoadLibraryA("/usr/lib/win32/QuickTime.qts");
|
||||
dispatcher = GetProcAddress(handler, "SorensonYUV9Dispatcher");
|
||||
// handler = expLoadLibraryA("/usr/lib/win32/On2_VP3.qtx");
|
||||
// dispatcher = GetProcAddress(handler, "CDComponentDispatcher");
|
||||
printf("handler: %p, dispatcher: %p\n", handler, dispatcher);
|
||||
|
||||
desc.componentType=0;
|
||||
desc.componentSubType=0;
|
||||
desc.componentManufacturer=0;
|
||||
desc.componentFlags=0;
|
||||
desc.componentFlagsMask=0;
|
||||
|
||||
{
|
||||
ComponentResult ret;
|
||||
ComponentParameters *params;
|
||||
void *globals;
|
||||
|
||||
globals = malloc(sizeof(long));
|
||||
(long)*(void **)globals = 0x2001;
|
||||
params = malloc(sizeof(ComponentParameters)+2048);
|
||||
|
||||
params = malloc(sizeof(ComponentParameters));
|
||||
params->flags = 0;
|
||||
params->paramSize = sizeof(params->params[0]);
|
||||
params->params[0] = 0x12345678;
|
||||
|
||||
params->flags = 0;
|
||||
params->paramSize = sizeof(params);
|
||||
params->what = kComponentVersionSelect;
|
||||
// params->what = kComponentRegisterSelect;
|
||||
// params->what = kComponentOpenSelect;
|
||||
// params->what = -5; //atoi(argv[1]);
|
||||
// params->what = kComponentVersionSelect;
|
||||
// params->what = kComponentRegisterSelect;
|
||||
params->what = kComponentOpenSelect;
|
||||
// params->what = kComponentCanDoSelect;
|
||||
|
||||
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",
|
||||
params->flags, params->paramSize, params->what);
|
||||
printf("params[0] = %x\n", params->params[0]);
|
||||
__asm__ __volatile__ ("movl %%esp, %0\n\t" : "=a" (esp) :: "memory" );
|
||||
printf("ESP=%p\n",esp);
|
||||
|
||||
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",
|
||||
// ¶ms, globals, ret);
|
||||
// free(globals);
|
||||
// free(params);
|
||||
}
|
||||
printf("!!! CDComponentDispatch() => 0x%X glob=%p\n",ret,globals);
|
||||
|
||||
// Restore_LDT_Keeper();
|
||||
Restore_LDT_Keeper();
|
||||
exit(0);
|
||||
//return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user