Цитата:
Сообщение от doesitmatter
|
Цитата:
11.6 SELF-MODIFYING CODE
A write to a memory location in a code segment that is currently cached in the processor causes the associated cache line (or lines) to be invalidated.
|
Code segment != virt adr
Патчинг кода из дллки или RemoteThread это иной сегмент кода, нежели ранинг уже пропатченого куска кода на клиенте. И вообще, в рамках одного модуля (PE) - сегменты могут различаться.
С учетом размера кешей современных процов - туда влезает далеко не один сегмент. Ну и
многопоточностьмногоядерность не забываем.
Цитата:
Particularly on x86 my guess that simple JMP just wont do it, since on modern processors there are branch predictors and optimizers that would "see" the code that your jump would target. Another scenario is when multiple CPU's are in play, and instruction cache has to be flushed from
both chips.
|
branch predictors -- в данном случае prefetch queue
Особенно актуально для RemoteThread.