The FWORD data type is defined as 6 bytes so how is it translated to a 32 bit virtual address in the jmp instruction:
jmp FWORD PTR [eax-0x67]
?...
When you jump to an FWORD PTR, what you're doing is a "far jump" -- that is, the memory being pointed at contains a 16-bit "selector" (which refers to a segment entry in either the GDT or LDT), and a 32-bit offset from the beginning of the segment the selector refers to. The segment descriptor contains data about the segment, of course...including where in memory it starts.
During the jump, the CPU does some privilege checks to make sure the selector is valid and permitted (there's privilege levels and segment types and such involved), then it effectively loads the first 16 bits into CS, and the rest into EIP. From then on, code addresses effectively get the CS segment's base address added to them to turn them into virtual addresses.
A far jump use the full segment base:offset value as an absolute address, so it is composed from 16bit segment and 32bit address. It perform jump to an instruction located in a different segment than the current code segment but it should be at the same privilege level.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With