@@ -1952,7 +1952,6 @@ pub struct BasicBlockAnalysisContext {
1952
1952
pub translate_tail_calls : bool ,
1953
1953
pub disallow_branch_to_string : bool ,
1954
1954
pub max_function_size : u64 ,
1955
- pub halt_on_invalid_instruction : bool ,
1956
1955
pub max_size_reached : bool ,
1957
1956
1958
1957
// In/Out
@@ -1962,6 +1961,7 @@ pub struct BasicBlockAnalysisContext {
1962
1961
direct_code_references : HashMap < u64 , ArchAndAddr > ,
1963
1962
direct_no_return_calls : HashSet < ArchAndAddr > ,
1964
1963
halted_disassembly_addresses : HashSet < ArchAndAddr > ,
1964
+ inlined_unresolved_indirect_branches : HashSet < ArchAndAddr > ,
1965
1965
}
1966
1966
1967
1967
impl BasicBlockAnalysisContext {
@@ -2021,6 +2021,15 @@ impl BasicBlockAnalysisContext {
2021
2021
} )
2022
2022
. collect :: < HashSet < _ > > ( ) ;
2023
2023
2024
+ let inlined_unresolved_indirect_branches = ( 0 ..ctx_ref
2025
+ . inlinedUnresolvedIndirectBranchCount )
2026
+ . map ( |i| {
2027
+ let raw =
2028
+ unsafe { std:: ptr:: read ( ctx_ref. inlinedUnresolvedIndirectBranches . add ( i) ) } ;
2029
+ ArchAndAddr :: from ( raw)
2030
+ } )
2031
+ . collect :: < HashSet < _ > > ( ) ;
2032
+
2024
2033
BasicBlockAnalysisContext {
2025
2034
handle,
2026
2035
contextual_returns_dirty : false ,
@@ -2030,12 +2039,12 @@ impl BasicBlockAnalysisContext {
2030
2039
translate_tail_calls : ctx_ref. translateTailCalls ,
2031
2040
disallow_branch_to_string : ctx_ref. disallowBranchToString ,
2032
2041
max_function_size : ctx_ref. maxFunctionSize ,
2033
- halt_on_invalid_instruction : ctx_ref. haltOnInvalidInstructions ,
2034
2042
max_size_reached : ctx_ref. maxSizeReached ,
2035
2043
contextual_returns,
2036
2044
direct_code_references,
2037
2045
direct_no_return_calls,
2038
2046
halted_disassembly_addresses,
2047
+ inlined_unresolved_indirect_branches,
2039
2048
}
2040
2049
}
2041
2050
@@ -2059,6 +2068,10 @@ impl BasicBlockAnalysisContext {
2059
2068
self . halted_disassembly_addresses . insert ( loc) ;
2060
2069
}
2061
2070
2071
+ pub fn add_inlined_unresolved_indirect_branch ( & mut self , loc : ArchAndAddr ) {
2072
+ self . inlined_unresolved_indirect_branches . insert ( loc) ;
2073
+ }
2074
+
2062
2075
pub fn create_basic_block (
2063
2076
& self ,
2064
2077
arch : CoreArchitecture ,
@@ -2135,6 +2148,21 @@ impl BasicBlockAnalysisContext {
2135
2148
}
2136
2149
}
2137
2150
2151
+ if !self . inlined_unresolved_indirect_branches . is_empty ( ) {
2152
+ let total = self . inlined_unresolved_indirect_branches . len ( ) ;
2153
+ let mut locations: Vec < BNArchitectureAndAddress > = Vec :: with_capacity ( total) ;
2154
+ for loc in & self . inlined_unresolved_indirect_branches {
2155
+ locations. push ( loc. into_raw ( ) ) ;
2156
+ }
2157
+ unsafe {
2158
+ BNAnalyzeBasicBlocksContextSetInlinedUnresolvedIndirectBranches (
2159
+ self . handle ,
2160
+ locations. as_mut_ptr ( ) ,
2161
+ total,
2162
+ ) ;
2163
+ }
2164
+ }
2165
+
2138
2166
if self . contextual_returns_dirty {
2139
2167
let total = self . contextual_returns . len ( ) ;
2140
2168
let mut locations: Vec < BNArchitectureAndAddress > = Vec :: with_capacity ( total) ;
0 commit comments