various stuff
This commit is contained in:
+14
-8
@@ -38,8 +38,12 @@
|
||||
|
||||
#include "cmdline.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned const char default_key[] =
|
||||
{ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04,
|
||||
0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
unsigned char cla;
|
||||
unsigned char ins;
|
||||
unsigned char p1;
|
||||
@@ -48,26 +52,28 @@ typedef struct
|
||||
unsigned char data[0xff];
|
||||
} APDU;
|
||||
|
||||
static void
|
||||
dumpHex (unsigned char *buf, int len)
|
||||
static void dump_hex(const unsigned char *buf, int len)
|
||||
{
|
||||
int i;
|
||||
printf("length: %d\n", len);
|
||||
for (i = 0; i < len; i++) {
|
||||
printf("0x%02x ", buf[i]);
|
||||
if(i != 0 && i % 8) {
|
||||
if (i % 8 == 7) {
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct gengetopt_args_info args_info;
|
||||
|
||||
if (cmdline_parser (argc, argv, &args_info) != 0)
|
||||
if (cmdline_parser(argc, argv, &args_info) != 0) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
dump_hex(default_key, 24);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user