ufrisk / MemProcFS

MemProcFS
GNU Affero General Public License v3.0
2.81k stars 352 forks source link

VMMDLL_Scatter_Execute does not write data prepared by VMMDLL_Scatter_PrepareWrite. #199

Closed eXskill closed 11 months ago

eXskill commented 11 months ago

Good afternoon. VMMDLL_Scatter_PrepareEx -> VMMDLL_Scatter_ExecuteRead works great, I can add hundreds of addresses and then update them with one command. But why doesn't VMMDLL_Scatter_PrepareWrite work like this?

Here is an example:

int var1 = 0; hS = VMMDLL_Scatter_Initialize(globals::hVMM, remote_pcoc_pid, VMMDLL_FLAG_NOCACHE); VMMDLL_Scatter_PrepareWrite(hS, remote_pcoc_base + 0x3E6D0, (PBYTE)&var1, sizeof(var1)); var1=1; VMMDLL_Scatter_Execute(hS);

As a result, var1= 0 on the target machine.

int var1=1; hS = VMMDLL_Scatter_Initialize(globals::hVMM, remote_pcoc_pid, VMMDLL_FLAG_NOCACHE); VMMDLL_Scatter_PrepareWrite(hS, remote_pcoc_base + 0x3E6D0, (PBYTE)&var1, sizeof(var1)); VMMDLL_Scatter_Execute(hS);

As a result, on the target machine var1= 1.

VMMDLL_Scatter_Execute does not update pre-prepared variables.

ufrisk commented 11 months ago

Thanks for this bug report. I'll look into it :)

As a temporary solution you could use the normal write. Unlike scatter reads there is very little performance to gain by doing scatter writes (as opposed to multiple normal writes).

ufrisk commented 11 months ago

I've looked into it now. I think I read your "bug report" too quickly. The function works as intended.

But,

You have a very good point that it in some cases would be super nice to have a function like the one you're describing. A function that will read the contents of "var1" at the time Execute() is called.

In next version, which I hope to publish the week after next I've added a 2nd function, VMMDLL_Scatter_PrepareWriteEx() which this specific behavior.

Many thanks for the suggestion :)

eXskill commented 11 months ago

Great! Thank you.