View Single Post
Old 04-19-2019, 00:38
Sound Sound is offline
Join Date: Apr 2016
Location: TaiWan
Posts: 107
Rept. Given: 8
Rept. Rcvd 52 Times in 22 Posts
Thanks Given: 41
Thanks Rcvd at 418 Times in 98 Posts
Sound Reputation: 52
picture is too big to see not clearly.

VMP 1.x 2.x virtual machine structure is a typical instruction fetch, decode opcode, process according to opcode dispatch, the entire virtual machine is a large loop structure, the handler table is up to 0xFF size, all x86 instructions are by this 0xFF ( Due to the repetition, there will actually be less) a handler simulation is completed.
The most executed jmp dword ptr ds: [eax*4+0x123456] and mov ecx, dword ptr ds: [eax*4+0x123456] are typical dispatch instructions.

The part of the vmp3.x loop is very small. Some procedures for fetching instructions and dispatch are independent. And the handler itself is not reused. This means that two identical instructions will generate different handler codes, even though they implement the same functionality.
Reply With Quote
The Following 2 Users Gave Reputation+1 to Sound For This Useful Post:
niculaita (04-19-2019), sh3dow (06-07-2019)
The Following 3 Users Say Thank You to Sound For This Useful Post:
Indigo (07-19-2019), niculaita (04-19-2019), sh3dow (06-07-2019)