Created
February 18, 2019 19:24
-
-
Save IJzerbaard/25daf7a143525d4eda8e0e6dbc9d1b93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
section .data | |
align 64 | |
buf1: dq 0 | |
section .text | |
global storeload_L | |
proc_frame storeload_L | |
alloc_stack 8 | |
[endprolog] | |
align 64 | |
; 16 is good, 15 is bad | |
; 0 is inconsistent | |
times 16 nop | |
mov r8, rcx | |
rdtscp | |
mov rcx, r8 | |
mov r8d, eax | |
jmp .entry | |
align 4096 | |
.entry: | |
; these nops have to be here for some reason | |
; a single 3-byte nop does *not* work | |
times 3 nop | |
; this lea can only be right here, | |
; not before the align, not even before the 3 nops | |
lea rdx, [rel buf1] | |
.loop: | |
mov [rdx], rax | |
mov rax, [rdx] | |
sub ecx, 1 | |
jnz .loop | |
rdtscp | |
sub eax, r8d | |
add rsp, 8 | |
ret | |
endproc_frame |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment