diff options
| author | Zichuan Li <34680029+river-li@users.noreply.github.com> | 2024-08-15 18:23:43 -0400 |
|---|---|---|
| committer | Brandon Miller <brandon@vector35.com> | 2025-05-08 07:23:08 -0400 |
| commit | f07f66ba03dfeed222f419e1bae274e95cbcd2d4 (patch) | |
| tree | ac93834d248b5b2af242a9288785106bcecc354f /platform/efi/efi_resolver/include/Utils.h | |
| parent | 7f08117cfeb48a8f48d08e14cb498ee028efcef2 (diff) | |
misc: formated code and fixed several small issues
1. Fix code related to SMI handlers
2. also parse handlers registered by SxDispatch and parse them together
3. Set Progress Text properly
Diffstat (limited to 'platform/efi/efi_resolver/include/Utils.h')
| -rw-r--r-- | platform/efi/efi_resolver/include/Utils.h | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/platform/efi/efi_resolver/include/Utils.h b/platform/efi/efi_resolver/include/Utils.h index f2c371a8..981908b2 100644 --- a/platform/efi/efi_resolver/include/Utils.h +++ b/platform/efi/efi_resolver/include/Utils.h @@ -6,31 +6,35 @@ using namespace BinaryNinja; static inline std::string GetOriginalTypeName(Ref<Type> type) { - std::string result; - if (type->IsPointer()) { - if (type->GetChildType().GetValue()->IsNamedTypeRefer()) { - return type->GetChildType().GetValue()->GetNamedTypeReference()->GetName().GetString(); - } - return type->GetTypeName().GetString(); - } - if (type->IsNamedTypeRefer()) - return type->GetNamedTypeReference()->GetName().GetString(); + std::string result; + if (type->IsPointer()) + { + if (type->GetChildType().GetValue()->IsNamedTypeRefer()) + { + return type->GetChildType().GetValue()->GetNamedTypeReference()->GetName().GetString(); + } + return type->GetTypeName().GetString(); + } + if (type->IsNamedTypeRefer()) + return type->GetNamedTypeReference()->GetName().GetString(); - return type->GetTypeName().GetString(); + return type->GetTypeName().GetString(); } static inline std::string GetVarNameForTypeStr(const std::string typeStr) { - std::istringstream iss(typeStr); - std::string word; - std::string result; + std::istringstream iss(typeStr); + std::string word; + std::string result; - while (std::getline(iss, word, '_')) { - if (!word.empty()) { - word[0] = std::toupper(word[0]); - std::transform(word.begin() + 1, word.end(), word.begin() + 1, ::tolower); - result += word; - } - } - return result; + while (std::getline(iss, word, '_')) + { + if (!word.empty()) + { + word[0] = std::toupper(word[0]); + std::transform(word.begin() + 1, word.end(), word.begin() + 1, ::tolower); + result += word; + } + } + return result; } |
