Skip to content

Instantly share code, notes, and snippets.

@febnug
Last active April 11, 2021 03:49
Show Gist options
  • Save febnug/d0fcab97a76a0d682aa6be3732cce448 to your computer and use it in GitHub Desktop.
Save febnug/d0fcab97a76a0d682aa6be3732cce448 to your computer and use it in GitHub Desktop.
; TODO: belum di test, mungkin broken (?)
global _start
section .text
_start:
mov ecx, 0xc0000082
rdmsr
mov edx, 32
mov ecx, edx
sal edx, cl
or eax, edx
.loop_init:
mov ecx, eax
add ecx, 500
jmp .loop_body
.loop:
add eax, 1
cmp ecx, eax
je .fail
.loop_body:
cmp byte [eax], 0xff
jne .loop
cmp byte [eax+1], 0x14
jne .loop
cmp byte [eax+2], 0xc5
jne .loop
.success:
mov ecx, 0xffffffff
mov eax, dword [eax+3]
or eax, ecx
ret
.fail:
xor eax, eax
ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment