(addr, string_len)
| 164 | return False |
| 165 | |
| 166 | def create_string(addr, string_len): |
| 167 | if get_segm_name(addr) is None: |
| 168 | debug('Cannot load a string which has no segment - not creating string @ 0x%02x' % addr) |
| 169 | return False |
| 170 | |
| 171 | debug('Found string load @ 0x%x with length of %d' % (addr, string_len)) |
| 172 | # This may be overly aggressive if we found the wrong area... |
| 173 | if idc.get_str_type(addr) is not None and ida_bytes.get_strlit_contents(addr, string_len, STRTYPE_C) is not None and len(ida_bytes.get_strlit_contents(addr, string_len, STRTYPE_C)) != string_len: |
| 174 | debug('It appears that there is already a string present @ 0x%x' % addr) |
| 175 | undefine_string(addr) |
| 176 | |
| 177 | if ida_bytes.get_strlit_contents(addr, string_len, STRTYPE_C) is None and ida_bytes.create_strlit(addr, string_len, STRTYPE_C): |
| 178 | return True |
| 179 | else: |
| 180 | # If something is already partially analyzed (incorrectly) we need to ida_bytes.del_items it |
| 181 | undefine_string(addr) |
| 182 | if ida_bytes.create_strlit(addr, string_len, STRTYPE_C): |
| 183 | return True |
| 184 | debug('Unable to make a string @ 0x%x with length of %d' % (addr, string_len)) |
| 185 | |
| 186 | return False |
| 187 | |
| 188 | def create_offset(addr): |
| 189 | if ida_offset.op_plain_offset(addr, 1, 0): |
no test coverage detected