Files
hook_tests/hook_tests/simple_tests.asm
2017-12-23 22:34:12 +01:00

54 lines
552 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 eax, [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