Correct byte order
This commit is contained in:
@@ -4,9 +4,9 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "usb_helpers.h"
|
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "payload.h"
|
#include "payload.h"
|
||||||
|
#include "usb_helpers.h"
|
||||||
|
|
||||||
#ifdef CHECKM8_LOGGING
|
#ifdef CHECKM8_LOGGING
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
@@ -41,7 +41,6 @@ void checkm8_debug_block(const char *format, ...)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
@@ -53,8 +52,8 @@ int main()
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long long data0 = 0xdeadbeefdeadbeef;
|
unsigned char data0[8] = {0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef};
|
||||||
unsigned long long data1 = 0xdeadbeefdeadbeef;
|
unsigned char data1[8] = {0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef};
|
||||||
|
|
||||||
ret = open_device_session(dev);
|
ret = open_device_session(dev);
|
||||||
if(IS_CHECKM8_FAIL(ret))
|
if(IS_CHECKM8_FAIL(ret))
|
||||||
@@ -68,12 +67,12 @@ int main()
|
|||||||
printf("encrypting ");
|
printf("encrypting ");
|
||||||
for(int j = 0; j < 8; j++)
|
for(int j = 0; j < 8; j++)
|
||||||
{
|
{
|
||||||
printf("%02X", ((unsigned char *) &data0)[j]);
|
printf("%02X", data0[j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int j = 0; j < 8; j++)
|
for(int j = 0; j < 8; j++)
|
||||||
{
|
{
|
||||||
printf("%02X", ((unsigned char *) &data1)[j]);
|
printf("%02X", data1[j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
@@ -84,7 +83,8 @@ int main()
|
|||||||
16, // data size
|
16, // data size
|
||||||
0x20000201, // AES_UID_KEY
|
0x20000201, // AES_UID_KEY
|
||||||
0, 0, // no
|
0, 0, // no
|
||||||
data0, data1);
|
*((unsigned long long *) data0),
|
||||||
|
*((unsigned long long *) data1));
|
||||||
|
|
||||||
if(IS_CHECKM8_FAIL(resp->ret))
|
if(IS_CHECKM8_FAIL(resp->ret))
|
||||||
{
|
{
|
||||||
@@ -107,7 +107,7 @@ int main()
|
|||||||
printf("%02X", ((unsigned char *) &data1)[j]);
|
printf("%02X", ((unsigned char *) &data1)[j]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
usleep(250000);
|
usleep(333333);
|
||||||
}
|
}
|
||||||
|
|
||||||
close_device_session(dev);
|
close_device_session(dev);
|
||||||
|
|||||||
Reference in New Issue
Block a user