Note: This function only supports MWCC ASCII strings. Other encodings and other compilers are currently not supported.
(obj: &Object, symbol_index: usize, offset: Simm)
| 516 | // Note: This function only supports MWCC ASCII strings. |
| 517 | // Other encodings and other compilers are currently not supported. |
| 518 | fn get_string_data(obj: &Object, symbol_index: usize, offset: Simm) -> Option<&str> { |
| 519 | if let Some(sym) = obj.symbols.get(symbol_index) |
| 520 | && sym.name.starts_with("@stringBase") |
| 521 | && offset.0 != 0 |
| 522 | && let Some(data) = obj.symbol_data(symbol_index) |
| 523 | { |
| 524 | let bytes = &data[offset.0 as usize..]; |
| 525 | if let Ok(Ok(str)) = CStr::from_bytes_until_nul(bytes).map(|x| x.to_str()) { |
| 526 | return Some(str); |
| 527 | } |
| 528 | } |
| 529 | None |
| 530 | } |
| 531 | |
| 532 | // Write the relevant part of the flow analysis out into the FlowAnalysisResult |
| 533 | // the rest of the application will use to query results of the flow analysis. |
no test coverage detected