Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
d03e1d1
Upgrade Frida from 17.9.5 to 17.11.0
kkuehl Jun 11, 2026
f92cb03
Upgrade Frida from 17.11.0 to 17.13.0
kkuehl Jun 15, 2026
bf75c74
Add new Frida API bindings and upgrade to 17.12.0
kkuehl Jun 15, 2026
abb5cb4
Merge branch 'kkuehl/frida-rust-updates' of github.com:kkuehl/frida-r…
kkuehl Jun 15, 2026
f33ef03
Audit fixes, Frida 17.13.0 + edition 2024, and new 17.10-17.13 API bi…
kkuehl Jun 15, 2026
11857b0
Return () from x86/arm64 writer wrappers of void C functions
kkuehl Jun 15, 2026
a2f4e50
Fix cross-platform CI failures: edition-2024 unsafe externs + enum si…
kkuehl Jun 16, 2026
90807be
Fix cross-platform CI failures (macOS/Linux/iOS)
kkuehl Jun 16, 2026
2f61da8
fix: remove 'static bound from ModuleMap::new_with_filter
kkuehl Jun 16, 2026
82370e7
Upgrade Frida to 17.14.0 and migrate workspace to Rust edition 2024
kkuehl Jun 16, 2026
16d27fd
Fix unsafe extern blocks for edition 2024 and upgrade to Frida 17.14.1
kkuehl Jun 18, 2026
c08a2f7
frida-build: bump reqwest 0.12 -> 0.13
kkuehl Jun 18, 2026
7e37036
frida-build: bump reqwest 0.12 -> 0.13
kkuehl Jun 18, 2026
9f7d533
frida-build: use reqwest 0.13 'rustls' feature (renamed from 'rustls-…
kkuehl Jun 18, 2026
2f6de17
frida-build: use reqwest 0.13 'rustls' feature (renamed from 'rustls-…
kkuehl Jun 18, 2026
291060a
fix: wrap unsafe ops in explicit blocks in script/data.rs for Rust 2024
kkuehl Jun 18, 2026
8bcae13
fix: wrap unsafe ops in explicit blocks in script/data.rs for Rust 2024
kkuehl Jun 18, 2026
b88c45c
chore: upgrade Frida devkit from 17.14.1 to 17.15.0
kkuehl Jun 19, 2026
15ed7b6
merge: bring in Frida 17.15.0 version bump from kkuehl/frida-17.13-ed…
kkuehl Jun 19, 2026
97cd958
feat: add ElfModule wrapper for Frida 17.15.0 dynamic entry enumeration
kkuehl Jun 19, 2026
577f384
chore: upgrade Frida devkit from 17.15.0 to 17.15.1
kkuehl Jun 21, 2026
70ceb04
chore: bump FRIDA_VERSION to 17.15.2
kkuehl Jun 22, 2026
5af74c7
chore: bump FRIDA_VERSION to 17.15.3
kkuehl Jun 25, 2026
0574dc9
chore: bump FRIDA_VERSION to 17.15.4
kkuehl Jul 7, 2026
0508718
merge: integrate upstream/main into frida-rust-updates
kkuehl Jul 7, 2026
f249a21
fix: resolve CI build failures across all platforms
kkuehl Jul 7, 2026
3564968
feat: add ARM Thumb and MIPS instruction writers
kkuehl Jul 7, 2026
a30759a
fix: resolve cross-platform build failures in CI
kkuehl Jul 7, 2026
730494d
fix: remove unnecessary type conversions flagged by clippy
kkuehl Jul 7, 2026
f55ede7
fix: add module-level allow for platform-dependent type casts in quer…
kkuehl Jul 7, 2026
55b4bcb
fix: conditionally compile newer Frida APIs based on bindgen output
kkuehl Jul 7, 2026
5c9186f
fix: move cfg guards to mod declarations instead of inside module files
kkuehl Jul 7, 2026
345fd65
feat: upgrade to Frida 17.16.1
kkuehl Jul 18, 2026
0e72abb
feat: add Darwin/Mach-O module inspection support
kkuehl Jul 18, 2026
a90e309
feat: add kernel API support
kkuehl Jul 18, 2026
8a77767
docs: add comprehensive upgrade summary for 17.16.1
kkuehl Jul 18, 2026
3293c76
feat: add AVX-512 x86_64 instructions and ARM64 PAC/MOVK
kkuehl Jul 18, 2026
e21c498
docs: update upgrade summary with new additions
kkuehl Jul 18, 2026
5ba0c71
feat: add extensive ARM64 instruction coverage
kkuehl Jul 18, 2026
4c0794a
chore: remove upgrade summary markdown
kkuehl Jul 18, 2026
8b8c3d1
fix(ci): resolve build failures across platforms
kkuehl Jul 18, 2026
540c98a
fix(ci): re-enable interceptor/CFG/unwind APIs - types exist in devkit
kkuehl Jul 18, 2026
48e8f7e
fix(ci): extract devkit to include/ directory for docs build
kkuehl Jul 18, 2026
3b00deb
chore: update committed frida-gumjs.h to 17.16.1
kkuehl Jul 18, 2026
5ca0774
fix: run cargo fmt to fix formatting
kkuehl Jul 18, 2026
f8152cf
fix: remove duplicate ARM64 writer functions
kkuehl Jul 18, 2026
141a66b
fix: resolve platform-specific type mismatches and API signature changes
kkuehl Jul 18, 2026
b43c012
fix: correct enum constant names and apply formatting
kkuehl Jul 18, 2026
768bd3a
fix: use direct as u32 cast for cross-platform enum compatibility
kkuehl Jul 18, 2026
e7db477
fix: revert ptrauth constant - has underscore on macOS x86_64
kkuehl Jul 18, 2026
b8c0fb0
fix: use conditional compilation for platform-specific enum types
kkuehl Jul 18, 2026
8c9bec1
fix: correct doctest imports for put_pacia_reg_reg
kkuehl Jul 18, 2026
851f1fa
fix: use gsize instead of u64 for 32-bit platform compatibility
kkuehl Jul 18, 2026
c00b6c1
fix: apply cargo fmt
kkuehl Jul 18, 2026
78012fd
fix: use gsize for invocation context data size on 32-bit platforms
kkuehl Jul 18, 2026
a8fd0c7
fix: apply cargo fmt
kkuehl Jul 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
291 changes: 291 additions & 0 deletions .claude/add-missing-apis-workflow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,291 @@
export const meta = {
name: 'add-missing-gum-apis',
description: 'Add all missing GUM API wrappers to frida-rust',
phases: [
{ title: 'Add ThumbWriter' },
{ title: 'Add MipsWriter' },
{ title: 'Add DarwinModule' },
{ title: 'Add KernelAPI' },
{ title: 'Add MetalCollections' },
{ title: 'Add Spinlock' },
{ title: 'Add InspectorServer' },
{ title: 'Add MemoryMap' },
{ title: 'Verify' },
],
}

const APIS = [
{
name: 'ThumbWriter',
phase: 'Add ThumbWriter',
file: 'frida-gum/src/instruction_writer/arm/thumb_writer.rs',
description: 'ARM Thumb/Thumb-2 instruction writer for 32-bit ARM code generation',
platform: 'arm',
priority: 'critical',
},
{
name: 'MipsWriter',
phase: 'Add MipsWriter',
file: 'frida-gum/src/instruction_writer/mips/writer.rs',
description: 'MIPS instruction writer for MIPS architecture support',
platform: 'mips',
priority: 'medium',
},
{
name: 'DarwinModule',
phase: 'Add DarwinModule',
file: 'frida-gum/src/darwin_module.rs',
description: 'Mach-O binary parsing and inspection for macOS/iOS',
platform: 'darwin',
priority: 'critical',
},
{
name: 'KernelAPI',
phase: 'Add KernelAPI',
file: 'frida-gum/src/kernel.rs',
description: 'Kernel memory operations and module enumeration',
platform: 'all',
priority: 'high',
},
{
name: 'MetalArray',
phase: 'Add MetalCollections',
file: 'frida-gum/src/metal_array.rs',
description: 'Lock-free array for signal-safe callbacks',
platform: 'all',
priority: 'medium',
},
{
name: 'MetalHashTable',
phase: 'Add MetalCollections',
file: 'frida-gum/src/metal_hash_table.rs',
description: 'Lock-free hash table for signal-safe callbacks',
platform: 'all',
priority: 'medium',
},
{
name: 'Spinlock',
phase: 'Add Spinlock',
file: 'frida-gum/src/spinlock.rs',
description: 'Platform-agnostic spinlock primitive',
platform: 'all',
priority: 'low',
},
{
name: 'InspectorServer',
phase: 'Add InspectorServer',
file: 'frida-gum/src/inspector_server.rs',
description: 'Chrome DevTools protocol debugging server',
platform: 'all',
priority: 'low',
},
{
name: 'MemoryMap',
phase: 'Add MemoryMap',
file: 'frida-gum/src/memory_map.rs',
description: 'Cached memory range enumeration',
platform: 'all',
priority: 'low',
},
]

phase('Add ThumbWriter')
const thumbResult = await agent(
`Create ARM Thumb instruction writer wrapper.

**Task**: Implement ThumbWriter in frida-gum/src/instruction_writer/arm/thumb_writer.rs

**Requirements**:
1. Read target/debug/build/frida-gum-sys-*/out/bindings.rs to find all gum_thumb_writer_* functions
2. Create a complete Rust wrapper following the pattern in x86_64/writer.rs and aarch64/writer.rs
3. Implement InstructionWriter trait
4. Add platform cfg gates: #[cfg(target_arch = "arm")]
5. Include proper documentation
6. Add copyright header: "Copyright © 2026 Kirby Kuehl"
7. Create frida-gum/src/instruction_writer/arm/mod.rs if needed
8. Update frida-gum/src/instruction_writer.rs to export arm module
9. Run cargo fmt and cargo clippy
10. Do NOT commit

Report: file path and line count.`,
{ phase: 'Add ThumbWriter', schema: { type: 'object', properties: { file: { type: 'string' }, lines: { type: 'number' }, status: { type: 'string' } }, required: ['file', 'lines', 'status'] } }
)

phase('Add MipsWriter')
const mipsResult = await agent(
`Create MIPS instruction writer wrapper.

**Task**: Implement MipsWriter in frida-gum/src/instruction_writer/mips/writer.rs

**Requirements**:
1. Read bindings.rs to find all gum_mips_writer_* functions
2. Create complete Rust wrapper
3. Implement InstructionWriter trait
4. Add platform cfg gates: #[cfg(target_arch = "mips")] or #[cfg(target_arch = "mips64")]
5. Include proper documentation
6. Add copyright header: "Copyright © 2026 Kirby Kuehl"
7. Create frida-gum/src/instruction_writer/mips/mod.rs
8. Update frida-gum/src/instruction_writer.rs to export mips module
9. Run cargo fmt and cargo clippy
10. Do NOT commit

Report: file path and line count.`,
{ phase: 'Add MipsWriter', schema: { type: 'object', properties: { file: { type: 'string' }, lines: { type: 'number' }, status: { type: 'string' } }, required: ['file', 'lines', 'status'] } }
)

phase('Add DarwinModule')
const darwinResult = await agent(
`Create Darwin (macOS/iOS) module wrapper for Mach-O binary inspection.

**Task**: Implement DarwinModule in frida-gum/src/darwin_module.rs

**Requirements**:
1. Read bindings.rs to find all gum_darwin_module_* and gum_darwin_grafter_* functions
2. Create DarwinModule struct with all methods
3. Create DarwinGrafter struct
4. Add enums/structs for imports, exports, symbols, sections, fixups, rebases, binds, TLV descriptors
5. Add platform cfg gates: #[cfg(target_vendor = "apple")]
6. Include comprehensive documentation
7. Add copyright header: "Copyright © 2026 Kirby Kuehl"
8. Update frida-gum/src/lib.rs to add: pub mod darwin_module;
9. Run cargo fmt and cargo clippy
10. Do NOT commit

Report: file path and line count.`,
{ phase: 'Add DarwinModule', schema: { type: 'object', properties: { file: { type: 'string' }, lines: { type: 'number' }, status: { type: 'string' } }, required: ['file', 'lines', 'status'] } }
)

phase('Add KernelAPI')
const kernelResult = await agent(
`Create kernel memory operations API wrapper.

**Task**: Implement Kernel API in frida-gum/src/kernel.rs

**Requirements**:
1. Read bindings.rs to find all gum_kernel_* functions
2. Create Kernel struct with methods for: scan, read, write, enumerate_ranges, enumerate_modules, alloc, free
3. Add KernelModule, KernelScanMatch structs
4. Include proper error handling
5. Add comprehensive documentation
6. Add copyright header: "Copyright © 2026 Kirby Kuehl"
7. Update frida-gum/src/lib.rs to add: pub mod kernel;
8. Run cargo fmt and cargo clippy
9. Do NOT commit

Report: file path and line count.`,
{ phase: 'Add KernelAPI', schema: { type: 'object', properties: { file: { type: 'string' }, lines: { type: 'number' }, status: { type: 'string' } }, required: ['file', 'lines', 'status'] } }
)

phase('Add MetalCollections')
const metalResult = await agent(
`Create lock-free collection wrappers for signal-safe callbacks.

**Task**: Implement MetalArray and MetalHashTable

**Requirements**:
1. Read bindings.rs to find gum_metal_array_* and gum_metal_hash_table_* functions
2. Create frida-gum/src/metal_array.rs with MetalArray<T> wrapper
3. Create frida-gum/src/metal_hash_table.rs with MetalHashTable<K, V> wrapper
4. Implement safe Rust APIs wrapping the C functions
5. Add comprehensive documentation explaining signal-safety
6. Add copyright header: "Copyright © 2026 Kirby Kuehl"
7. Update frida-gum/src/lib.rs to add both modules
8. Run cargo fmt and cargo clippy
9. Do NOT commit

Report: files created and total line count.`,
{ phase: 'Add MetalCollections', schema: { type: 'object', properties: { files: { type: 'array', items: { type: 'string' } }, lines: { type: 'number' }, status: { type: 'string' } }, required: ['files', 'lines', 'status'] } }
)

phase('Add Spinlock')
const spinlockResult = await agent(
`Create spinlock primitive wrapper.

**Task**: Implement Spinlock in frida-gum/src/spinlock.rs

**Requirements**:
1. Read bindings.rs to find gum_spinlock_* functions (init, acquire, release, free)
2. Create Spinlock struct with RAII guard pattern
3. Implement safe Rust API with lock() returning a guard
4. Add documentation
5. Add copyright header: "Copyright © 2026 Kirby Kuehl"
6. Update frida-gum/src/lib.rs
7. Run cargo fmt and cargo clippy
8. Do NOT commit

Report: file path and line count.`,
{ phase: 'Add Spinlock', schema: { type: 'object', properties: { file: { type: 'string' }, lines: { type: 'number' }, status: { type: 'string' } }, required: ['file', 'lines', 'status'] } }
)

phase('Add InspectorServer')
const inspectorResult = await agent(
`Create Chrome DevTools protocol debugging server wrapper.

**Task**: Implement InspectorServer in frida-gum/src/inspector_server.rs

**Requirements**:
1. Read bindings.rs to find gum_inspector_server_* functions
2. Create InspectorServer struct
3. Add methods for start, stop, get_address
4. Add documentation explaining Chrome DevTools protocol integration
5. Add copyright header: "Copyright © 2026 Kirby Kuehl"
6. Update frida-gum/src/lib.rs
7. Run cargo fmt and cargo clippy
8. Do NOT commit

Report: file path and line count.`,
{ phase: 'Add InspectorServer', schema: { type: 'object', properties: { file: { type: 'string' }, lines: { type: 'number' }, status: { type: 'string' } }, required: ['file', 'lines', 'status'] } }
)

phase('Add MemoryMap')
const memMapResult = await agent(
`Create cached memory range enumeration wrapper.

**Task**: Implement MemoryMap (different from ModuleMap) in frida-gum/src/memory_map.rs (NOT module_map.rs)

**Requirements**:
1. Read bindings.rs to find GumMemoryMap functions
2. Create MemoryMap struct for cached memory range enumeration
3. Add methods following the C API
4. Add documentation explaining it's an optimization over direct enumeration
5. Add copyright header: "Copyright © 2026 Kirby Kuehl"
6. Update frida-gum/src/lib.rs (use different name to avoid conflict with existing memory_map module)
7. Run cargo fmt and cargo clippy
8. Do NOT commit

Report: file path and line count.`,
{ phase: 'Add MemoryMap', schema: { type: 'object', properties: { file: { type: 'string' }, lines: { type: 'number' }, status: { type: 'string' } }, required: ['file', 'lines', 'status'] } }
)

phase('Verify')
const verifyResult = await agent(
`Verify all implementations build correctly.

**Task**: Build and test

**Requirements**:
1. Run: cargo fmt --all
2. Run: cargo clippy --all-features -- -D warnings
3. Run: cargo build --all-features
4. If errors, fix them
5. Do NOT commit yet

Report: build status and any issues found.`,
{ phase: 'Verify', schema: { type: 'object', properties: { clippy_passed: { type: 'boolean' }, build_passed: { type: 'boolean' }, issues: { type: 'array', items: { type: 'string' } } }, required: ['clippy_passed', 'build_passed', 'issues'] } }
)

return {
summary: 'All missing GUM APIs implemented',
apis_added: APIS.length,
results: {
thumb: thumbResult,
mips: mipsResult,
darwin: darwinResult,
kernel: kernelResult,
metal: metalResult,
spinlock: spinlockResult,
inspector: inspectorResult,
memmap: memMapResult,
verify: verifyResult,
},
}
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ jobs:
profile: minimal
toolchain: nightly
override: true
- name: Download FRIDA
run: |
export FRIDA_VERSION=$(cat FRIDA_VERSION)
cd frida-gum-sys && mkdir -p include && wget https://github.com/frida/frida/releases/download/$FRIDA_VERSION/frida-gum-devkit-$FRIDA_VERSION-linux-x86_64.tar.xz -O frida-gum.tar.xz && tar xJvf frida-gum.tar.xz -C include
cd ..
cd frida-sys && mkdir -p include && wget https://github.com/frida/frida/releases/download/$FRIDA_VERSION/frida-core-devkit-$FRIDA_VERSION-linux-x86_64.tar.xz -O frida-core.tar.xz && tar xJvf frida-core.tar.xz -C include
- name: Build Gum documentation
run: |
cd frida-gum
Expand Down
2 changes: 1 addition & 1 deletion FRIDA_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17.15.3
17.16.1
9 changes: 9 additions & 0 deletions examples/core/inject_lib_blob/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#[cfg(target_os = "linux")]
use frida::{Frida, Inject};
#[cfg(target_os = "linux")]
use std::sync::LazyLock;

#[cfg(target_os = "linux")]
static FRIDA: LazyLock<Frida> = LazyLock::new(|| unsafe { Frida::obtain() });

#[cfg(target_os = "linux")]
fn main() {
let device_manager = frida::DeviceManager::obtain(&FRIDA);
let local_device = device_manager.get_local_device();
Expand All @@ -21,3 +25,8 @@ fn main() {
println!("*** Injected, id={}", id);
}
}

#[cfg(not(target_os = "linux"))]
fn main() {
println!("This example only works on Linux.");
}
7 changes: 3 additions & 4 deletions examples/gum/debug_symbol/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use frida_gum::DebugSymbol;
use frida_gum::{Gum, Module};
use std::iter::Once;
use std::sync::OnceLock;

fn main() {
static CELL: OnceLock<Gum> = OnceLock::new();
let gum = CELL.get_or_init(|| Gum::obtain());
let _gum = CELL.get_or_init(Gum::obtain);

let module = Module::obtain(gum);
let symbol = module.find_export_by_name(None, "mmap").unwrap();
let symbol = Module::find_global_export_by_name("mmap")
.expect("expected `mmap` to be exported by some loaded module");
let symbol_details = DebugSymbol::from_address(symbol).unwrap();
println!(
"address={:#x?} module_name={:?} symbol_name={:?} file_name={:?} line_number={:?}",
Expand Down
4 changes: 2 additions & 2 deletions examples/gum/memory_access_monitor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ fn main() {
let gum = unsafe { frida_gum::Gum::obtain() };
let mam = MemoryAccessMonitor::new(
&gum,
vec![range],
&[range],
frida_gum::PageProtection::Write,
true,
|_, details| {
|details| {
println!(
"[monitor callback] hit: {}, details: {}",
HIT.fetch_add(1, std::sync::atomic::Ordering::SeqCst),
Expand Down
16 changes: 9 additions & 7 deletions examples/gum/open/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use frida_gum as gum;
use gum::{
interceptor::{Interceptor, InvocationContext, InvocationListener},
Gum, Module,
Gum, Module, Process,
};
use std::os::raw::{c_int, c_void};
use std::sync::OnceLock;
Expand All @@ -25,20 +25,22 @@ extern "C" fn example_agent_main(_user_data: *const c_void, resident: *mut c_int
unsafe { *resident = 1 };

static CELL: OnceLock<Gum> = OnceLock::new();
let gum = CELL.get_or_init(|| Gum::obtain());
let gum = CELL.get_or_init(Gum::obtain);

let mut interceptor = Interceptor::obtain(gum);
let mut listener = OpenListener {};

let module = Module::obtain(gum);
let modules = module.enumerate_modules();
for module in modules {
let process = Process::obtain(gum);
for module in process.enumerate_modules() {
let range = module.range();
println!(
"{}@{:#x}/{:#x}",
module.name, module.base_address, module.size
module.name(),
range.base_address().0 as usize,
range.size()
);
}

let open = module.find_export_by_name(None, "open").unwrap();
let open = Module::find_global_export_by_name("open").expect("expected `open` to be exported");
interceptor.attach(open, &mut listener).unwrap();
}
Loading
Loading