View Single Post
  #3  
Old 04-19-2019, 00:38
Sound Sound is offline
Family
 
Join Date: Apr 2016
Location: TaiWan
Posts: 106
Rept. Given: 8
Rept. Rcvd 52 Times in 22 Posts
Thanks Given: 39
Thanks Rcvd at 421 Times in 97 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)