| 244 | } |
| 245 | |
| 246 | bool parse_fish_cmd(const std::string& line, std::string& command) { |
| 247 | std::string t = trim(line); |
| 248 | const std::string k1 = "- cmd:"; |
| 249 | const std::string k2 = "cmd:"; |
| 250 | if (t.rfind(k1, 0) == 0) command = trim(t.substr(k1.size())); |
| 251 | else if (t.rfind(k2, 0) == 0) command = trim(t.substr(k2.size())); |
| 252 | else return false; |
| 253 | return looks_like_command(ByteBuf(command.begin(), command.end())); |
| 254 | } |
| 255 | |
| 256 | std::vector<std::string> extract_printable_strings(const std::vector<u8>& buf, |
| 257 | std::size_t min_len = 4) { |
no test coverage detected