Upgrade to Frida 17.16.4 and add AVX-512/ARM64 PAC instructions - #248
Merged
Conversation
Upgrade Frida from 17.16.1 to 17.16.4 across all three devkit components. Add new instruction writer support from Frida 17.16.1+: x86_64 Writer (AVX-512 instructions): - kmovq: k-register mask operations for AVX-512 - vextracti64x4: extract 256 bits from 512-bit ZMM register - vinserti64x4: insert 256 bits into 512-bit ZMM register - vmovdqu64: unaligned 512-bit moves to/from ZMM registers ARM64 Writer: - movk: move with keep for building 64-bit constants incrementally - pacia: Pointer Authentication Code for ARMv8.3-A security All changes tested with full quality gate (fmt, clippy, build, test).
The function signature expects (reg, imm: u16, shift: u32), not (reg, imm: u32, shift: u8). This was revealed after merging upstream which had updated bindings.
Add ~70 additional x86_64 instruction writer methods: Writer utilities: - clear, cur, offset: Writer state management - set_target_cpu, set_target_abi: Target configuration - get_cpu_register_for_nth_argument: ABI introspection Basic instructions: - put_breakpoint, put_padding, put_nop_padding: Debug/alignment - put_u8, put_s8: Raw byte insertion Call instructions: - put_call_indirect, put_call_near_label, put_call_reg - put_call_reg_offset_ptr, put_call_reg_with_arguments - put_call_*_with_aligned_arguments variants - Full unsafe argument array APIs Flag manipulation: - put_clc, put_stc, put_cld, put_std: Flag operations - put_lahf, put_sahf: Flag register access CPU instructions: - put_cpuid, put_lfence, put_rdtsc, put_pause: CPU features Comparison/test: - put_cmp_imm_ptr_imm_u32, put_cmp_reg_i32, put_cmp_reg_reg - put_cmp_reg_offset_ptr_reg, put_test_reg_u32 Conditional jumps: - put_jcc_short, put_jcc_near: Full conditional jump support Atomic operations: - put_inc_reg_ptr, put_dec_reg_ptr - put_lock_inc_imm32_ptr, put_lock_dec_imm32_ptr - put_lock_cmpxchg_reg_ptr_reg, put_lock_xadd_reg_ptr_reg - put_xchg_reg_reg_ptr Memory operations: - put_mov_reg_near_ptr, put_mov_near_ptr_reg - put_mov_reg_fs_*, put_mov_fs_*: FS segment access - put_mov_reg_gs_*, put_mov_gs_*: GS segment access - put_movdqu_*, put_movq_*: XMM register moves FPU state: - put_fxsave_reg_ptr, put_fxrstor_reg_ptr All changes tested with full quality gate (fmt, clippy, build, test).
Fix imports in the put_pacia_reg_reg example to use the public API. Aarch64Register is re-exported from instruction_writer, not aarch64 submodule.
Remove duplicate doc comment for put_kmovq_kreg_reg_offset_ptr that was causing clippy::empty_line_after_doc_comments error.
Contributor
Author
|
@s1341 another round |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive upgrade from Frida 17.16.1 to 17.16.4 with extensive x86_64 and ARM64 instruction writer enhancements.
Changes
Version Upgrade
FRIDA_VERSIONfrom 17.16.1 to 17.16.4 across all three devkit locations (root, frida-sys, frida-gum-sys)x86_64 Instruction Writer Enhancements (~70 new methods)
Writer Utilities:
clear,cur,offset- Writer state managementset_target_cpu,set_target_abi- Target configurationget_cpu_register_for_nth_argument- ABI introspectionAVX-512 Instructions:
put_kmovq_kreg_reg_offset_ptr/put_kmovq_reg_offset_ptr_kreg- k-register mask operationsput_vextracti64x4_reg_offset_ptr_zmm- Extract 256 bits from 512-bit ZMM registerput_vinserti64x4_zmm_reg_offset_ptr- Insert 256 bits into 512-bit ZMM registerput_vmovdqu64_reg_offset_ptr_zmm/put_vmovdqu64_zmm_reg_offset_ptr- Unaligned 512-bit movesBasic Instructions:
put_breakpoint,put_padding,put_nop_padding- Debug and alignmentput_u8,put_s8- Raw byte insertionCall Instructions:
put_call_indirect,put_call_near_label,put_call_regput_call_reg_offset_ptr,put_call_reg_with_argumentsput_call_*_with_aligned_argumentsvariantsCPU & Flag Instructions:
put_cpuid,put_lfence,put_rdtsc,put_pause- CPU featuresput_clc,put_stc,put_cld,put_std- Flag manipulationput_lahf,put_sahf- Flag register accessComparison & Testing:
put_cmp_imm_ptr_imm_u32,put_cmp_reg_i32,put_cmp_reg_regput_cmp_reg_offset_ptr_reg,put_test_reg_u32put_jcc_short,put_jcc_near- Full conditional jump supportAtomic Operations:
put_inc_reg_ptr,put_dec_reg_ptrput_lock_inc_imm32_ptr,put_lock_dec_imm32_ptrput_lock_cmpxchg_reg_ptr_reg,put_lock_xadd_reg_ptr_regput_xchg_reg_reg_ptrMemory Operations:
put_mov_reg_near_ptr,put_mov_near_ptr_regput_mov_reg_fs_*,put_mov_fs_*- FS segment register accessput_mov_reg_gs_*,put_mov_gs_*- GS segment register accessput_movdqu_*,put_movq_*- XMM register movesFPU State:
put_fxsave_reg_ptr,put_fxrstor_reg_ptr- FPU state save/restoreARM64 Instruction Writer Additions
New Instructions:
put_movk_reg_imm- Move with keep for building 64-bit constants incrementallyput_pacia_reg_reg- Pointer Authentication Code for ARMv8.3-A securityTesting
✅ Full quality gate passed:
cargo fmtcargo clippy --all-targets --all-featurescargo build --all-targets --all-featurescargo test --all-featuresImpact
Notes
This PR consolidates multiple incremental updates into one comprehensive release: