dewolf
dewolf copied to clipboard
[Lifter] refactor constants.py and globals.py
Proposal
Refactor constants.py
and globals.py
after #107 is done, since the changes may render some parts of code unused. I suspect that continuous development of Binary Ninja also makes some infos easier to access.
For instance, we may want to use value
property of Binja's DataSymbol
to retrieve initial values of some types of global variables instead of trying to read bytes on that location.
Another example is getting name of DataSymbol
directly via name
property instead of trying to read again symbol on that address first. Of course, it may still not work for every case, but I think it allows more confidence in more common cases.
Ensure that refactoring changes do not break any existing functionality and do not lead to decompilation errors.
Approach
Check what infos we are able to get from various symbols in Binary Ninja and utilize that if appropriate. Split large methods doing multiple tasks onto smaller ones.