From cfacfaed3056e1f022d2b8fad9cdc206bfbd1108 Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Sun, 5 Jun 2016 10:16:17 +0100 Subject: Update gcc inline assembly --- md/writeup/gcc_inline_assembly.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'md') diff --git a/md/writeup/gcc_inline_assembly.md b/md/writeup/gcc_inline_assembly.md index 6e9985a..eda7764 100644 --- a/md/writeup/gcc_inline_assembly.md +++ b/md/writeup/gcc_inline_assembly.md @@ -155,6 +155,25 @@ long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigne ``` Put result of execution to __ret__, all paramters in memory +### Intel random number with RDRAND + +``` +uint64_t get_hw_rand() +{ + uint64_t ret; + int i=0; + const int timeout = 10; + while (i