intellicrack.bridges.cutter
Cutter/Rizin bridge for static and dynamic analysis.
This module provides integration with Cutter/Rizin for disassembly, analysis, and debugging capabilities. Dispatch transparently selects
rzpipe when the rizin binary is available and r2pipe when the radare2 binary is available, so installations that ship only
one of the two toolchains (for example the Cutter+rizin desktop bundle) still initialize successfully.
- class CutterBridge[source]
Bases:
CutterDebugMixinBridge for Cutter/Rizin reverse engineering framework.
Provides static analysis, disassembly, and debugging capabilities through a backend-agnostic analysis-pipe (rzpipe/r2pipe) interface. Composed from the
_CutterBridgeBasecore class together with topical mixin classes that inherit linearly so cross-references resolve through normal MRO. Each mixin groups one surface area so no single class definition exceeds the public method limit.- async shutdown()[source]
Shutdown Cutter bridge and cleanup resources.
Wraps every reference-releasing step in
try/finallysosuper().shutdown()is guaranteed to run even when an intermediate cleanup step raises. Without the guarantee aProcessManagerfailure would leave the baseBridgeStatemarkedconnected=Trueafter the bridge had released its rizin handle, presenting observers with a stuck-alive state.- Return type:
None
- is_rizin_64bit(bits, arch, file_class)[source]
Determine whether a rizin-reported binary is 64-bit.
Rizin’s
ijoutput exposes a binary’s word width through three overlapping fields.bin.bitsis the most direct, but several formats (notably PE32+ and split debug variants) leave it set to a 32-bit value while the architecture or container class still indicates 64-bit. Combining the three sources matches what Cutter itself does when classifying loaded binaries.- Parameters:
- Returns:
Truewhen any of the three sources indicates 64-bit word size.- Return type:
- validate_r2_argument(value, *, field)[source]
Reject raw user input that would inject rizin command-control characters.
Rizin parses
;as a command separator,@as a temporary seek,|as a shell pipe,~as the internal grep operator, backticks as nested-command substitution,>as redirection, and treats$/#as variable / comment prefixes. Forwarding untrusted user input directly into command strings allows arbitrary rizin commands to run in the analysed session, including file writes throughwxor process spawning through!.- Parameters:
- Returns:
The unmodified
valuewhen safe to forward.- Return type:
- Raises:
ToolError – When
valuecontains a rizin command-control character or starts with!(shell escape).