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 1


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"))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.