2001-10-30 23:20:31 +00:00
|
|
|
/* to compile: gcc -o qtxload qtxload.c ../libloader.a -lpthread -ldl -ggdb ../../cpudetect.o */
|
|
|
|
|
2001-10-27 17:45:27 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include "qtxsdk/components.h"
|
|
|
|
|
|
|
|
#define DEF_DISPATCHER(name) ComponentResult (*##name)(struct ComponentParameters *, void **)
|
|
|
|
|
|
|
|
/* ilyen egy sima komponens */
|
|
|
|
ComponentResult ComponentDummy(
|
|
|
|
struct ComponentParameters *params,
|
|
|
|
void **globals,
|
|
|
|
DEF_DISPATCHER(ComponentDispatch))
|
|
|
|
{
|
|
|
|
printf("ComponentDummy(params: %p, globals: %p, dispatcher: %p) called!\n",
|
|
|
|
params, globals, ComponentDispatch);
|
|
|
|
printf(" Dummy: global datas: %p\n", *globals);
|
|
|
|
printf(" Dummy: returning 0\n");
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *get_path()
|
|
|
|
{
|
|
|
|
return(".");
|
|
|
|
}
|
|
|
|
|
2001-10-30 23:20:31 +00:00
|
|
|
main(int argc, char *argv[])
|
2001-10-27 17:45:27 +00:00
|
|
|
{
|
|
|
|
void *handler;
|
|
|
|
void *dispatcher;
|
|
|
|
|
|
|
|
Setup_LDT_Keeper();
|
|
|
|
|
2001-11-08 15:23:22 +00:00
|
|
|
handler = expLoadLibraryA("/usr/lib/win32/QuickTime.qts");
|
|
|
|
dispatcher = GetProcAddress(handler, "SorensonYUV9Dispatcher");
|
2001-10-27 17:45:27 +00:00
|
|
|
printf("handler: %p, dispatcher: %p\n", handler, dispatcher);
|
|
|
|
|
|
|
|
{
|
|
|
|
ComponentResult ret;
|
|
|
|
int (*dispatcher_func)(void *, void *);
|
2001-10-27 18:05:29 +00:00
|
|
|
struct ComponentParameters *params;
|
2001-10-27 17:45:27 +00:00
|
|
|
void *globals;
|
|
|
|
|
2001-10-27 18:05:29 +00:00
|
|
|
dispatcher_func = dispatcher;
|
|
|
|
|
2001-10-27 17:45:27 +00:00
|
|
|
globals = malloc(sizeof(long));
|
|
|
|
(long)*(void **)globals = 0x2001;
|
|
|
|
|
2001-10-27 18:05:29 +00:00
|
|
|
params = malloc(sizeof(struct ComponentParameters));
|
|
|
|
|
2001-10-30 23:20:31 +00:00
|
|
|
params->flags = 2;
|
2001-10-27 18:05:29 +00:00
|
|
|
params->paramSize = sizeof(params);
|
2001-10-30 23:20:31 +00:00
|
|
|
params->what = atoi(argv[1]);
|
2001-10-27 18:05:29 +00:00
|
|
|
params->params[0] = 0x1984;
|
2001-10-27 17:45:27 +00:00
|
|
|
/* 0x1000100f will load QuickTime.qts */
|
|
|
|
/* 0x10001014 will use SendMessageA */
|
|
|
|
/* 0x10001019 returns 0 */
|
|
|
|
/* 0x1000101e will load QuickTime.qts */
|
|
|
|
/* 0x10001028 returns params' addr */
|
|
|
|
/* 0x1000102d is a dialog */
|
|
|
|
/* 0x10001032 returns 20001 => CDVersion */
|
|
|
|
/* 0x10001069 returns 8a */
|
2001-10-30 23:20:31 +00:00
|
|
|
/* 0x100010b4 probarly init ?? */
|
2001-10-27 17:45:27 +00:00
|
|
|
printf("params: flags: %d, paramSize: %d, what: %d\n",
|
2001-10-27 18:05:29 +00:00
|
|
|
params->flags, params->paramSize, params->what);
|
|
|
|
printf("params[0] = %x\n", params->params[0]);
|
2001-10-30 23:20:31 +00:00
|
|
|
ret = dispatcher_func(params, globals);
|
2001-10-27 17:45:27 +00:00
|
|
|
printf("CDComponentDispatch(%p, %p) => %x\n",
|
|
|
|
¶ms, globals, ret);
|
|
|
|
free(globals);
|
2001-10-27 18:05:29 +00:00
|
|
|
free(params);
|
2001-10-27 17:45:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Restore_LDT_Keeper();
|
|
|
|
}
|