From ede39aee7e00c40a43b67ca18dd8ab80ee863d85 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Tue, 26 Aug 2025 23:59:38 -0400 Subject: [WARP] Enhanced network support --- plugins/warp/ui/shared/function.cpp | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'plugins/warp/ui/shared/function.cpp') diff --git a/plugins/warp/ui/shared/function.cpp b/plugins/warp/ui/shared/function.cpp index 88d27cd1..e1609e0b 100644 --- a/plugins/warp/ui/shared/function.cpp +++ b/plugins/warp/ui/shared/function.cpp @@ -14,35 +14,15 @@ WarpFunctionItem::WarpFunctionItem(Warp::Ref function, { m_function = function; - // TODO: This needs to be better. Symbol can be nullptr. BinaryNinja::Ref symbol = m_function->GetSymbol(*analysisFunction); std::string symbolName = symbol->GetShortName(); setText(QString::fromStdString(symbolName)); - BinaryNinja::InstructionTextToken nameToken = {255, TextToken, symbolName}; // Serialize the tokens to make it accessible via QModelIndex. // We will take these tokens and then user them in our custom item delegate. - TokenData tokenData = {}; - - // TODO: Make this not look like garbage - BinaryNinja::Ref type = m_function->GetType(*analysisFunction); - if (type) - { - BinaryNinja::Ref platform = analysisFunction->GetPlatform(); - std::vector beforeTokens = type->GetTokensBeforeName(platform); - std::vector afterTokens = type->GetTokensAfterName(platform); - - for (const auto &token: beforeTokens) - tokenData.tokens.emplace_back(token); - tokenData.tokens.emplace_back(255, TextToken, " "); - tokenData.tokens.emplace_back(nameToken); - for (const auto &token: afterTokens) - tokenData.tokens.emplace_back(token); - } else - { - tokenData.tokens.emplace_back(nameToken); - } - + TokenData tokenData = TokenData(symbolName); + if (BinaryNinja::Ref type = m_function->GetType(*analysisFunction)) + tokenData = TokenData(*type, symbolName); setData(QVariant::fromValue(tokenData), Qt::UserRole); } -- cgit v1.3.1