Gbps / gbhv

Simple x86-64 VT-x Hypervisor with EPT Hooking
Creative Commons Attribution 4.0 International
847 stars 144 forks source link

Wrong loop logic when using LDE #23

Open CySHell opened 3 years ago

CySHell commented 3 years ago

Inside ept.c, when counting the number of instruction bytes at the start of the hooked function, the instruction pointer is not incremented - this results in counting the length of the same instruction over and over again.

SizeOfHookedInstructions += LDE(TargetFunction, 64))

should be changed to something like:

SizeOfHookedInstructions += LDE(TargetFunction + SizeOfHookedInstructions, 64))

Gbps commented 3 years ago

Hey there, great find! Looks like it was overlooked but generally didn't have any issues because only one instruction's space was necessary for the example.

Could you submit a pull request so I can merge it into the main branch?

Thanks!

CySHell commented 3 years ago

Sure, please give me authorization to create a pull request.

Gbps commented 3 years ago

Sorry, I know this was from awhile ago, but anyone should be able to open a pull request and I can review it.