[−][src]Macro real_c_string::real_c_string
real_c_string!() { /* proc-macro */ }
Transforms passed string to same look as C strings at asm level Used in vmprotect crate, because vmprotect disassembles code, and finds usages like this
use real_c_string::real_c_string; assert_eq!(0i8, unsafe{*real_c_string!("")}); let c_string = real_c_string!("Hello world!"); let same_as_array_of_bytes: [i8;13] = [72i8, 101i8, 108i8, 108i8, 111i8, 32i8, 119i8, 111i8, 114i8, 108i8, 100i8, 33i8, 0i8]; for i in 0..13 { assert_eq!(same_as_array_of_bytes[i], unsafe{*c_string.offset(i as isize)}) }