能力值:
( LV9,RANK:280 )
|
-
-
2 楼
碰到这种问题第一反应难道不应该是直接去查intel手册吗? 27.5 LOADING HOST STATE
Processor state is updated on VM exits in the following ways: • Some state is loaded from or otherwise determined by the contents of the host-state area. • Some state is determined by VM-exit controls. • Some state is established in the same way on every VM exit. • The page-directory pointers are loaded based on the values of certain control registers.
27.5.2 Loading Host Segment and Descriptor-Table Registers Each of the registers CS, SS, DS, ES, FS, GS, and TR is loaded as follows (see below for the treatment of LDTR): • The selector is loaded from the selector field. The segment is unusable if its selector is loaded with zero. The checks specified Section 26.3.1.2 limit the selector values that may be loaded. In particular, CS and TR are never loaded with zero and are thus never unusable. SS can be loaded with zero only on processors that
这是32位 DWORD __stdcall PsGetCurrentProcess() .text:0040ED86 public _PsGetCurrentProcess@0 .text:0040ED86 _PsGetCurrentProcess@0 proc near .text:0040ED86 64 A1 24 01 00 00 mov eax, large fs:124h ; IoGetCurrentProcess .text:0040ED8C 8B 40 44 mov eax, [eax+44h] .text:0040ED8F C3 retn .text:0040ED8F _PsGetCurrentProcess@0 endp
这是64位 public PsGetCurrentProcess .text:0000000140092BB0 PsGetCurrentProcess proc near .text:0000000140092BB0 65 48 8B 04 25 88 01 00 00 mov rax, gs:188h ; IoGetCurrentProcess .text:0000000140092BB9 48 8B 40 70 mov rax, [rax+70h] .text:0000000140092BBD C3 retn .text:0000000140092BBD PsGetCurrentProcess endp
也就是说你在host state下调用
PsGetCurrentProcess得到的东西都是错的
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
然而我的调试结果是确实可以获取到guest的current process,由于这个VMM是从DriverEntry启动的,所以他当时设置host context都直接获取的当时系统system进程的context,所以我以为它会一直认为current process是system , 但实际上并不是
|
能力值:
( LV12,RANK:760 )
|
-
-
4 楼
正确方式是读GuestGs然后切换Gs到guestGS 切换cr3到guestcr3 ok可以读出正确的进程了,但是有些时候,进程还是不正确的...
PS:读完记得把GS和Cr3改回来,不然会爆炸
|
能力值:
( LV4,RANK:40 )
|
-
-
5 楼
又学到了东西,感谢老V,原来是CR3 , GS 决定了现在运行着的是哪个操作系统。
|
能力值:
( LV12,RANK:760 )
|
-
-
6 楼
ugvjewxf 又学到了东西,感谢老V,原来是CR3 , GS 决定了现在运行着的是哪个操作系统。
FS/GS/CR3 host和guest是一个系统的话,loadGuest的这3个后基本就可以读出来Guest的东西了。 如果有EPT,访问VA需要根据GuestCr3,VAtoPA,根据EPTPointer做PAtoHPA,然后读.... Guest和Host不是一个系统,比如vmware那种,根据guestCr3把VA翻译GuestPA,再翻译到HostPA然后映射读取....
|
能力值:
( LV9,RANK:280 )
|
-
-
7 楼
cvcvxk
正确方式是读GuestGs然后切换Gs到guestGS切换cr3到guestcr3ok可以读出正确的进程了,但是有些时候,进程还是不正确的...PS:读完记得把GS和Cr3改回来,不然会爆炸
其实自己asm手撸一份vmread(GuestXX)版的PsGetCurrentXXX就没问题了
|
能力值:
( LV8,RANK:120 )
|
-
-
8 楼
|
能力值:
( LV2,RANK:10 )
|
-
-
9 楼
mark
|
能力值:
( LV1,RANK:0 )
|
-
-
10 楼
...
|
能力值:
( LV1,RANK:0 )
|
-
-
11 楼
cvcvxk
ugvjewxf 又学到了东西,感谢老V,原来是CR3 , GS 决定了现在运行着的是哪个操作系统。 FS/GS/CR3 host和guest是一个系 ...
我怎么一映射过云就蓝屏呢?用 MmMapIoSpace,改irq就死机!
|
|
|