From 2ef2a35be436b7b82e61a5329db08cad446b9532 Mon Sep 17 00:00:00 2001 From: Francis Rowe Date: Mon, 22 Dec 2014 09:53:11 -0500 Subject: ich9deblob: fail on big endian systems --- diff --git a/resources/utilities/ich9deblob/ich9deblob.c b/resources/utilities/ich9deblob/ich9deblob.c index 3fb7240..c12f758 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 -- cgit v0.9.1