Closed Katastropic2431 closed 1 year ago
I am still working on this issue, any helpful input will be greatly appreciated.
I found a fix! I noticed that Sleigh was changing the context register so I just added this line of code to sleigh_interface.cpp to not allow that and it works.
if (arch == Arch::Type::PPC32)
{
m_sleigh->allowContextSet(false);
}
Currently, I'm working on adding PowerPC 32-bit support to Maat by following the contributing.md guide. While testing the branch conditional branch greater or equal to, I encountered an error with the message "terminate called after throwing an instance of 'LowlevelError' on the code block provided. All other assembly instructions are working, but when the Maat engine reads the next assembly line after a conditional branch, it throws a low level error.
This is the error:
Looking at the ghidra source code it the error occurs in
/build/_deps/ghidrasource-src/Ghidra/Features/Decompiler/src/cpp/globalcontext.cc
The low level error is this:throw LowlevelError("Cannot register new context variables after database is initialized");
Like I previous stated, all the other instructions seem to be working including the branch conditional 'BGT' and 'BLT'. However when the maat engine reads the next line assembly line it will throw a 'LowLevelError' if its after a branch conditional regardless if the branch was taken or not.
This error occurs whenever the Global Context is changed, specifically the linkreg.
If anyone can someone provide some input on why this error is occurring.
Edit 1: I am using Ghidra version 10.2.3 Edit 2: After examining Ghidra's issues page, I came across this: https://github.com/NationalSecurityAgency/ghidra/issues/5218, which I think might be relevant to the issue I'm experiencing.