mirror of https://github.com/decompals/wibo.git
ole32
This commit is contained in:
parent
6281fa2da7
commit
916c10543d
1
common.h
1
common.h
|
@ -18,6 +18,7 @@ namespace wibo {
|
||||||
void *resolveVersion(const char *name);
|
void *resolveVersion(const char *name);
|
||||||
void *resolveKernel32(const char *name);
|
void *resolveKernel32(const char *name);
|
||||||
void *resolveUser32(const char *name);
|
void *resolveUser32(const char *name);
|
||||||
|
void *resolveOle32(const char *name);
|
||||||
void *resolveAdvApi32(const char *name);
|
void *resolveAdvApi32(const char *name);
|
||||||
void *resolveLmgr11(uint16_t ordinal);
|
void *resolveLmgr11(uint16_t ordinal);
|
||||||
void *resolveStubByName(const char *dllName, const char *funcName);
|
void *resolveStubByName(const char *dllName, const char *funcName);
|
||||||
|
|
9
main.cpp
9
main.cpp
|
@ -45,11 +45,6 @@ DEFINE_STUBS(3, 0) DEFINE_STUBS(3, 1) DEFINE_STUBS(3, 2) DEFINE_STUBS(3, 3)
|
||||||
#undef DEFINE_STUB
|
#undef DEFINE_STUB
|
||||||
#undef DEFINE_STUBS
|
#undef DEFINE_STUBS
|
||||||
|
|
||||||
uint32_t __attribute__((stdcall)) CoInitialize(void *pvReserved) {
|
|
||||||
DEBUG_LOG("CoInitialize(...)\n");
|
|
||||||
return 0; // S_OK I think?
|
|
||||||
}
|
|
||||||
|
|
||||||
void *wibo::resolveStubByName(const char *dllName, const char *funcName) {
|
void *wibo::resolveStubByName(const char *dllName, const char *funcName) {
|
||||||
if (strcmp(dllName, "KERNEL32.dll") == 0) {
|
if (strcmp(dllName, "KERNEL32.dll") == 0) {
|
||||||
void *func = wibo::resolveKernel32(funcName);
|
void *func = wibo::resolveKernel32(funcName);
|
||||||
|
@ -72,7 +67,9 @@ void *wibo::resolveStubByName(const char *dllName, const char *funcName) {
|
||||||
return func;
|
return func;
|
||||||
}
|
}
|
||||||
if (strcmp(dllName, "ole32.dll") == 0) {
|
if (strcmp(dllName, "ole32.dll") == 0) {
|
||||||
if (strcmp(funcName, "CoInitialize") == 0) return (void *) CoInitialize;
|
void *func = wibo::resolveOle32(funcName);
|
||||||
|
if (func)
|
||||||
|
return func;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_LOG("Missing function: %s (%s)\n", dllName, funcName);
|
DEBUG_LOG("Missing function: %s (%s)\n", dllName, funcName);
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
namespace ole32 {
|
||||||
|
int WIN_FUNC CoInitialize(void *pvReserved) {
|
||||||
|
DEBUG_LOG("CoInitialize(...)\n");
|
||||||
|
return 0; // S_OK
|
||||||
|
}
|
||||||
|
|
||||||
|
struct GUID {
|
||||||
|
unsigned int Data1;
|
||||||
|
unsigned short Data2;
|
||||||
|
unsigned short Data3;
|
||||||
|
unsigned char Data4[8];
|
||||||
|
};
|
||||||
|
|
||||||
|
int WIN_FUNC CoCreateInstance(
|
||||||
|
const GUID *rclsid,
|
||||||
|
void *pUnkOuter,
|
||||||
|
unsigned int dwClsContext,
|
||||||
|
const GUID *riid,
|
||||||
|
void **ppv
|
||||||
|
) {
|
||||||
|
// for mwcc_41_60126:
|
||||||
|
// rclsid = CLSID_ShellLink (0x21401), riid = IID_IShellLinkA (0x214ee)
|
||||||
|
// and then it crashes with a null pointer deref
|
||||||
|
DEBUG_LOG("CoCreateInstance 0x%x %p %d 0x%x %p\n", rclsid->Data1, pUnkOuter, dwClsContext, riid->Data1, *ppv);
|
||||||
|
*ppv = 0;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void *wibo::resolveOle32(const char *name) {
|
||||||
|
if (strcmp(name, "CoInitialize") == 0) return (void *) ole32::CoInitialize;
|
||||||
|
if (strcmp(name, "CoCreateInstance") == 0) return (void *) ole32::CoCreateInstance;
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue