diff --git a/Changelog.md b/Changelog.md index e88380ed4..5afe7603c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,12 @@ +v0.5.2 (2020-1-11) +------------------ +- Fixed: Crash when checking whether a LibProc returns while no FrontEnd is loaded. +- Fixed: Crash when re-decoding while no FrontEnd is loaded. +- Fixed: Whitespace issue in log output. +- Fixed: Attempt to load 8 bit executables even though Boomerang does not support them. + v0.5.1 (2019-10-11) ------------------------ +------------------- - Fixed: Possible crash when replacing Phi by Assign. - Fixed: Possible crash when analyzing binaries with a large number of debug information on Windows. - Fixed: Wrong decompilation of binaries containing a `bswap` instruction. diff --git a/src/boomerang-plugins/decoder/csx86/CapstoneX86Decoder.cpp b/src/boomerang-plugins/decoder/csx86/CapstoneX86Decoder.cpp index 8c0f51b21..deb16515c 100644 --- a/src/boomerang-plugins/decoder/csx86/CapstoneX86Decoder.cpp +++ b/src/boomerang-plugins/decoder/csx86/CapstoneX86Decoder.cpp @@ -153,7 +153,7 @@ bool CapstoneX86Decoder::initialize(Project *project) case 16: cs::cs_option(m_handle, cs::CS_OPT_MODE, cs::CS_MODE_16); break; case 32: cs::cs_option(m_handle, cs::CS_OPT_MODE, cs::CS_MODE_32); break; case 64: cs::cs_option(m_handle, cs::CS_OPT_MODE, cs::CS_MODE_64); break; - default: break; + default: return false; } return true; diff --git a/src/boomerang-plugins/loader/pe/Win32BinaryLoader.cpp b/src/boomerang-plugins/loader/pe/Win32BinaryLoader.cpp index 3565ba2aa..bdabdf128 100644 --- a/src/boomerang-plugins/loader/pe/Win32BinaryLoader.cpp +++ b/src/boomerang-plugins/loader/pe/Win32BinaryLoader.cpp @@ -100,6 +100,8 @@ void Win32BinaryLoader::initialize(BinaryFile *file, BinarySymbolTable *symbols) unload(); m_binaryImage = file->getImage(); m_symbols = symbols; + + file->setBitness(32); } diff --git a/src/boomerang/db/Prog.cpp b/src/boomerang/db/Prog.cpp index 4454b386d..fbeba26cf 100644 --- a/src/boomerang/db/Prog.cpp +++ b/src/boomerang/db/Prog.cpp @@ -320,12 +320,20 @@ bool Prog::isWin32() const QString Prog::getRegNameByNum(RegNum regNum) const { + if (!m_fe || !m_fe->getDecoder()) { + return ""; + } + return m_fe->getDecoder()->getRegNameByNum(regNum); } int Prog::getRegSizeByNum(RegNum regNum) const { + if (!m_fe || !m_fe->getDecoder()) { + return 0; + } + return m_fe->getDecoder()->getRegSizeByNum(regNum); } @@ -635,7 +643,7 @@ bool Prog::decodeFragment(UserProc *proc, Address a) bool Prog::reDecode(UserProc *proc) { - if (!proc) { + if (!proc || !m_fe) { return false; } diff --git a/src/boomerang/db/proc/LibProc.cpp b/src/boomerang/db/proc/LibProc.cpp index 950120b8d..ac0f042dc 100644 --- a/src/boomerang/db/proc/LibProc.cpp +++ b/src/boomerang/db/proc/LibProc.cpp @@ -36,6 +36,10 @@ bool LibProc::isLib() const bool LibProc::isNoReturn() const { + if (!m_prog->getFrontEnd()) { + return false; + } + return m_prog->getFrontEnd()->isNoReturnCallDest(this->getName()) || m_signature->isNoReturn(); } diff --git a/src/boomerang/util/log/Log.cpp b/src/boomerang/util/log/Log.cpp index 9b33fb5c6..b0f219e44 100644 --- a/src/boomerang/util/log/Log.cpp +++ b/src/boomerang/util/log/Log.cpp @@ -152,7 +152,7 @@ void Log::writeLogHeader() logDirect(LogLevel::Message, __FILE__, __LINE__, "This is Boomerang " BOOMERANG_VERSION); logDirect(LogLevel::Message, __FILE__, __LINE__, "Log initialized."); logDirect(LogLevel::Message, __FILE__, __LINE__, - "Log level is '" + levelToString(getLogLevel()) + "'."); + "Log level is '" + levelToString(getLogLevel()).trimmed() + "'."); }