@@ -35,17 +35,6 @@ static int cmp_sec_range(const RCoreSecRange *a, const RCoreSecRange *b) {
3535 return (fa > fb )? 1 : (fa < fb )? -1 : 0 ;
3636}
3737
38- static const char * data_types [] = { "CSTRINGS" , "CONST" , "cfstring" , "4BYTE" , "8BYTE" , "16BYTE" , NULL };
39- static bool is_data_section_type (const char * type ) {
40- const char * * dt = data_types ;
41- for (; * dt ; dt ++ ) {
42- if (r_str_startswith (type , * dt )) {
43- return true;
44- }
45- }
46- return false;
47- }
48-
4938static RVecRCoreSecRange * r_core_get_sec_ranges (RCore * core ) {
5039 RCorePriv * priv = core -> priv ;
5140 // Check if we have a cached result
@@ -76,12 +65,12 @@ static RVecRCoreSecRange *r_core_get_sec_ranges(RCore *core) {
7665 if (to <= from ) {
7766 continue ;
7867 }
68+ if (section -> perm & R_PERM_W ) {
69+ continue ;
70+ }
7971 RCoreSecRange r = {
8072 .from = from ,
8173 .to = to ,
82- .executable = (section -> perm & R_PERM_X ) != 0 ,
83- .has_strings = section -> has_strings ,
84- .is_data_type = is_data_section_type (section -> type )
8574 };
8675 RVecRCoreSecRange_push_back (sr , & r );
8776 }
@@ -160,6 +149,11 @@ static int cmpaddr(const void *_a, const void *_b) {
160149 return (a -> addr > b -> addr )? 1 : (a -> addr < b -> addr )? -1 : 0 ;
161150}
162151
152+ static int cmp_ut64 (const ut64 * a , const void * _b ) {
153+ const ut64 * b = (const ut64 * )_b ;
154+ return (* a > * b )? 1 : (* a < * b )? -1 : 0 ;
155+ }
156+
163157static void init_addr2klass (RCore * core , RBinObject * bo ) {
164158 if (bo -> addr2klassmethod ) {
165159 return ;
@@ -287,13 +281,6 @@ static bool is_string_at(RCore *core, ut64 addr, char *str, int *olen, const RVe
287281 return false;
288282 }
289283 const RCoreSecRange * r = RVecRCoreSecRange_at (sr , idx );
290- #if 0
291- // Skip strings in executable sections unless they contain actual string data
292- // (e.g., Mach-O __cstring which is executable but contains string data)
293- if (r -> executable && !r -> has_strings && !r -> is_data_type ) {
294- return false;
295- }
296- #endif
297284 if (addr + 4 > r -> to ) {
298285 return false;
299286 }
@@ -1179,15 +1166,7 @@ static bool __core_anal_fcn(RCore *core, ut64 at, ut64 from, int reftype, int de
11791166 RIOMap * map = r_io_map_get_at (core -> io , addr );
11801167 // only get next if found on an executable section
11811168 if (!map || (map && map -> perm & R_PERM_X )) {
1182- ut64 * iter ;
1183- bool found = false;
1184- R_VEC_FOREACH (& next , iter ) {
1185- if (* iter == addr ) {
1186- found = true;
1187- break ;
1188- }
1189- }
1190- if (!found ) {
1169+ if (!RVecUT64_find (& next , & addr , cmp_ut64 )) {
11911170 ut64 at = r_anal_function_max_addr (fcn );
11921171 while (true) {
11931172 ut64 size ;
@@ -1198,7 +1177,6 @@ static bool __core_anal_fcn(RCore *core, ut64 at, ut64 from, int reftype, int de
11981177 at += size ;
11991178 }
12001179 // TODO: ensure next address is function after padding (nop or trap or wat)
1201- // XXX noisy for test cases because we want to clear the stderr
12021180 r_cons_clear_line (core -> cons , true, true);
12031181 if (verbose ) {
12041182 loganal (fcn -> addr , at , 10000 - depth );
@@ -5357,7 +5335,6 @@ bool fcn_merge_touch_cb(ut64 addr, struct r_merge_ctx_t *ctx) {
53575335 if (ctx -> cur == fcn ) {
53585336 return true;
53595337 }
5360-
53615338 // Function we're trying to merge into
53625339 if (ctx -> merge == fcn ) {
53635340 found = true;
0 commit comments