h33p / vmread

A library to read/write memory to Windows on KVM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

User mode -> VM -> User mode

ahmetabdi opened this issue · comments

I've created a library that communicates from usermode to VM and back to usermode over sockets but I'm getting some pretty bad performance (ESP is very slow) and not really sure how I can improve it in anyway.

I know this question isn't directly pointed at a issue with the repo but maybe someone can help and I will open source it.

This is my process:

User mode (Send read request over socket with the data: source address, destination address and size in a packet)

VM (read data using source address and size with vmread library and store address in a buffer)

VM (write data from buffer using vmread library back to user mode destination address with correct size)

User mode now has access to the memory within the process of itself and can draw information to screen.

But this is the point where performance is really bad. I'm guessing its because for every read request I do two operations a read and write but not 100% sure.

More information... I'm using the kernel mode driver

Is there some kind of copy instruction that does both read and write we could use within the VM?

commented

kmod rw has almost zero performance penalty, so I would guess the main bottleneck is your socket communication code. Try optimizing your network setup (use virt-io network card), lower the count of socket calls (have a list of reads packed in one command), generally stay creative.

👍 cheers