ImageVerifierCode 换一换
格式:DOCX , 页数:8 ,大小:17.35KB ,
资源ID:17002582      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/17002582.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(virtualbox原理构架分析文档格式.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

virtualbox原理构架分析文档格式.docx

1、VMMR3DECL(int) PATMR3InstallPatch(PVM pVM, RTRCPTR pInstrGC, uint64_t flags)Jump back to guest if IF=1, else fault ;BEGINPROC PATMJumpToGuest_IF1PATMJumpToGuest_IF1_Start:mov dword ss:PATM_INTERRUPTFLAG, 0pushf test dword ss:PATM_VMFLAGS, X86_EFL_IF jnz PATMJumpToGuest_IF1_Safe nop ; IF=0 - unsafe,

2、so faultpopf PATM_INTERRUPTFLAG, 1PATM_INT3PATMJumpToGuest_IF1_Safe: IF=1 - we can safely jump back to the original instructionDB 0xE9PATMJumpToGuest_IF1_Jump:DD PATM_JUMPDELTA PATMJumpToGuest_IF1_End:ENDPROC PATMJumpToGuest_IF1 Patch record for call instructionsPATM_JUMPDELTA在补丁代码生成时会被提换为虚拟机中被打补丁的下

3、一条指令以PATM开头的标签都会在补丁代码生成时被替换成相应的地址或变量的值全局定义类:VBoxGlobal.h 1,虚拟化分类:一,基于软件虚拟化:1,解释执行;2,扫描与修补技术3,BT技术qemu,vmware 二,硬件辅助虚拟化,三,类/泛/半虚拟化(xen)Ring0ring3技术;Vm.cpp Gmm- Global Memory Manager, ring-3 request wrappers.Em.cpp :EM - Execution Monitor / Manager. * execution loop (the outer loop being in EMR3Execut

4、eVM().* Execute VM.* This function is the main loop of the VM. The emulation thread* calls this function when the VM has been successfully constructed* and were ready for executing the VM.* Returning from this function means that the VM is turned off or* suspended (state already saved) and deconstru

5、ction in next in line.VMMR3DECL(int) EMR3ExecuteVM(PVM pVM, PVMCPU pVCpu)VMEmt.cpp: Virtual Machine, The Emulation Thread.The emulation thread main function, with Virtual CPU ID for debugging.int vmR3EmulationThreadWithId(RTTHREAD ThreadSelf, PUVMCPU pUVCpu, VMCPUID idCpu)PUVM pUVM = pUVCpu-pUVM;Sta

6、rtvm_int main (int argc, char *argv, char *envp)for (int i = 1; i rc=%Rrc, /* forever */-static int emR3RemExecute(PVM pVM, PVMCPU pVCpu, bool *pfFFDone)Vmmr0.cpp -gvmmr0.cpp-SUPDrv.c-vbox-Pci.c-底层(RTSemFastMutexCreate)VMMRC.cpp * VMM - Raw-mode Context.* CSAM - Guest OS Code Scanning and Analysis M

7、anager扫描主函数:* Execute VM.* This function is the main loop of the VM. The emulation threadre ready for executing the VM.VMMR3DECL(int) EMR3ExecuteVM(PVM pVM, PVMCPU pVCpu).驱动文件执行扫描主函数:int vmR3EmulationThreadWithId(RTTHREAD ThreadSelf,PUVMCPU pUVCpu,VMCPUID idCpu)PUVM pUVM = pUVCpu-rc = EMR3ExecuteVM(

8、pVM, pVCpu);EMR3ExecuteVM()-rc=%Rrc,enmVMState=%dn, rc, pVM-enmVMState);if (EMGetState(pVCpu) = EMSTATE_GURU_MEDITATION)vmR3SetGuruMeditation(pVM); /* forever */-EMR3ExecuteVM-vmR3EmulationThreadWithId vmR3EmulationThread-RTThreadCreateF-vmR3CreateUVM-VMR3Create-VMPowerUpThread-RTThreadCreate-Truste

9、dMain-main() (main.cpp * VBox frontends: Qt GUI (VirtualBox):* The main() function )另外还有: */int main(int argc, char *argv)(vboxbfe.cpp)return TrustedMain(argc, argv, NULL);int main(int argc, char *argv, char *envp)(vboxheadless.cpp)/ initialize VBox Runtimeint rc = RTR3InitAndSUPLib(); return Truste

10、dMain(argc, argv, envp);* Start the emulation threads for all VMCPUs.for (i = 0; cCpus; i+)rc =RTThreadCreateF(&pUVM-aCpusi.vm.s.ThreadEMT, vmR3EmulationThread, &aCpusi,_1M,RTTHREADTYPE_EMULATION, RTTHREADFLAGS_WAITABLE,cCpus 1?EMT-%u : EMT, i);break;* Executes one (or perhaps a few more) instructio

11、n(s).* returns VBox status code suitable for EM.*/static int emR3ExecuteInstructionWorker(PVM pVM,PVMCPU pVCpu,int rcGC,const char *pszPrefix)patch过程:CPUMR3RawEnter(pVCpu,NULL);-PATMRawEnter(pVM,pCtxCore);-VMMR3DECL(int) PATMR3InstallPatch(PVM pVM, RTRCPTR pInstrGC, uint64_t flags)- static int patmD

12、uplicateFunction(PVM pVM,RTRCPTR pInstrGC,PPATMPATCHREC pPatchRec,PPATMP2GLOOKUPREC pCacheRec)-int patmPatchGenSetPIF(PVM pVM, PPATCHINFO pPatch,RTRCPTR pInstrGC)-size = patmPatchGenCode(pVM, pPatch, pPB, &PATMSetPIFRecord,0, false); -PATMSetPIFRecord - GLOBALNAME PATMSetPIFRecord RTCCPTR_DEF PATMSe

13、tPIF_Start DD 0DD PATMSetPIF_End - PATMSetPIF_Start DD 1DD PATM_INTERRUPTFLAG DD 0ffffhint main(int argc, char *argv)return TrustedMain(argc, argv, NULL); - DECLEXPORT(int) TrustedMain (int argc, char *argv, char *envp) -DECLCALLBACK(int) VMPowerUpThread(RTTHREAD Thread, void *pvUser)-VMMR3DECL(int)

14、VMR3Create(uint32_t cCpus,PCVMM2USERMETHODS .)static int vmR3CreateUVM(uint32_t cCpus,PCVMM2USERMETHODS pVmm2UserMethods, PUVM *ppUVM) -DECLCALLBACK(int) vmR3EmulationThread(RTTHREAD ThreadSelf, void *pvArgs)-int vmR3EmulationThreadWithId(RTTHREAD ThreadSelf,PUVMCPU pUVCpu,VMCPUID idCpu) * execution

15、 loop (the outer loop being in EMR3ExecuteVM(). -int emR3ForcedActions(PVM pVM, PVMCPU pVCpu, int rc)-VMMR3DECL(int)TRPMR3InjectEvent(PVM pVM,PVMCPU pVCpu,TRPMEVENT enmEvent) -VMMR3DECL(int) CSAMR3CheckGates(PVM pVM, uint32_t iGate, uint32_t cGates)-static int CSAMR3AnalyseCallback(PVM pVM,DISCPUSTA

16、TE *pCpu,RCPTRTYPE(uint8_t *) pInstrGC, RCPTRTYPE(uint8_t *) pCurInstrGC,PCSAMP2GLOOKUPREC pCacheRec,void *pUserData) -VMMR3DECL(int) PATMR3InstallPatch(PVM pVM, RTRCPTR pInstrGC, uint64_t flags)-VMMR3DECL(int)PATMR3PatchBlock(PVM pVM,RTRCPTR pInstrGC,R3PTRTYPE(uint8_t *) pInstrHC,uint32_t uOpcode,u

17、int32_t uOpSize,PPATMPATCHREC pPatchRec) -PATMClearInhibitIRQContIF0Record,0, false, &callInfo); -GLOBALNAME PATMClearInhibitIRQContIF0Record RTCCPTR_DEF PATMClearInhibitIRQContIF0_Start DD PATMClearInhibitIRQContIF0_End - PATMClearInhibitIRQContIF0_Start DD 11DD PATM_INHIBITIRQADDR DD PATM_VMFLAGS DD PATM_VM_FORCEDACTIONS DD PATM_TEMP_EAX DD PATM_TEMP_ECX DD PATM_TEMP_EDI DD PATM_TEMP_RESTORE_FLAGS DD PATM_PENDINGACTION DD PATM_NEXTINSTRADDR Privilege 0patch0源代码二进制SCANvboxdrvPrivilege 1patch1 patchn dpPrivilege patchOs-imageVMMKERNEL

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1