4 ms·
The only one of those edge cases I can think of is in an exploit I wrote (http://www.openwall.com/lists/oss-security/2015/08/04/8 http://www.openwall.com/lists/
by amluto 11y ago
The only one of those edge cases I can think of is in an exploit I wrote (http://www.openwall.com/lists/oss-security/2015/08/04/8 http://www.openwall.com/lists/oss-security/2015/08/04/8). This part need to work when interpreted as 32-bit or 64-bit code:
1: .byte 0xff, 0xca /* decl %edx */
jnz 1b
mov %%ss, %%eax /* grab SS to display */
/* Did we enter CPL0? */
mov %%cs, %%dx
testw $3, %%dx
jnz 2f
/* this part knows it's 64-bit */
2:
/* this part knows it's 32-bit */
The .byte thing is because 32-bit x86 allows two encodings for decl %edx, but the one-byte encoding got recycled for REX on 64-bit.