Exemple #1
0
void
rb_call_inits()
{
    Init_PreSymbol();
    Init_id();
    Init_var_tables();
    Init_Object();
    Init_Class();
    Init_VM();
    Init_Encoding();
    Init_Comparable();
    Init_Enumerable();
    Init_Precision();
    Init_String();
    Init_Symbol();
    Init_Exception();
    Init_eval();
    Init_jump();
    Init_Numeric();
    Init_Bignum();
    Init_syserr();
    Init_Array();
    Init_Hash();
    Init_ENV();
    Init_Struct();
    Init_Regexp();
    Init_pack();
    Init_marshal();
    Init_Range();
    Init_IO();
    Init_Dir();
    Init_Time();
    Init_Random();
    Init_signal();
    Init_process();
    Init_load();
    Init_Proc();
    Init_Binding();
    Init_Math();
    Init_GC();
    Init_Enumerator();
    Init_Thread();
    //Init_Cont();
    Init_Rational();
    Init_Complex();
    Init_version();
    Init_PostGC();
    Init_ObjC();
    Init_BridgeSupport();
    Init_FFI();
    Init_Dispatch();
    Init_Transcode();
    Init_sandbox();
    Init_PostVM();
}
bool New$dvmLoadNativeCode(char* pathName, void* classLoader, char** detail)
{
	bool result = false;
	Utils::getDDAppConfig();
	if(AppName == NULL){
		AppName = Utils::DDAppTarget(pathName);
		if(AppName != NULL)
		{
			DEXLOG("New$dvmLoadNativeCode App:%s,So:%s",AppName,pathName);
			//筛选结束。
			if(Utils::getDDAppMode() == DDAMODE_DEBUG)
			{
				DEXLOG("DDAMODE_DEBUG");
				Init_ENV("/data/local/MHookDemo/Shell_Debug.so",pathName);
			}else if(Utils::getDDAppMode() == DDAMODE_TestDump)
			{
				DEXLOG("DDAMODE_TestDump");
				Init_ENV("/data/local/MHookDemo/TestDump.so",pathName);
			}else if(Utils::getDDAppMode() == DDAMODE_AutoDump)
			{
				//获取动态加载函数数据,实现
				DEXLOG("DDAMODE_AutoDump");
				Init_ENV("/data/local/MHookDemo/AutoDump.so",pathName);
			}
		}
	}
	//正常运行,一般使用劫持
	if(Bef_LoadNative != NULL)
	{
		pathName = (char*)Bef_LoadNative(pathName);
	}
	result =$dvmLoadNativeCode(pathName,classLoader,detail);
	//一般使用DUMP,但是这里DUMP可能使一些指令ODEX化
	if(Aft_LoadNative != NULL)
	{
		pathName =  (char*)Aft_LoadNative(pathName);
	}
	return result;
}