Remove get prefix from frida functions (#93)

* more docs

* more docs:

* more docu

* more docu

* finished docs

* cleaned up markup

* must_use tags added

* more docs

* cleanup get
This commit is contained in:
Dominik Maier 2021-05-06 14:55:36 +02:00 committed by Andrea Fioraldi
parent 8bb061fa22
commit 7f06e36e2e
3 changed files with 12 additions and 12 deletions

View File

@ -612,7 +612,7 @@ pub extern "C" fn asan_mallinfo() -> *mut c_void {
/// Get the current thread's TLS address
extern "C" {
fn get_tls_ptr() -> *const c_void;
fn tls_ptr() -> *const c_void;
}
/// The frida address sanitizer runtime, providing address sanitization.
@ -892,7 +892,7 @@ impl AsanRuntime {
/// Determine the tls start, end for the currently running thread
fn current_tls() -> (usize, usize) {
let tls_address = unsafe { get_tls_ptr() } as usize;
let tls_address = unsafe { tls_ptr() } as usize;
// we need to mask off the highest byte, due to 'High Byte Ignore"
#[cfg(target_os = "android")]
let tls_address = tls_address & 0xffffffffffffff;

View File

@ -4,6 +4,6 @@ __declspec( thread ) int i = 0;
__thread int i = 0;
#endif
void * get_tls_ptr() {
void * tls_ptr() {
return (void*)&i;
}

View File

@ -193,12 +193,12 @@ const MAYBE_LOG_CODE: [u8; 60] = [
];
#[cfg(target_arch = "aarch64")]
fn get_pc(context: &CpuContext) -> usize {
fn pc(context: &CpuContext) -> usize {
context.pc() as usize
}
#[cfg(target_arch = "x86_64")]
fn get_pc(context: &CpuContext) -> usize {
fn pc(context: &CpuContext) -> usize {
context.rip() as usize
}
@ -284,10 +284,10 @@ impl<'a> FridaInstrumentationHelper<'a> {
let real_address = match helper
.asan_runtime
.borrow()
.real_address_for_stalked(get_pc(&context))
.real_address_for_stalked(pc(&context))
{
Some(address) => *address,
None => get_pc(&context),
None => pc(&context),
};
//let (range, (id, name)) = helper.ranges.get_key_value(&real_address).unwrap();
//println!("{}:0x{:016x}", name, real_address - range.start);
@ -341,7 +341,7 @@ impl<'a> FridaInstrumentationHelper<'a> {
}
#[cfg(target_arch = "aarch64")]
#[inline]
fn get_writer_register(&self, reg: capstone::RegId) -> Aarch64Register {
fn writer_register(&self, reg: capstone::RegId) -> Aarch64Register {
let regint: u16 = reg.0;
Aarch64Register::from_u32(regint as u32).unwrap()
}
@ -361,9 +361,9 @@ impl<'a> FridaInstrumentationHelper<'a> {
) {
let writer = output.writer();
let basereg = self.get_writer_register(basereg);
let basereg = self.writer_register(basereg);
let indexreg = if indexreg.0 != 0 {
Some(self.get_writer_register(indexreg))
Some(self.writer_register(indexreg))
} else {
None
};
@ -556,7 +556,7 @@ impl<'a> FridaInstrumentationHelper<'a> {
#[cfg(target_arch = "aarch64")]
#[inline]
fn get_instruction_width(&self, instr: &Insn, operands: &Vec<arch::ArchOperand>) -> u32 {
fn instruction_width(&self, instr: &Insn, operands: &Vec<arch::ArchOperand>) -> u32 {
use capstone::arch::arm64::Arm64Insn as I;
use capstone::arch::arm64::Arm64Reg as R;
use capstone::arch::arm64::Arm64Vas as V;
@ -662,7 +662,7 @@ impl<'a> FridaInstrumentationHelper<'a> {
opmem.base(),
opmem.index(),
opmem.disp(),
self.get_instruction_width(instr, &operands),
self.instruction_width(instr, &operands),
arm64operand.shift,
arm64operand.ext,
));