Skip to content

Commit

Permalink
Process: fix imports of frida namespaced glib functions
Browse files Browse the repository at this point in the history
  • Loading branch information
s1341 committed Feb 2, 2025
1 parent 4fc4605 commit 169d8a9
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions frida-gum/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ impl<'a> Process<'a> {
pub fn current_dir(&self) -> String {
unsafe {
#[cfg(target_os = "linux")]
CStr::from_ptr(_frida_g_get_current_dir())
.to_string_lossy()
.to_string()
let dir = _frida_g_get_current_dir();
#[cfg(not(target_os = "linux"))]
CStr::from_ptr(_g_get_current_dir())
let dir = _g_get_current_dir();

CStr::from_ptr(dir)
.to_string_lossy()
.to_string()
}
Expand All @@ -145,11 +145,11 @@ impl<'a> Process<'a> {
pub fn tmp_dir(&self) -> String {
unsafe {
#[cfg(target_os = "linux")]
CStr::from_ptr(_frida_g_get_tmp_dir())
.to_string_lossy()
.to_string()
let dir = _frida_g_get_tmp_dir();
#[cfg(not(target_os = "linux"))]
CStr::from_ptr(_g_get_tmp_dir())
let dir = _g_get_tmp_dir();

CStr::from_ptr(dir)
.to_string_lossy()
.to_string()
}
Expand All @@ -159,11 +159,11 @@ impl<'a> Process<'a> {
pub fn home_dir(&self) -> String {
unsafe {
#[cfg(target_os = "linux")]
CStr::from_ptr(_frida_g_get_home_dir())
.to_string_lossy()
.to_string()
let dir = _frida_g_get_home_dir();
#[cfg(not(target_os = "linux"))]
CStr::from_ptr(_g_get_home_dir())
let dir = _g_get_home_dir();

CStr::from_ptr(dir)
.to_string_lossy()
.to_string()
}
Expand Down

0 comments on commit 169d8a9

Please sign in to comment.