ufrisk / pcileech

Direct Memory Access (DMA) Attack Software
GNU Affero General Public License v3.0
4.72k stars 706 forks source link

PCILeech API - Clear Cache #208

Closed Creastoff closed 1 year ago

Creastoff commented 1 year ago

I have noticed in an older fork of this repo that a method called VmmCacheClear is used but am unsure what the new equivalent is. I suspect that because I am not using the up-to-date equivalent of this method I am unable to read a different value at the same address despite changing the value in-between executing the read method. Are my assumptions correct? If so is there documentation or an example program which could help with my understanding on how to properly clear the cache or achieve what I am attempting to do?

Creastoff commented 1 year ago

Info: I am using a pcie hardware device

ufrisk commented 1 year ago

What are you trying to achieve here?

If you wish to read uncached memory there is a flag to disregard the internal cache when reading memory.

Example: BOOL isSuccess = VMMDLL_MemReadEx(hVMM, dwPID, va, pb, cb, NULL, VMMDLL_FLAG_NOCACHE)

or when using the scatter way to read multiple memory chunks at the same time

VMMDLL_SCATTER_HANDLE hscatter = VMMDLL_Scatter_Initialize(hVMM, dwPID, VMMDLL_FLAG_NOCACHE)

Please let me know if this answers your question.

Creastoff commented 1 year ago

The VMDLL_MemReadEx method & VMMDLL_FLAG_NOCACHE flag is what I was looking for, I am now expectedly seeing the values changing after each read. Thank you Ulf.