You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, an ULONG on Windows is 4 bytes long, not pointer sized, and a BOOLEAN (not to be confused with a BOOL) is 1 byte long.
So, the updated signature plus the entropy function in the file should be like this:
use core::ffi::{c_void, c_ulong, c_char};extern"system"{#[link_name = "SystemFunction036"]fnRtlGenRandom(pBuffer:*mutc_void,cbBuffer:c_ulong) -> c_char;}/// Obtain a random 64-bit number using WinAPI's `RtlGenRandom` function.pubfnentropy(out:&mut[u8]) -> bool{unsafe{RtlGenRandom(out.as_mut_ptr()as*mutc_void, out.len()asu32) == 0}}
The text was updated successfully, but these errors were encountered:
I ran into this issue while while running rdst with miri. The RtlGenRandom function has the following definition:
BOOLEAN RtlGenRandom( [out] PVOID RandomBuffer, [in] ULONG RandomBufferLength );
Which was translated as follows:
However, an ULONG on Windows is 4 bytes long, not pointer sized, and a BOOLEAN (not to be confused with a BOOL) is 1 byte long.
So, the updated signature plus the entropy function in the file should be like this:
The text was updated successfully, but these errors were encountered: