本文整理汇总了C++中LibraryLoader::ResolveExport方法的典型用法代码示例。如果您正苦于以下问题:C++ LibraryLoader::ResolveExport方法的具体用法?C++ LibraryLoader::ResolveExport怎么用?C++ LibraryLoader::ResolveExport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibraryLoader
的用法示例。
在下文中一共展示了LibraryLoader::ResolveExport方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void *xbp_dlsym(void *handle, const char *symbol)
{
LibraryLoader *pDll = (LibraryLoader*)handle;
CLog::Log(LOGDEBUG,"%s - load symbol %s", __FUNCTION__, symbol);
void *f = NULL;
if (pDll && pDll->ResolveExport(symbol, &f))
return f;
return NULL;
}
示例2: if
extern "C" FARPROC __stdcall dllGetProcAddress(HMODULE hModule, LPCSTR function)
{
uintptr_t loc = (uintptr_t)_ReturnAddress();
void* address = NULL;
LibraryLoader* dll = DllLoaderContainer::GetModule(hModule);
if( !dll )
{
CLog::Log(LOGERROR, "%s - Invalid hModule specified",__FUNCTION__);
return NULL;
}
/* how can somebody get the stupid idea to create such a stupid function */
/* where you never know if the given pointer is a pointer or a value */
if( HIGH_WORD(function) == 0 && LOW_WORD(function) < 1000)
{
if( dll->ResolveOrdinal(LOW_WORD(function), &address) )
{
CLog::Log(LOGDEBUG, "%s(%p(%s), %d) => %p", __FUNCTION__, hModule, dll->GetName(), LOW_WORD(function), address);
}
else if( dll->IsSystemDll() )
{
char ordinal[5];
sprintf(ordinal, "%d", LOW_WORD(function));
address = (void*)create_dummy_function(dll->GetName(), ordinal);
/* add to tracklist if we are tracking this source dll */
DllTrackInfo* track = tracker_get_dlltrackinfo(loc);
if( track )
tracker_dll_data_track(track->pDll, (uintptr_t)address);
CLog::Log(LOGDEBUG, "%s - created dummy function %s!%s",__FUNCTION__, dll->GetName(), ordinal);
}
else
{
address = NULL;
CLog::Log(LOGDEBUG, "%s(%p(%s), '%s') => %p",__FUNCTION__ , hModule, dll->GetName(), function, address);
}
}
else
{
if( dll->ResolveExport(function, &address) )
{
CLog::Log(LOGDEBUG, "%s(%p(%s), '%s') => %p",__FUNCTION__ , hModule, dll->GetName(), function, address);
}
else
{
DllTrackInfo* track = tracker_get_dlltrackinfo(loc);
/* some dll's require us to always return a function or it will fail, other's */
/* decide functionallity depending on if the functions exist and may fail */
if( dll->IsSystemDll() && track
&& stricmp(track->pDll->GetName(), "CoreAVCDecoder.ax") == 0 )
{
address = (void*)create_dummy_function(dll->GetName(), function);
tracker_dll_data_track(track->pDll, (uintptr_t)address);
CLog::Log(LOGDEBUG, "%s - created dummy function %s!%s", __FUNCTION__, dll->GetName(), function);
}
else
{
address = NULL;
CLog::Log(LOGDEBUG, "%s(%p(%s), '%s') => %p", __FUNCTION__, hModule, dll->GetName(), function, address);
}
}
}
return (FARPROC)address;
}
示例3: python_load_dll
bool python_load_dll(LibraryLoader& dll)
{
bool bResult;
bResult = (
dll.ResolveExport(DLL_FUNCTION(PyEval_ReleaseLock)) &&
dll.ResolveExport(DLL_FUNCTION(PyEval_AcquireLock)) &&
dll.ResolveExport(DLL_FUNCTION(PyThreadState_Get)) &&
dll.ResolveExport(DLL_FUNCTION(PyRun_SimpleString)) &&
dll.ResolveExport(DLL_FUNCTION(PyEval_InitThreads)) &&
dll.ResolveExport(DLL_FUNCTION(PyEval_ThreadsInitialized)) &&
dll.ResolveExport(DLL_FUNCTION(Py_Initialize)) &&
dll.ResolveExport(DLL_FUNCTION(Py_IsInitialized)) &&
dll.ResolveExport(DLL_FUNCTION(Py_Finalize)) &&
dll.ResolveExport(DLL_FUNCTION(Py_NewInterpreter)) &&
dll.ResolveExport(DLL_FUNCTION(Py_EndInterpreter)) &&
dll.ResolveExport(DLL_FUNCTION(PyThreadState_Swap)) &&
dll.ResolveExport(DLL_FUNCTION(PyErr_SetString)) &&
dll.ResolveExport(DLL_FUNCTION(PyThreadState_New)) &&
dll.ResolveExport(DLL_FUNCTION(PyErr_Print)) &&
dll.ResolveExport(DLL_FUNCTION(PyErr_Occurred)) &&
dll.ResolveExport(DLL_FUNCTION(PyRun_SimpleFile)) &&
dll.ResolveExport(DLL_FUNCTION(PySys_SetPath)) &&
dll.ResolveExport(DLL_FUNCTION(Py_GetPath)) &&
dll.ResolveExport(DLL_FUNCTION(PyThreadState_Delete)) &&
dll.ResolveExport(DLL_FUNCTION(PyThreadState_Clear)) &&
dll.ResolveExport(DLL_VA_FUNCTION(Py_BuildValue)) &&
dll.ResolveExport(DLL_FUNCTION(PyType_IsSubtype)) &&
dll.ResolveExport(DLL_VA_FUNCTION(PyArg_ParseTupleAndKeywords)) &&
dll.ResolveExport(DLL_FUNCTION(PyString_AsString)) &&
dll.ResolveExport(DLL_FUNCTION(Py_AddPendingCall)) &&
dll.ResolveExport(DLL_VA_FUNCTION(PyObject_CallMethod)) &&
dll.ResolveExport(DLL_FUNCTION(PyList_GetItem)) &&
dll.ResolveExport(DLL_FUNCTION(PyList_Size)) &&
dll.ResolveExport(DLL_FUNCTION(PyList_New)) &&
dll.ResolveExport(DLL_FUNCTION(PyList_Append)) &&
dll.ResolveExport(DLL_FUNCTION(_PyObject_New)) &&
dll.ResolveExport(DLL_FUNCTION(PyLong_AsLong)) &&
dll.ResolveExport(DLL_FUNCTION(PyLong_AsLongLong)) &&
dll.ResolveExport(DLL_VA_FUNCTION(PyErr_Format)) &&
#ifndef _LINUX
dll.ResolveExport(DLL_FUNCTION(PyUnicodeUCS2_AsUTF8String)) &&
dll.ResolveExport(DLL_FUNCTION(PyUnicodeUCS2_DecodeUTF8)) &&
#else
dll.ResolveExport(DLL_FUNCTION(PyUnicodeUCS4_AsUTF8String)) &&
dll.ResolveExport(DLL_FUNCTION(PyUnicodeUCS4_DecodeUTF8)) &&
#endif
dll.ResolveExport(DLL_FUNCTION(Py_MakePendingCalls)) &&
dll.ResolveExport(DLL_FUNCTION(PyEval_SaveThread)) &&
dll.ResolveExport(DLL_FUNCTION(PyEval_RestoreThread)) &&
dll.ResolveExport(DLL_FUNCTION(PyLong_FromLong)) &&
dll.ResolveExport(DLL_FUNCTION(PyModule_AddStringConstant)) &&
dll.ResolveExport(DLL_FUNCTION(PyModule_AddObject)) &&
dll.ResolveExport(DLL_FUNCTION(Py_InitModule4)) &&
dll.ResolveExport(DLL_FUNCTION(PyInt_AsLong)) &&
dll.ResolveExport(DLL_FUNCTION(PyFloat_AsDouble)) &&
dll.ResolveExport(DLL_FUNCTION(PyString_FromString)) &&
dll.ResolveExport(DLL_FUNCTION(PyBool_FromLong)) &&
dll.ResolveExport(DLL_FUNCTION(PyModule_AddIntConstant)) &&
dll.ResolveExport(DLL_VA_FUNCTION(PyObject_CallFunction)) &&
dll.ResolveExport(DLL_FUNCTION(PyDict_SetItemString)) &&
dll.ResolveExport(DLL_FUNCTION(PyDict_New)) &&
dll.ResolveExport(DLL_FUNCTION(PyModule_GetDict)) &&
dll.ResolveExport(DLL_FUNCTION(PyImport_Import)) &&
dll.ResolveExport(DLL_FUNCTION(PyFloat_FromDouble)) &&
dll.ResolveExport(DLL_FUNCTION(PyInt_FromLong)) &&
dll.ResolveExport(DLL_FUNCTION(PyDict_GetItemString)) &&
//dll.ResolveExport(DLL_FUNCTION(PyDict_GetItem)) &&
//dll.ResolveExport(DLL_FUNCTION(PyDict_Keys)) &&
dll.ResolveExport(DLL_FUNCTION(PyDict_Next)) &&
dll.ResolveExport(DLL_FUNCTION(PyDict_Size)) &&
dll.ResolveExport(DLL_FUNCTION(PyType_Ready)) &&
dll.ResolveExport(DLL_FUNCTION(PyType_GenericNew)) &&
dll.ResolveExport(DLL_FUNCTION(PyTuple_New)) &&
dll.ResolveExport(DLL_FUNCTION(PyTuple_SetItem)) &&
dll.ResolveExport(DLL_VA_FUNCTION(PyArg_Parse)) &&
dll.ResolveExport(DLL_VA_FUNCTION(PyArg_ParseTuple)) &&
dll.ResolveExport(DLL_FUNCTION(PySys_SetArgv)) &&
dll.ResolveExport(DLL_FUNCTION(PyObject_RichCompare)) &&
dll.ResolveExport(DLL_OBJECT_DATA(PyExc_SystemExit)) &&
dll.ResolveExport(DLL_OBJECT_DATA(PyExc_SystemError)) &&
dll.ResolveExport(DLL_OBJECT_DATA(PyExc_ValueError)) &&
dll.ResolveExport(DLL_OBJECT_DATA(PyExc_Exception)) &&
dll.ResolveExport(DLL_OBJECT_DATA(PyExc_TypeError)) &&
dll.ResolveExport(DLL_OBJECT_DATA(PyExc_KeyboardInterrupt)) &&
dll.ResolveExport(DLL_OBJECT_DATA(PyExc_RuntimeError)) &&
dll.ResolveExport(DLL_OBJECT_DATA(PyExc_ReferenceError)) &&
dll.ResolveExport(DLL_OBJECT_DATA(_Py_NoneStruct)) &&
dll.ResolveExport(DLL_OBJECT_DATA(_Py_NotImplementedStruct)) &&
dll.ResolveExport(DLL_OBJECT_DATA(_Py_TrueStruct)) &&
dll.ResolveExport(DLL_OBJECT_DATA(_Py_ZeroStruct)) &&
dll.ResolveExport(DLL_OBJECT_DATA(PyString_Type)) &&
dll.ResolveExport(DLL_OBJECT_DATA(PyList_Type)) &&
dll.ResolveExport(DLL_OBJECT_DATA(PyLong_Type)) &&
dll.ResolveExport(DLL_OBJECT_DATA(PyInt_Type)) &&
dll.ResolveExport(DLL_OBJECT_DATA(PyUnicode_Type)) &&
dll.ResolveExport(DLL_OBJECT_DATA(PyTuple_Type)) &&
dll.ResolveExport(DLL_OBJECT_DATA(PyDict_Type)) &&
//.........这里部分代码省略.........