diff options
| author | KyleMiles <krm504@nyu.edu> | 2023-04-18 12:38:09 -0400 |
|---|---|---|
| committer | KyleMiles <krm504@nyu.edu> | 2023-07-10 12:58:35 -0400 |
| commit | 6325884782a47e0c89154cf7ce0952368e25ea2a (patch) | |
| tree | aacb435dc9e386035b75471715abcc912ce18697 /rust/src/templatesimplifier.rs | |
| parent | 068a2ff42ef4e15e67d2904166e53a51420b65a1 (diff) | |
DWARF Import DebugInfo Plugin
Resolves #3206
Diffstat (limited to 'rust/src/templatesimplifier.rs')
| -rw-r--r-- | rust/src/templatesimplifier.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/rust/src/templatesimplifier.rs b/rust/src/templatesimplifier.rs new file mode 100644 index 00000000..2f7bba92 --- /dev/null +++ b/rust/src/templatesimplifier.rs @@ -0,0 +1,15 @@ +use crate::{ + string::{BnStrCompatible, BnString}, + types::{QualifiedName}, +}; +use binaryninjacore_sys::{BNRustSimplifyStrToFQN, BNRustSimplifyStrToStr}; + +pub fn simplify_str_to_str<S: BnStrCompatible>(input: S) -> BnString { + let name = input.into_bytes_with_nul(); + unsafe { BnString::from_raw(BNRustSimplifyStrToStr(name.as_ref().as_ptr() as *mut _)) } +} + +pub fn simplify_str_to_fqn<S: BnStrCompatible>(input: S, simplify: bool) -> QualifiedName { + let name = input.into_bytes_with_nul(); + unsafe { QualifiedName(BNRustSimplifyStrToFQN(name.as_ref().as_ptr() as *mut _, simplify)) } +} |
