Category : x86

A couple of years ago, I wrote and updated our MASM codebase with this macro below to combat Spectre V2. NOSPEC_JMP MACRO target:REQ PUSH target JMP x86_indirect_thunk ENDM NOSPEC_CALL MACRO target:REQ LOCAL nospec_call_start LOCAL nospec_call_end JMP nospec_call_end ALIGN 16 nospec_call_start: PUSH target JMP x86_indirect_thunk ALIGN 16 nospec_call_end: CALL nospec_call_start ENDM .CODE ;; This is a ..

Read more

For many years, ntohs (32-bit version) had a return value that was zero extended into the high 16 bits (word). However, after a recent update of Windows 10, it sometimes returns garbage in the upper word. For example, passing argument 0xF00D to call ntohs the return values are EAX = 00F00DF0 (32-bit code) RAX = 0000000000000DF0 (64-bit code) The ..

Read more