diff options
author | Francis Rowe <info@gluglug.org.uk> | 2014-12-22 14:53:11 +0000 |
---|---|---|
committer | Francis Rowe <info@gluglug.org.uk> | 2014-12-22 14:53:39 +0000 |
commit | 2ef2a35be436b7b82e61a5329db08cad446b9532 (patch) | |
tree | d326b20d798d547e0be9b97c64510cd2b5006aae | |
parent | 1e1b97cb39bcdc8da38cbc8fc63d2f6494670aed (diff) | |
download | librebootfr-2ef2a35be436b7b82e61a5329db08cad446b9532.tar.gz librebootfr-2ef2a35be436b7b82e61a5329db08cad446b9532.zip |
ich9deblob: fail on big endian systems
-rw-r--r-- | resources/utilities/ich9deblob/ich9deblob.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/resources/utilities/ich9deblob/ich9deblob.c b/resources/utilities/ich9deblob/ich9deblob.c index 3fb72409..c12f758a 100644 --- a/resources/utilities/ich9deblob/ich9deblob.c +++ b/resources/utilities/ich9deblob/ich9deblob.c @@ -87,6 +87,14 @@ int main(int argc, char *argv[]) return 1; } + // endianness check. big endian forced to fail + unsigned short steak = 0xBEEF; + unsigned char *grill = (char*)&steak; + if (*grill==0xBE) { + printf("\nunsigned short 0xBEEF: first byte should be EF, but it's BE. Your system is big endian, and unsupported (only little endian is tested)\n"); + return 1; + } + // ----------------------------------------------------------------------------------------------- // files that this utility will handle |