Skip to content

Commit b7d0cdb

Browse files
expose frida-gum underlying writer object to allow users to use functions that are not exposed in
1 parent 9102813 commit b7d0cdb

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

frida-gum/src/instruction_writer/aarch64/writer.rs

+5
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ impl Aarch64InstructionWriter {
7474
}
7575
}
7676

77+
/// Get the underlying frida gum writer object
78+
pub fn writer(&self) -> *mut gum_sys::_GumArm64Writer {
79+
self.writer
80+
}
81+
7782
/// Insert a `b` to a label. The label is specified by `id`.
7883
pub fn put_b_label(&self, id: u64) {
7984
unsafe { gum_sys::gum_arm64_writer_put_b_label(self.writer, id as *const c_void) }

frida-gum/src/instruction_writer/arm/writer.rs

+5
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ impl ArmInstructionWriter {
5757
is_from_new: false,
5858
}
5959
}
60+
61+
/// Get the underlying frida gum writer object
62+
pub fn writer(&self) -> *mut gum_sys::_GumArmWriter {
63+
self.writer
64+
}
6065
}
6166

6267
impl Drop for ArmInstructionWriter {

frida-gum/src/instruction_writer/x86_64/writer.rs

+5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ impl X86InstructionWriter {
7171
}
7272
}
7373

74+
/// Get the underlying frida gum writer object
75+
pub fn writer(&self) -> *mut gum_sys::_GumX86Writer {
76+
self.writer
77+
}
78+
7479
pub fn put_leave(&self) -> bool {
7580
unsafe {
7681
gum_sys::gum_x86_writer_put_leave(self.writer);

0 commit comments

Comments
 (0)