U-Boot Header Endianness #7961
Answered
by
ryanmkurtz
GreaterGoodest
asked this question in
Q&A
-
I'm currently trying to write a loader to process a basic uboot image. The majority of the binary is little endian, but the image header itself is big endian. I'm able to handle this from the Ghidra UI, but I'm not sure of the best way to handle it in my loader. Example: public class uBootHeader extends StructureDataType {
public uBootHeader(CategoryPath path, String name, int length) {
super(path, name, 0);
UnsignedIntegerDataType bigEndInteger = new UnsignedIntegerDataType();
add(bigEndInteger, "ih_magic", "");
}
} In this struct, what would be the best way to flip the endianness of the integer I'm adding? |
Beta Was this translation helpful? Give feedback.
Answered by
ryanmkurtz
Mar 28, 2025
Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
GreaterGoodest
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ghidra/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/StructConverter.java
Lines 118 to 139 in 24f46bb