Files
hook_tests/test_cases/simple_tests.asm
2017-12-27 19:08:16 +01:00

54 lines
557 B
NASM

format ms64 coff
section '.text' code readable writeable executable
use64
public _small
_small:
xor eax, eax
ret
public _rip_relative
_rip_relative:
mov rax, qword[seed]
mov ecx, 214013
mul ecx
add eax, 2531011
mov [seed], eax
shr eax, 16
and eax, 0x7FFF
ret
seed dd 1
public _branch
_branch:
and rax, 1
jz @branch_ret
xor rax, rax
nop ; Just some padding, so the function can't be copied entirely into the
nop ; trampoline
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
@branch_ret:
ret