Looking for a way to determine whether the loaded binary in IDA is either little or big endian (example do i have a MIPSLE or MIPSBE binary open). I want to avoid just running "file" on the executable, as I may just not have a copy of the executable.
1 Answer
Found the solution. It is slightly hidden but it is: idaapi.cvar.inf.mf
This returns true on Big and false on Little endian.
idaapi.py uses it:
def as_unicode(s):
"""
Convenience function to convert a string into appropriate unicode format
"""
# use UTF16 big/little endian, depending on the environment?
return unicode(s).encode("UTF-16" + ("BE" if _idaapi.cvar.inf.mf else "LE"))